Appendix B: Final Exam
Goal: Prove that you can supply a new application with Renovate end-to-end on your own: org preset, bot config, onboarding, rules, custom dependencies, security and troubleshooting. · Duration: 120 min practice + 20 min questions · Prerequisite: Day 14
Rules
- Training ground as after Day 14: Forgejo 16.0.6 is running, Renovate
44.153.1,
env.shloaded.RENOVATE_GITHUB_COM_TOKENis set, otherwise tasks 5 and 6 fail (github-token-required, Day 0). - Allowed:
--help, Appendix A, docs.renovatebot.com, the Forgejo API docs. Not allowed: copying chapter solutions or looking intocode/anhang-b/loesung/. - You only start Renovate as
renovatewithout arguments in~/renovate-lab/pruefung, i.e. with yourconfig.js. Every repo config is calledrenovate.json, lives in the root directory and only goes ontomainafterrenovate-config-validator. - Merge PRs, set commit statuses and tick checkboxes only via the API
as
lab-admin. No commits inrenovate/*branches. - The start block resets everything and empties
~/renovate-lab/pruefung. The grading at the end awards the points, not your gut feeling. - Passed: at least 70 of 100 points and full points on task 6 (security).
The new application is called billing and gets its own
organization without a bot team. The bot becomes a collaborator with
write access in each repo individually:
source ~/renovate-lab/setup/env.sh
export RENOVATE_GITHUB_COM_TOKEN=$(gh auth token) # required for tasks 5 and 6
A="$FORGEJO/api/v1/repos/billing"
curl -s -u "$ADMIN" -X POST --json '{"username":"billing"}' "$FORGEJO/api/v1/orgs" \
| jq -r .username
for r in renovate-config billing-api billing-worker; do
curl -s -o /dev/null -u "$ADMIN" -X DELETE "$A/$r"
rm -rf ~/renovate-lab/start-$r
cp -R ~/renovate-lab/code/anhang-b/$r ~/renovate-lab/start-$r
git -C ~/renovate-lab/start-$r init -q -b main
git -C ~/renovate-lab/start-$r add -A
git -C ~/renovate-lab/start-$r commit -qm "Initialer Stand"
git -C ~/renovate-lab/start-$r push -q forgejo:billing/$r.git main
curl -s -o /dev/null -w "$r %{http_code}\n" -u "$ADMIN" -X PUT \
--json '{"permission":"write"}' "$A/$r/collaborators/renovate-bot"
done
curl -s -u "$ADMIN" -X PATCH --json '{"has_actions":false}' "$A/billing-api" \
| jq .has_actions
rm -rf ~/renovate-lab/pruefung
mkdir -p ~/renovate-lab/pruefung && cd ~/renovate-lab/pruefungExpected:
billing
renovate-config 204
billing-api 204
billing-worker 204
false
rm -rf ~/renovate-lab/pruefung empties the exam folder –
including your solution from an earlier attempt. The check commands
query the API under $A via curl. You read
files on a branch via
$A/<repo>/raw/<file>?ref=<branch>. The
starting state:
| Repo | Content | Bot |
|---|---|---|
renovate-config |
only README.md |
write access |
billing-api |
npm (express 4.18.2, lodash, prettier), Dockerfile,
workflow |
write access |
billing-worker |
Go modules, renovate.json with errors |
write access |
The Dockerfile of billing-api starts with
FROM node:20.11.0-alpine and
ARG KUBECTL_VERSION=v1.29.0; the workflow uses
actions/checkout@v3 and actions/setup-node@v3.
Forgejo Actions is off in the repo (no runner, Day 5).
shop/shop-api from the previous days still exists and is
not part of the exam.
Part 1: Practical exam
The tasks build on each other. You write the rules from tasks 4 to 8
together into the renovate.json of billing-api
or into the preset before you run the check commands from task 4 onward
in order. Your target versions in the outputs will be newer.
Task 1: Org preset repo (10 points)
billing/renovate-config gets a
default.json: base config:recommended, time
zone Europe/Berlin. The bot may only read the repo (Day
11). You may put the rules from task 6 here or in the repo.
curl -s -H "Authorization: token $RENOVATE_TOKEN" "$A/renovate-config" \
| jq -c .permissions
curl -s -u "$ADMIN" "$A/renovate-config/raw/default.json?ref=main" | jq -r .timezoneExpected:
{"admin":false,"push":false,"pull":true}
Europe/Berlin
Task 2: Global config.js (10 points)
Create ~/renovate-lab/pruefung/config.js: Forgejo, token
only from the environment, autodiscover exclusively for
billing/*. The onboarding PR should propose a
renovate.json that only extends
local>billing/renovate-config (Day 9).
renovate-config-validator config.js | tail -1
renovate --write-discovered-repos=repos.json >/dev/null 2>&1; cat repos.json; echoExpected:
INFO: Config validated successfully against 1 file(s)
["billing/billing-api","billing/billing-worker"]
shop/shop-api is missing because of the filter,
billing/renovate-config is missing because the bot is not
allowed to write there.
Task 3: Onboarding with the org preset (5 points)
First run. Check the onboarding PR of billing-api and
merge it (Day 1).
renovate > lauf-1.log 2>&1; grep -E 'Onboarding PR|invalid config' lauf-1.log
curl -s -u "$ADMIN" "$A/billing-api/pulls" \
| jq -r 'sort_by(.number)[] | "#\(.number) \(.state) \(.head.ref) | \(.title)"'
curl -s -u "$ADMIN" "$A/billing-api/raw/renovate.json?ref=renovate/configure" | jq -c .extendsExpected:
INFO: Onboarding PR created (repository=billing/billing-api)
WARN: Repository has invalid config (repository=billing/billing-worker)
#1 open renovate/configure | Configure Renovate
["local>billing/renovate-config"]
The warning about billing-worker is task 9.
Task 4: Groups, schedule, limits (15 points)
For billing-api the following applies (Day 4): at most 4
open PRs, no hourly limit. All devDependencies go into the
group dev-tools. Production dependencies
(dependencies) may only get new branches on Mondays from 0
to 4 a.m., in the time zone from the preset.
LOG_LEVEL=debug renovate > lauf-2.log 2>&1
curl -s -u "$ADMIN" "$A/billing-api/pulls" \
| jq -r 'sort_by(.number)[] | "#\(.number) \(.state) \(.head.ref) | \(.title)"' \
| cut -c1-88
curl -s -u "$ADMIN" "$A/billing-api/issues?type=issues" \
| jq -r '.[] | select(.title == "Dependency Dashboard") | .body' > dash.md
grep -E '^## Rate|unlimit-branch' dash.md | cut -c1-88Expected:
#2 open renovate/npm-express-vulnerability | Update dependency express to v4.20.0 [SECUR
#3 open renovate/pin-dependencies | Pin dependencies
#4 open renovate/kubernetes-kubernetes-1.x | Update dependency kubernetes/kubernetes to
#5 open renovate/dev-tools | Update dependency prettier to v3.9.10
#6 open renovate/node-20.x | Update Node.js to v20.20.2
## Rate-Limited
- [ ] <!-- unlimit-branch=renovate/actions-checkout-7.x -->Update actions/checkout acti
- [ ] <!-- unlimit-branch=renovate/actions-setup-node-7.x -->Update actions/setup-node
- [ ] <!-- unlimit-branch=renovate/node-24.x -->Update dependency node to v24
Four normal PRs; the majors wait as “Rate-Limited”. The fifth PR is
the security PR, which knows no limit. The group dev-tools
only contains prettier, which is why the PR carries the title of the
single update.
Task 5: customManager for kubectl (10 points)
Renovate should update ARG KUBECTL_VERSION in the
Dockerfile via the GitHub releases of
kubernetes/kubernetes. The Dockerfile stays unchanged,
i.e. without a # renovate: comment (Day 7).
curl -s -u "$ADMIN" "$A/billing-api/raw/Dockerfile?ref=renovate/kubernetes-kubernetes-1.x" | grep '^ARG'Expected:
ARG KUBECTL_VERSION=v1.37.1
Task 6: Security (15 points, mandatory)
Renovate matches the dependencies against OSV. The security PR comes despite the schedule from task 4. All GitHub Actions are pinned by digest, and the tag stays readable as a comment. Then merge the security PR and the pin PR (Day 12).
grep 'Checking schedule' lauf-2.log \
| grep -oE 'schedule=[^,]*|branch=renovate/[^)]*' | paste - - | head -2Expected:
schedule= branch=renovate/npm-express-vulnerability
schedule=at any time branch=renovate/pin-dependencies
The security branch runs with an empty schedule. After the two merges:
curl -s -u "$ADMIN" "$A/billing-api/pulls?state=all" \
| jq -r 'sort_by(.number)[] | "#\(.number) \(.state) \(.head.ref) | \(.title)"' \
| grep -E 'SECURITY|Pin' | cut -c1-88
curl -s -u "$ADMIN" "$A/billing-api/raw/.github/workflows/ci.yml?ref=main" | grep usesExpected:
#2 merged renovate/npm-express-vulnerability | Update dependency express to v4.20.0 [SEC
#3 merged renovate/pin-dependencies | Pin dependencies
- uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3
Tip: If a merge right after the previous one fails, Forgejo is still checking mergeability. Wait a few seconds and send it again.
Task 7: Automerge with a status check (15 points)
Renovate merges patches and minor/patch updates of
devDependencies itself, majors never. It only merges with a
green commit status. You play the CI: set ci/test to
success via the API for the current head of
renovate/dev-tools and start a run (Day 5).
renovate > lauf-3.log 2>&1 # after the merges from task 6: rebase
# ... set the status here (and complete task 8) ...
renovate > lauf-4.log 2>&1; grep automerged lauf-4.log
curl -s -u "$ADMIN" "$A/billing-api/pulls?state=all" \
| jq -r 'sort_by(.number)[] | "#\(.number) \(.state) \(.head.ref) | \(.title)"' \
| grep -E 'dev-tools|Node'
n=$(curl -s -u "$ADMIN" "$A/billing-api/pulls?state=all" \
| jq -r '.[] | select(.title | test("dev-tools")) | .number')
curl -s -u "$ADMIN" "$A/billing-api/pulls/$n" | jq -r .merged_by.loginExpected:
INFO: PR automerged (repository=billing/billing-api, branch=renovate/dev-tools)
#5 merged renovate/dev-tools | Update dependency prettier to v3.9.10
#6 open renovate/node-20.x | Update Node.js to v20.20.2
renovate-bot
If you set the status before lauf-3, it is attached to
the old commit: Renovate rebases the branch onto main after
every merge, and the new head has no status.
Task 8: express major only with approval (10 points)
express 5 may only come when someone approves it in the Dependency
Dashboard. Grant the approval via an API tick before lauf-4
(Day 14).
curl -s -u "$ADMIN" "$A/billing-api/issues?type=issues" \
| jq -r '.[] | select(.title == "Dependency Dashboard") | .body' > dash.md
grep approve-branch dash.md | cut -c1-88 # after lauf-3
curl -s -u "$ADMIN" "$A/billing-api/pulls" \
| jq -r 'sort_by(.number)[] | "#\(.number) \(.state) \(.head.ref) | \(.title)"' \
| grep express-5 # after lauf-4Expected:
- [ ] <!-- approve-branch=renovate/express-5.x -->Update dependency express to v5
#10 open renovate/express-5.x | Update dependency express to v5
Before the security PR is merged, express 5 does not show up anywhere (knowledge question 4).
Task 9: Troubleshooting billing-worker (10 points)
The renovate.json of billing-worker
contains errors. Find each of them and write each error message as a
separate line into ~/renovate-lab/pruefung/diagnose.txt.
Then repair the config so that it extends
local>billing/renovate-config and keeps
gomodTidy (Day 2, Day 14).
curl -s -u "$ADMIN" "$A/billing-worker/issues?type=issues&state=all" \
| jq -r '.[] | "#\(.number) \(.state) \(.title)"'
curl -s -u "$ADMIN" "$A/billing-worker/pulls" | jq -r '.[] | "#\(.number) \(.title)"'Expected:
#4 open Dependency Dashboard
#1 closed Action Required: Fix Renovate Configuration
#3 Update module github.com/google/uuid to v1.6.0
#2 Update module github.com/pkg/errors to v0.9.1
Points
| Task | Points | Achieved |
|---|---|---|
| 1 Org preset repo | 10 | |
| 2 Global config.js | 10 | |
| 3 Onboarding with the org preset | 5 | |
| 4 Groups, schedule, limits | 15 | |
| 5 customManager for kubectl | 10 | |
| 6 Security (mandatory) | 15 | |
| 7 Automerge with a status check | 15 | |
| 8 express major only with approval | 10 | |
| 9 Troubleshooting billing-worker | 10 | |
| Total | 100 |
Grading
A task counts in full if every one of its check commands shows what is expected; if only some of them show what is expected, it counts half. Add up the points: passed from 70 of 100 points, and task 6 must count in full.
Sample solution
Read only after the exam. All files are located under
~/renovate-lab/code/anhang-b/loesung/.
- A1:
default.jsonviagit pushinto the preset repo, then the bot permission viaPUT …/collaborators/renovate-botwith{"permission":"read"}(Day 11, Drill 1). - A2:
config.jsas in Day 9, Drill 5, withautodiscoverFilter: ['billing/*']andonboardingConfig.extends: ['local>billing/renovate-config']. - A3:
POST $A/billing-api/pulls/1/mergewith{"Do":"merge"}. - A4–A8:
billing-api.jsonasrenovate.jsononmain. Security lives in the preset so that every billing repo inherits it:
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"description": "Org-Standard für alle Repos der Organisation billing",
"extends": ["config:recommended", "helpers:pinGitHubActionDigests"],
"timezone": "Europe/Berlin",
"osvVulnerabilityAlerts": true
}{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>billing/renovate-config"],
"prConcurrentLimit": 4,
"prHourlyLimit": 0,
"platformAutomerge": false,
"customManagers": [
{
"customType": "regex",
"description": "kubectl-Version im Dockerfile",
"managerFilePatterns": ["/(^|/)Dockerfile$/"],
"matchStrings": ["ARG KUBECTL_VERSION=(?<currentValue>\\S+)"],
"depNameTemplate": "kubernetes/kubernetes",
"datasourceTemplate": "github-releases"
}
],
"packageRules": [
{
"description": "Produktions-Dependencies nur montags vor 4 Uhr",
"matchDepTypes": ["dependencies"],
"schedule": ["* 0-3 * * 1"]
},
{
"description": "devDependencies in einem PR bündeln",
"matchDepTypes": ["devDependencies"],
"groupName": "dev-tools"
},
{
"description": "Patches automatisch mergen",
"matchUpdateTypes": ["patch"],
"automerge": true
},
{
"description": "devDependencies ohne Major automatisch mergen",
"matchDepTypes": ["devDependencies"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"description": "express-Major nur nach Freigabe im Dashboard",
"matchPackageNames": ["express"],
"matchUpdateTypes": ["major"],
"dependencyDashboardApproval": true
}
]
}platformAutomerge: false is not mandatory. Without
branch protection, Forgejo would otherwise merge on the first arbitrary
success (Day 5, Drill 2).
- A7: Status as with
cifrom Day 5, Drill 1:POST $A/billing-api/statuses/<sha>with{"state":"success","context":"ci/test"}. - A8: Tick as with
tickfrom Day 14, Drill 3, markerapprove-branch=renovate/express-5.x. - A9: The validator only reports the first error; the
preset typo only shows up as an issue in the next run. So repair, run,
read the issue again. This is what
diagnose.txtlooks like (line 2 abridged):
Lauf 1: Error type: The Renovate configuration file contains some invalid settings
Message: Configuration option `prConcurrentLimit` should be an integer. Found: "4" (st
Lauf 2: Error type: Cannot find preset's package (config:recomended)
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>billing/renovate-config"],
"postUpdateOptions": ["gomodTidy"],
"prConcurrentLimit": 4
}The complete solution files are located under
code/anhang-b/loesung/.
Part 2: Knowledge questions
Answer each question in one or two sentences, without notes. At least 7 of 10 should be right.
- Why does the onboarding PR of a self-hosted Renovate without
onboardingConfigonly contain$schema, and what follows from that forprHourlyLimit? - The push to the preset repo was forgotten, but
config.jsalready refers tolocal>billing/renovate-config. What happens during the onboarding ofbilling-api? - Why does
billing/renovate-confignot show up in--write-discovered-repos, even though the bot can read it, and what is the actual access control? - Why did Renovate initially offer neither 4.22 nor 5 for express, but only 4.20.0?
- What exactly does
schedulecontrol, and which PRs are still created outside the window? automerge: trueis set, the status issuccess, the PR stays open. Name two possible reasons.- What is the comment
# v3after a pinned action digest for? - Why does
renovate-config-validatornot find the typoconfig:recomended? - A CronJob running Renovate is green, but an “Action Required” issue has been open in a repo for days. What is missing in the global config?
- What distinguishes
dependencyDashboardApprovalfrom a closed PR as a means against an unwanted major update?
Answer key
- Self-hosted, there is no Mend standard. Without
config:recommended, the defaults apply, includingprHourlyLimit2 (Day 1). - Renovate cannot load the preset and opens “Action Required” with
Cannot find preset's package (local>billing/renovate-config)instead of a PR. autodiscoverdiscards repos without push permission. What the bot is not allowed to write to, it does not find; filters are only the second line (Day 9).- With
osvVulnerabilityAlerts, Renovate only offers the fix for a vulnerable dependency. Normal updates and majors only follow once the fix is onmain. - When new branches are created. Existing PRs keep being updated; security PRs and branches approved via the dashboard ignore the window.
- Renovate only merges during a run
(
platformAutomerge: false), or the status is attached to an old commit because Renovate has rebased the branch in the meantime. - The comment keeps the tag readable and is Renovate’s anchor for later updating digest and tag together (Day 12).
- The validator checks syntax and options but does not load presets.
The error only shows up in a run (issue) or with
--print-config(Day 11). exitCodeForErrors: true. Without it, Renovate returns exit 0 on repo errors, and no alert fires (Day 9, Day 14).- The approval is documented config with a traceable tick in the issue. A closed PR is an invisible decision that is tied to the PR title.
Part 3: Self-assessment
| Topic | I can do it | Done in the lab |
|---|---|---|
| Onboarding, config, managers, customManagers (Day 1–3, 7) | [ ] | [ ] |
| Groups, schedule, limits, automerge (Day 4, 5) | [ ] | [ ] |
| Versions, digests, registries (Day 6, 8) | [ ] | [ ] |
| Self-hosted operations, service, org presets (Day 9–11) | [ ] | [ ] |
| Security and supply chain (Day 12) | [ ] | [ ] |
| Monorepos, dashboard, troubleshooting (Day 13–15) | [ ] | [ ] |
Every row without two checkmarks: work through the chapter again.