Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gitlab): Auto-detect squash settings #11029

Merged
merged 4 commits into from Aug 4, 2021

Conversation

56KBs
Copy link
Contributor

@56KBs 56KBs commented Jul 30, 2021

Changes:

When using a supported version of GitLab (14.0+), extract whether the repository requires, or encourages squashing, raising all new pull requests with squash enabled in those scenarios.

If an unsupported version of GitLab is encountered, squashing will not occur.

Context:

Closes #7859 .

When a PR is raised within GitLab, with the squash: true value set, this means that the Renovate automated merging scenario should work without issue, as GitLab will respect the previously set squash: true value.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Matthew Palmer added 2 commits July 30, 2021 16:42
When using a supported version of GitLab (14.0+), extract whether the repository requires, or encourages squashing, raising all new pull requests with squash enabled in those scenarios.

If an unsupported version of GitLab is encountered, squashing will not occur.
lib/platform/gitlab/index.spec.ts Show resolved Hide resolved
lib/platform/gitlab/index.spec.ts Show resolved Hide resolved
lib/platform/gitlab/index.spec.ts Outdated Show resolved Hide resolved
lib/platform/gitlab/index.spec.ts Outdated Show resolved Hide resolved
@viceice
Copy link
Member

viceice commented Aug 2, 2021

This also d isn't a solution for #7859, as it only implements auto squash and not explicit config options as required per issue.

@viceice
Copy link
Member

viceice commented Aug 2, 2021

This should also update docs to reflect the changes

@56KBs
Copy link
Contributor Author

56KBs commented Aug 2, 2021

This also d isn't a solution for #7859, as it only implements auto squash and not explicit config options as required per issue.

From my understanding of the issue it's to be able to support Renovate raising PRs that can be auto-merged, this MR does fix this issue. Later discussions mentioned the possibility of manual configuration in order to achieve this.

Now that automergeStrategy I think this actually makes it slightly more difficult to implement explicit configuration, as automergeStrategy: squash can be used to force Renovate to raise with the squash flag. However I don't feel there is a suitable automergeStrategy value to stop Renovate raising with squash in the scenario your repository is configured with squashing allowed.

I'm happy to implement the desired behaviour but I chose not to do it in this PR due to the additional complexity of it.

This should also update docs to reflect the changes

Where is the most suitable location for this documentation? I don't see any documentation for GitLab at a platform level to add to.

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@56KBs
Copy link
Contributor Author

56KBs commented Aug 4, 2021

De-conflicted - Thanks for updating the description to just reference, rather than close the ticket 👍 If this does get merged I will carry on the conversation within the original ticket to see what the expected behaviour would be for an explicit configuration option.

@rarkins
Copy link
Collaborator

rarkins commented Aug 4, 2021

I reopened #10870 so that this PR can close #7859

@rarkins rarkins requested a review from viceice August 4, 2021 08:55
@rarkins rarkins merged commit 0952ff5 into renovatebot:main Aug 4, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 25.67.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@56KBs 56KBs deleted the feat/gitlab-identify-squash-setting branch August 4, 2021 12:17
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support GitLab merge requirements
4 participants