docker-gitlab icon indicating copy to clipboard operation
docker-gitlab copied to clipboard

can't access rails console in order to enable a feature that is disabled by default

Open jorgebsa opened this issue 6 years ago • 4 comments

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!

jorgebsa avatar Jan 31 '20 20:01 jorgebsa

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.

Gaibhne avatar Feb 06 '20 11:02 Gaibhne

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.

jorgebsa avatar Feb 07 '20 17:02 jorgebsa

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 :)

jorgebsa avatar Feb 07 '20 17:02 jorgebsa

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.

kkimurak avatar Mar 29 '24 08:03 kkimurak