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

Generate component renovate.json in post-gen-project hook #106

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

simu
Copy link
Member

@simu simu commented Jun 6, 2024

We expect that writing more complex package rules as Jinja2 templates in JSON will quickly become unreadable, so we move generating the component's renovate.json to the template's pos-gen-project Python hook where we can generate the desired package rules and other conditional configurations more easily.

Follow-up to #101

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.
  • Link this PR to related issues or PRs.

@simu simu added the change label Jun 6, 2024
@simu simu force-pushed the feat/post-gen-project-hook-package-rules branch 4 times, most recently from 00286c4 to 7c6ac0f Compare June 6, 2024 11:44
@simu
Copy link
Member Author

simu commented Jun 6, 2024

Note that this changes the JSON layout a bit:

--- base/renovate.json	2024-06-06 13:45:07.245014870 +0200
+++ feat/renovate.json	2024-06-06 13:47:36.637434662 +0200
@@ -11,17 +11,23 @@
     "commands": [
       "make gen-golden-all"
     ],
-    "fileFilters": [ "tests/golden/**" ],
+    "fileFilters": [
+      "tests/golden/**"
+    ],
     "executionMode": "update"
   },
-  "suppressNotifications": [ "artifactErrors" ],
+  "suppressNotifications": [
+    "artifactErrors"
+  ],
   "labels": [
     "dependency"
   ],
   "separateMinorPatch": true,
   "packageRules": [
     {
-      "matchUpdateTypes": ["patch"],
+      "matchUpdateTypes": [
+        "patch"
+      ],
       "matchCurrentVersion": "!/^v?0\\./",
       "automerge": true,
       "platformAutomerge": false,

@simu simu requested a review from a team June 6, 2024 12:33
@simu simu changed the title Move generating patch automerge package rules to post-gen-project hook Generate patch automerge package rules in post-gen-project hook Jun 6, 2024
@simu simu force-pushed the feat/post-gen-project-hook-package-rules branch from 7c6ac0f to 10827f2 Compare June 6, 2024 12:33
Copy link

@bastjan bastjan left a comment

Choose a reason for hiding this comment

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

Maybe we should move the whole renovate.json dict into python?

@simu
Copy link
Member Author

simu commented Jun 6, 2024

Maybe we should move the whole renovate.json dict into python?

I've considered that, but I'm not sure if having the whole renovate.json in the post-gen-project hook would be more or less surprising than the current mixed approach.

@simu
Copy link
Member Author

simu commented Jun 6, 2024

follow-up: see ebd82f5 for a draft implementation which fully generates the renovate.json from the post-gen-project hook.

After staring at it for a bit, I think I'll use that version (+ a note in the template repo README to reduce confusion levels if someone wants to adjust the templated renovate.json).

@simu simu changed the title Generate patch automerge package rules in post-gen-project hook Generate component renovate.json in post-gen-project hook Jun 7, 2024
@simu simu requested a review from bastjan June 7, 2024 09:03
Copy link

@bastjan bastjan left a comment

Choose a reason for hiding this comment

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

i like that we now can add comments as we like 👍

@simu simu merged commit c07c837 into main Jun 7, 2024
39 checks passed
@simu simu deleted the feat/post-gen-project-hook-package-rules branch June 7, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants