Skip to content

Fill default suggestion commit message values in the placeholder instead of showing the variable slugs

Thomas Randolph requested to merge tor/defect/commit-message-placeholders into master

What does this MR do?

For #291027 (closed)

This MR fills in variables in the default commit message for suggestions.

Administrators can define a default commit message suggestion, and use variables (like %{project_name}) in the default. This MR actually interpolates those variables into the placeholder so that if a user chooses to not fill in the message (and thus use the default), they can see what it will look like.

Known Issues

The way we've implemented this (by providing many of the details via diffs_metadata.json, and others via the file itself), we cannot do most of this interpolation outside of the Changes tab.

Overview Tab Suggestions don't have an attached file, and they don't have the diffs_metadata.json information
Suggestion commit message on Overview tab

This was an oversight when we were first planning this feature, and we'll need to consider some other way to load the pertinent data for locations other than the Changes tab.

I've opened #300749 (closed) to address suggestions outside the MR Diffs App / Changes tab.

Screenshots (strongly suggested)

Before After
image image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Thomas Randolph

Merge request reports

Loading