can't access rails console in order to enable a feature that is disabled by default
I'm trying to enable the JUnit visualization view described on the official documentation, but they mention that it must be enabled through the rails console:
Enabling the feature
This feature comes with the :junit_pipeline_view feature flag disabled by default. To enable this feature, ask a GitLab administrator with Rails console access to run the following command:
Feature.enable(:junit_pipeline_view)
Since I have no experience with rails, I was looking at this project's repository and documentation but wasn't able to find any helper in place (like an env var) that enables that feature or information on how to access the rails console in order to execute the command.
Then i went looking at the official docs and they suggest executing gitlab-rails console or gitlab-rails runner "RAILS_COMMAND" if it's a simple command (which is the case here).
So, i went into the running container with docker exec -it name bash and tried those commands, both failed with the command not found message. I went into the /home/git/gitlab/bin directory and found a rails executable there, which i used to run rails console and executed the Feature.enable(:junit_pipeline_view) command mentioned in the official doc. But that apparently had no effect.
Has anyone had success turning on this JUnit before using this image? If so, could you share the steps to reproduce it? Otherwise, instructions on how to correctly access the gitlab rails console and execute commands on it using this image would be appreciated.
Thanks!
The magic command is docker exec -it YourGitlabContainer bin/rails console. But I would ask that you leave this issue open in order to get a Docker env/config file flag to enable this feature.
Agree, having a flag to turn this feature on to the final user without having them to go through the hassle would be amazing. I will try again to turn it on running the console, will update with results when possible.
Alright, the command suggested by @Gaibhne was what i was looking for:
➜ ~ docker exec -it my-container bin/rails console
--------------------------------------------------------------------------------
GitLab: 12.7.5 (b0fe37ef58e)
GitLab Shell: 11.0.0
PostgreSQL: 9.6.1
--------------------------------------------------------------------------------
Loading production environment (Rails 5.2.3)
irb(main):001:0>
irb(main):002:0> Feature.enable(:junit_pipeline_view)
=> true
irb(main):003:0> quit
➜ ~
Just checked the pipeline view, and the junit view was there, no need to restart anything. Thanks! Hope this becomes a flag in a future release :)
As #2917 merged, sameersbn/gitlab:16.10.1 or later contains the feature. You may want to set GITLAB_FEATURE_FLAGS_DISABLE_TARGETS or GITLAB_FEATURE_FLAGS_ENABLE_TARGETS.