Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

ci: migrate to Renovate

justinf2d63475eeed
diff --git a/.github/contribution-policy.json b/.github/contribution-policy.json
index 5759de029..7b3f52144 100644
--- a/.github/contribution-policy.json
+++ b/.github/contribution-policy.json
@@ -27,6 +27,11 @@
}
],
"exemptBots": [
+ {
+ "id": 29139614,
+ "login": "renovate[bot]",
+ "reason": "Repository-managed dependency updates."
+ },
{
"id": 49699333,
"login": "dependabot[bot]",
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index da1de32a8..000000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-version: 2
-updates:
- # Single entry at the workspace root. This repo is a pnpm workspace with one
- # root pnpm-lock.yaml, so dependabot must run from "/" to discover every
- # workspace package AND regenerate the shared lockfile. Targeting individual
- # subdirectories bumps each package.json but leaves the root lockfile stale,
- # which breaks `pnpm install --frozen-lockfile` in CI.
- - package-ecosystem: "npm"
- directory: "/"
- schedule:
- interval: "weekly"
- commit-message:
- prefix: "chore(deps)"
- open-pull-requests-limit: 10
- groups:
- # Batch all non-major updates into a single PR to minimise lockfile churn.
- # Major bumps still open individually so they keep getting reviewed.
- npm-minor:
- patterns:
- - "*"
- update-types:
- - "minor"
- - "patch"
-
- - package-ecosystem: "github-actions"
- directory: "/"
- schedule:
- interval: "weekly"
- commit-message:
- prefix: "ci(deps)"
diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml
deleted file mode 100644
index 2d661cea1..000000000
--- a/.github/workflows/auto-merge.yml
+++ /dev/null
@@ -1,67 +0,0 @@
-name: Dependabot Auto-Merge
-
-# Never check out or execute pull-request content in this privileged workflow.
-on:
- # zizmor: ignore[dangerous-triggers] Never checks out or executes pull
- # request content; merges via the GitHub API only after required checks pass
- # and the head commit is pinned.
- pull_request_target:
- types: [opened, synchronize]
-
-permissions:
- contents: read
- pull-requests: read
-
-jobs:
- dependabot:
- runs-on: blacksmith-4vcpu-ubuntu-2404
- timeout-minutes: 45
- # Only Dependabot-created updates opt into automation. A maintainer reopening
- # or marking a rejected PR ready must not override the earlier decision.
- if: >-
- github.event.sender.login == 'dependabot[bot]' &&
- github.event.pull_request.user.login == 'dependabot[bot]' &&
- github.event.pull_request.base.ref == 'main' &&
- github.event.pull_request.head.repo.full_name == github.repository
- permissions:
- contents: write
- pull-requests: write
- checks: read
- statuses: read
- steps:
- - name: Dependabot Metadata
- id: metadata
- uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3
- with:
- github-token: ${{ github.token }}
-
- - name: Merge eligible npm updates after required checks pass
- if: >-
- steps.metadata.outputs.package-ecosystem == 'npm_and_yarn' &&
- (steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
- steps.metadata.outputs.update-type == 'version-update:semver-minor')
- env:
- GH_TOKEN: ${{ github.token }}
- PR_URL: ${{ github.event.pull_request.html_url }}
- PR_NUMBER: ${{ github.event.pull_request.number }}
- EXPECTED_HEAD: ${{ github.event.pull_request.head.sha }}
- run: |
- set -euo pipefail
- # A later bot update must not re-enable automation on a rejected PR.
- gh api --paginate "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/events" \
- | jq -se 'add | all(.[]; .event != "closed")'
- # Only manifests and the lockfile are eligible, including on renames.
- gh api --paginate "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/files" \
- | jq -se 'add | length > 0 and all(.[];
- .status != "renamed" and
- (.filename == "pnpm-lock.yaml" or
- .filename == "package.json" or
- (.filename | test("^(apps|packages)/[^/]+/package\\.json$"))))'
-
- # No configured/visible required checks is a failure, never permission to merge.
- gh pr checks "$PR_URL" --required --watch --fail-fast --interval 20
- gh pr checks "$PR_URL" --required --json name,bucket \
- | jq -e 'length > 0 and all(.[]; .bucket == "pass")'
- gh pr view "$PR_URL" --json headRefOid \
- | jq -e --arg sha "$EXPECTED_HEAD" '.headRefOid == $sha'
- gh pr merge "$PR_URL" --auto --squash --match-head-commit "$EXPECTED_HEAD"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9c72bb11c..db5ad710a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -73,7 +73,22 @@ issue gains or loses the label, and when the voucher list changes. It can't
react to sidebar links or permission changes, so an hourly scheduled run picks
those up (GitHub sometimes runs these late). Maintainers can also trigger the
workflow by hand. Dependabot PRs are checked after their CI run finishes,
-because bot-triggered workflows may only get read-only tokens.
+because Dependabot-triggered workflows may only get read-only tokens. This timing is specific to Dependabot.
+
+Dependency updates use the hosted Mend Renovate GitHub App, configured in [`renovate.json`](renovate.json), without a repository-hosted runner.
+Routine PR creation is allowed Mondays from 00:00 to 06:00 UTC; the hosted App determines when it runs within that window.
+npm minor and patch updates form one group, as do GitHub Actions minor, patch, digest, and pin updates.
+Major updates remain separate, Actions retain full SHA pins, and every update requires manual merge.
+Commit prefixes remain `chore(deps):` for npm and `ci(deps):` for Actions.
+The npm manager includes the root pnpm workspace/catalog and the independent lockfiles under `tests/e2e`, `scripts/slop-labeler`, and `scripts/ui-review-bot`.
+Frozen-lockfile checks remain the CI consistency gate.
+
+Renovate PRs generated from GitHub vulnerability alerts bypass the routine schedule and still require manual merge.
+This does not guarantee that every security fix is detected or opened immediately.
+The repository owner must install the hosted App with the required repository access and verify the first routine PRs and a vulnerability-alert PR, including changed lockfiles and CI results.
+During cutover, separately disable Dependabot's automatic security-update PR creation after confirming Renovate's replacement path, while retaining GitHub vulnerability alerts and the dependency graph.
+Removing the Dependabot configuration alone does not change those repository settings.
+Do not enable automatic dismissals or leave security fixes without an update path.
Once the check is required, a failing result blocks merging. Anyone can still
open a PR; ineligible PRs become drafts and are never automatically closed.
@@ -98,7 +113,7 @@ matters for eligibility; `login` and `reason` are there so people can tell who
it is and why. That way a renamed account keeps its voucher, and whoever grabs
an old username doesn't inherit it.
-Bots go in `exemptBots`. For now that's just Dependabot.
+Bots go in `exemptBots`. Approved automation includes Renovate and Dependabot. The policy matches each bot's GitHub-verified numeric ID and Bot account type, not a reusable login alone.
To turn on enforcement once this workflow is on `main`:
diff --git a/renovate.json b/renovate.json
new file mode 100644
index 000000000..fdad68bea
--- /dev/null
+++ b/renovate.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": ["config:recommended", "helpers:pinGitHubActionDigests"],
+ "enabledManagers": ["npm", "github-actions"],
+ "ignorePaths": [
+ "**/node_modules/**",
+ "**/bower_components/**",
+ "**/vendor/**"
+ ],
+ "automerge": false,
+ "timezone": "Etc/UTC",
+ "schedule": ["before 6am on Monday"],
+ "prConcurrentLimit": 10,
+ "vulnerabilityAlerts": {
+ "enabled": true,
+ "labels": ["security"],
+ "automerge": false
+ },
+ "npm": {
+ "commitMessagePrefix": "chore(deps):"
+ },
+ "github-actions": {
+ "commitMessagePrefix": "ci(deps):"
+ },
+ "packageRules": [
+ {
+ "matchManagers": ["npm"],
+ "matchUpdateTypes": ["minor", "patch"],
+ "groupName": "npm minor and patch dependencies"
+ },
+ {
+ "matchManagers": ["github-actions"],
+ "matchUpdateTypes": ["minor", "patch", "digest", "pin"],
+ "groupName": "GitHub Actions non-major updates"
+ }
+ ]
+}
diff --git a/scripts/ci/README.md b/scripts/ci/README.md
index 41d7aacbc..e6060f77e 100644
--- a/scripts/ci/README.md
+++ b/scripts/ci/README.md
@@ -47,6 +47,17 @@ upgrade-rendering regression checks. Configure the new job checks as required in
GitHub if they should block merging; editing workflows alone does not change
branch protection.
+## Dependency updates
+
+The hosted Mend Renovate GitHub App handles npm and GitHub Actions updates from `renovate.json`.
+Routine PR creation is allowed Monday 00:00–06:00 UTC, subject to hosted App availability.
+npm minor and patch updates are grouped; Actions minor, patch, digest, and pin updates are grouped.
+Majors remain separate, Actions retain full SHA pins, and all updates require manual merge.
+PRs generated from GitHub vulnerability alerts bypass the routine schedule; detection and immediate creation of every security fix are not guaranteed.
+Root npm updates include the pnpm workspace/catalog and root lockfile; `tests/e2e`, `scripts/slop-labeler`, and `scripts/ui-review-bot` keep independent locks.
+CI frozen-lockfile checks catch inconsistencies.
+See the owner cutover steps in [the contribution guide](../../CONTRIBUTING.md#contribution-eligibility).
+
**Contribution eligibility** is a separate workflow. It posts a status on the
head commit of every open PR. Maintainers, vouched accounts, and approved bots
pass without an issue; everyone else has to link an open
diff --git a/scripts/contribution-eligibility/policy.test.mjs b/scripts/contribution-eligibility/policy.test.mjs
index 430551d8e..9b7bc49e2 100644
--- a/scripts/contribution-eligibility/policy.test.mjs
+++ b/scripts/contribution-eligibility/policy.test.mjs
@@ -14,7 +14,7 @@ const policy = {
};
const author = { id: 123, login: "trusted", type: "User" };
-test("checked-in policy is valid and explicitly exempts only Dependabot initially", async () => {
+test("checked-in policy grants only the approved dependency-bot identities", async () => {
const current = validatePolicy(
JSON.parse(
await readFile(
@@ -23,9 +23,32 @@ test("checked-in policy is valid and explicitly exempts only Dependabot initiall
),
),
);
+ for (const bot of [
+ { id: 29139614, login: "renovate[bot]", type: "Bot" },
+ { id: 49699333, login: "dependabot[bot]", type: "Bot" },
+ ]) {
+ assert.equal(authorExemption(bot, null, current), "Approved automation.");
+ assert.equal(authorExemption({ ...bot, id: 999 }, null, current), null);
+ assert.equal(
+ authorExemption({ ...bot, type: "User" }, null, current),
+ null,
+ );
+ }
+ assert.equal(
+ authorExemption(
+ { id: 41898282, login: "github-actions[bot]", type: "Bot" },
+ null,
+ current,
+ ),
+ null,
+ );
+ assert.deepEqual(
+ current.exemptBots.map((entry) => entry.id).sort((a, b) => a - b),
+ [29139614, 49699333],
+ );
assert.deepEqual(
- current.exemptBots.map((entry) => entry.id),
- [49699333],
+ current.vouchedContributors.map((entry) => entry.id),
+ [44305048, 127273550, 176929823, 115077240, 651050],
);
});