Repository navigation
feat(renovate): keep open Renovate PRs up to date outside the schedule window #594
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
Merged
DevSecNinja
merged 2 commits into
devsecninja-renovate-commit-types
from
devsecninja-renovate-update-not-scheduled
Nov 18, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Checks that `updateNotScheduled: true` (.renovate/base.json5) is what a | ||
| # typical fleet config resolves to: open Renovate PRs stay rebased and up to | ||
| # date between the weekly schedule windows. The extends chain of a legacy fleet | ||
| # config (snapshot of DevSecNinja/config-sidecar's renovate.json5), the | ||
| # config-sync stub template and this repository's renovate.json5 is resolved | ||
| # through the local .renovate/ presets, last value wins, and no later preset or | ||
| # the config itself may turn it off. The weekly schedule stays in place. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
|
|
||
| if ! command -v pyjson5 >/dev/null 2>&1; then | ||
| echo "error: 'pyjson5' not found on PATH. Run via 'mise run test'." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| to_json() { | ||
| pyjson5 --as-json "$1" | tr -d '\r' | ||
| } | ||
|
|
||
| presets="{" | ||
| for file in "${repo_root}"/.renovate/*.json5; do | ||
| presets+="\"$(basename "${file}")\": $(to_json "${file}")," | ||
| done | ||
| presets="${presets%,}}" | ||
|
|
||
| PRESETS="${presets}" \ | ||
| TEMPLATE="$(to_json "${repo_root}/config-sync/templates/renovate.json5")" \ | ||
| ROOT="$(to_json "${repo_root}/renovate.json5")" \ | ||
| python3 - <<'PY' | ||
| import json | ||
| import os | ||
| import sys | ||
|
|
||
| presets = json.loads(os.environ["PRESETS"]) | ||
| local_prefix = "github>DevSecNinja/.github//.renovate/" | ||
| errors = [] | ||
|
|
||
|
|
||
| def resolve(config, key, seen=()): | ||
| """The value of a top-level option after Renovate's preset merge: | ||
| extends in order, then the config's own value.""" | ||
| value = None | ||
| for name in config.get("extends", []): | ||
| if name.startswith(local_prefix) and name not in seen: | ||
| found = resolve(presets[name[len(local_prefix):]], key, seen + (name,)) | ||
| if found is not None: | ||
| value = found | ||
| return config.get(key, value) | ||
|
|
||
|
|
||
| legacy = { | ||
| "extends": [ | ||
| "config:recommended", | ||
| "helpers:pinGitHubActionDigests", | ||
| ":dependencyDashboard", | ||
| ":semanticCommits", | ||
| ] + [local_prefix + f for f in ("autoMerge.json5", "base.json5", "customManagers.json5", "groups.json5", "labels.json5", "packageRules.json5", "semanticCommits.json5")], | ||
| } | ||
| configs = { | ||
| "legacy fleet config (config-sidecar)": legacy, | ||
| "config-sync stub template": json.loads(os.environ["TEMPLATE"]), | ||
| "renovate.json5": json.loads(os.environ["ROOT"]), | ||
| } | ||
| for label, config in configs.items(): | ||
| if resolve(config, "updateNotScheduled") is not True: | ||
| errors.append(f"{label}: updateNotScheduled resolves to {resolve(config, 'updateNotScheduled')}, want true") | ||
| if resolve(config, "schedule") != ["* 0-7 * * 6"]: | ||
| errors.append(f"{label}: schedule resolves to {resolve(config, 'schedule')}, want the Saturday window") | ||
|
|
||
| if errors: | ||
| print("error: Renovate updateNotScheduled:\n " + "\n ".join(errors), file=sys.stderr) | ||
| sys.exit(1) | ||
| print("Renovate updateNotScheduled: OK") | ||
| PY |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.