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

ci: activate renovateBot #8

Merged
merged 5 commits into from
Nov 8, 2023

Conversation

chickenandpork
Copy link
Contributor

@chickenandpork chickenandpork commented Nov 6, 2023

This PR activates the Renovate tool (a more capable Dependabot) to detect outdated dependencies and propose updates via PR; the PR then goes through standard build checks before being reviewed and accepted by a team member.

Renovate Overview for this repo would be at:

https://developer.mend.io/github/jqlang/bazel_rules_jq

.github/renovate.json Outdated Show resolved Hide resolved
@chickenandpork chickenandpork force-pushed the ci/activate-renovatebot branch from efb4b45 to 6752b15 Compare November 6, 2023 10:32
@chickenandpork
Copy link
Contributor Author

I think 6752b15 is sufficient to activate it -- bazel dependencies should get PRs by default, but I seem to have the config block this this fairly often:

  "packageRules": [
    {
      "enabled": true,
      "matchManagers": [ "bazel" ],
      ...
    }
  ],

Let's see if this activates. A later definition of "latest" to provide a default JQ version without a mutable tag behaviour might be next.

@chickenandpork
Copy link
Contributor Author

OK. I've evolved this PR a bit:

Selective automerge has returned

  "packageRules": [
    {
      "enabled": true,
      "matchManagers": ["regex"],
      "matchUpdateTypes": ["patch", "minor"],
      "automerge": true
    }
  ],

For regex manager, after a PR builds/unittests cleanly, merge it on the next pass of Renovate if the update is a minor or patch revision.

Maintain a file

I've done this before to get some metadata written in duplicate when the project is maintained by renovate:

  "regexManagers": [
    {
      "fileMatch": ["renovate-regex.json$"],            <== maintain this file
      "matchStrings": [ ... some really whitespace-vulnerable regex  ... ],
      ...
    }
  ],

What this will do is cause the JSON-formatted content in .github/renovate-regex.json to be updated as Renovate detects a newer tag in GitHub of the form ^jq-[0-9]+(\.[0-9]+)?(\.[0-9]+)?$ -- so...jq-1.6, jq-1.7, jq-1.7.1, jq-1.8...

This ultimately means "allow renovateBot to merge a change detected in the regexManager, of which currently only one file is maintained". Essentially "update the version of JQ when the release tag bumps".

I intend to allow this to make a very deliberate update to a sane default value: when jq-1.7.1 or jq-1.8 is released, this will PR an update to change the default, and automerge it.

Currently unused, but I expect this to immediately suggest an update jq-1.6 --> jq-1.7; after confirming that this is cleanly managed, I can parse that file back in as a zero-effort maintained default value of 1.7 and move the parameter of jq_version to be optional with a sensible default.

HOLY MOLY this seems like a lot of effort

I love automation; I appreciate being able to position this and other slow changes on autopilot, even if the regex and data flows can be a puzzle. Thanks for allowing me to stitch these together.

"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}"
}
],
"reviewers": ["@chickenandpork"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Flags me as reviewer. I see them faster and can click "yes, machine". Can still require clean checks at repo and org level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can also flag a "team" within the "organization" as reviewers if we prefer. As well, Renovate will happily "choose 2 at random from this team" (I think I had that working at an employer a year ago)

Copy link
Contributor

Choose a reason for hiding this comment

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

sure why not a team?

Copy link
Contributor Author

@chickenandpork chickenandpork Nov 7, 2023

Choose a reason for hiding this comment

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

89fe6e7 implements a suggestion: it's a more trivial "someone from this group" leveraging GitHub to map people rather than a list of people. I think Github can do this, but not Gitlab ?

@emanuele6 emanuele6 requested review from nicowilliams and removed request for emanuele6 November 7, 2023 06:17
.github/renovate.json Outdated Show resolved Hide resolved
@chickenandpork chickenandpork requested review from emanuele6 and a team and removed request for emanuele6 and nicowilliams November 7, 2023 23:59
.github/renovate.json Outdated Show resolved Hide resolved
review group doesn't need to be admins
@nicowilliams nicowilliams merged commit 1c14aed into jqlang:main Nov 8, 2023
6 checks passed
@chickenandpork chickenandpork deleted the ci/activate-renovatebot branch November 8, 2023 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants