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

Allow customizing patch automerge behavior for selected dependencies #107

Merged
merged 3 commits into from
Jun 7, 2024

Conversation

simu
Copy link
Member

@simu simu commented Jun 6, 2024

This PR introduces a new cookiecutter argument which allows users to specify zero or more regex patterns for dependencies whose patch level updates shouldn't be automerged.

The template expects that the contents of the new argument is a string which contains zero or more regex patterns separated by semicolons. The template will use these patterns as the values for the package rule field excludePackagePatterns.

Additionally, this PR introduces a new cookiecutter argumentautomerge_patch_v0_regexp_allowlist which can be used to selectively enable patch automerging for v0.x dependencies.

The template expects that the content of the new argument is a string which contains zero or more regexp patterns separated by semicolons.

If global automerging of patch updates for v0.x dependencies is disabled, but automerge_patch_v0_regexp_allowlist isn't empty, the template generates an additional package rule that enables automerge only for dependencies that are currently v0.x and which match one of the patterns provided in the argument.

This package rule is not required and therefore not generated when automerge_patch_v0 is enabled. If you want to disable automerging for some v0.x patch level updates but automerge patch level updates for v0.x dependencies by default, you can specify patterns for which no patch level updates should be merged in cookiecutter argument automerge_patch_regexp_blocklist.

Checklist

  • The PR has a meaningful title. It will be used to auto generate the
    changelog.
    The PR has a meaningful description that sums up the change. It will be
    linked in the changelog.
  • PR contains a single logical change (to build a better changelog).
  • Categorize the PR by adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog.

@simu simu added the enhancement New feature or request label Jun 6, 2024
Base automatically changed from feat/post-gen-project-hook-package-rules to main June 7, 2024 09:52
@simu simu force-pushed the feat/configurable-patch-automerge branch from 54fb4bd to f37f565 Compare June 7, 2024 09:52
We introduce a new cookiecutter argument which allows users to specify
zero or more regex patterns for dependencies whose patch level updates
shouldn't be automerged.

The template expects that the contents of the new argument is a string
which contains zero or more regex patterns separated by semicolons. The
template will use these patterns as the values for the package rule
field `excludePackagePatterns`.
@simu simu force-pushed the feat/configurable-patch-automerge branch from f37f565 to f58f61e Compare June 7, 2024 09:55
@simu simu changed the title Allow disabling patch automerge for selected dependencies Allow customizing patch automerge behavior for selected dependencies Jun 7, 2024
…encies

This commit introduces a new cookiecutter argument
`automerge_patch_v0_regexp_allowlist` which can be used to selectively
enable patch automerging for v0.x dependencies.

The template expects that the content of the new argument is a string
which contains zero or more regexp patterns separated by semicolons.

If global automerging of patch updates for v0.x dependencies is
disabled, but `automerge_patch_v0_regexp_allowlist` isn't empty, the
template generates an additional package rule that enables automerge
only for dependencies that are currently v0.x and which match one of the
patterns provided in the argument.

This rule is not required and therefore not generated when
`automerge_patch_v0` is enabled. If you want to disable automerging for
some v0.x patch level updates but automerge patch level updates for v0.x
dependencies by default, you can specify patterns for which patch level
updates shouldn't be automerged in cookiecutter argument
`automerge_patch_regexp_blocklist`.
@simu simu force-pushed the feat/configurable-patch-automerge branch from 4a11211 to e67a246 Compare June 7, 2024 11:29
@simu simu requested a review from a team June 7, 2024 11:29
Move default configuration that's shared between all rules into a
function instead of repeating the raw dict for each rule.
@simu simu force-pushed the feat/configurable-patch-automerge branch from 8c41775 to bb95794 Compare June 7, 2024 11:52
@simu simu merged commit 6bc56bd into main Jun 7, 2024
39 checks passed
@simu simu deleted the feat/configurable-patch-automerge branch June 7, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants