Skip to content

Add ability to disable Merge Request URL on push

What does this MR do?

Creates an option to disable the printing of the URL to create or view a Merge Request on git push. This is a project-level option. A new checkbox is added to the project settings, and the internal API call for Merge Request URLs, used by GitLab-Shell, returns an empty array if the setting is disabled.

Are there points in the code the reviewer needs to double check?

  • ~~The wording of the checkbox is such that it is an option to "Disable" the URL, rather than to "Enable" it. I felt that in code, this had better fallback characteristics (e.g. if GitLab-Shell doesn't receive a value from the API for some unforeseen reason, it will print the URL by default). However, we might want to think about the UX and decide whether it makes more sense for the option on the settings page to be for enabling, rather than disabling.~~

  • The new internal API call just returns a hash with the project setting. I could encapsulate the creation of that hash into a Service, which would be better if more items are added later. But for now, since it's so simple, I just left it. Let me know if that should be extracted.

  • I'm also wondering if I should create a documentation page for this? On one hand, it's a pretty small feature. On the other hand, it might be confusing, so linking to a page might be helpful?

Why was this MR needed?

To allow users to disable the URL from being printed on push (see #21451 (closed) ).

Screenshots (if relevant)

The new checkbox:

2017-03-16_0845

When it is unchecked, the URL is not printed on push. So a push looks like this:

2017-03-02_0857

As opposed to the default, checked functionality:

2017-03-02_0857

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #21451 (closed)

Merge request reports