merge-renovate-pull-requests
Installation
SKILL.md
Merge renovate pull requests
When to use:
When doing routinely maintenance and when Renovatebot has created pull requests which are not automatically merged. They pull requests may not have been automatically merged because there's a major version update, the checks failed or other reasons.
Caveats:
- Do not attempt to process pull requests which are not created by Renovatebot (username might be
renovateand author id might beapp/renovate). - We should only process open pull requests.
- When updating versions with breaking changes (updating major versions or if the major version is 0) then it's very important to read and understand all the breaking changes and how to update correctly/safely. The breaking changes, and sometimes links to official documentation, can be found in the pull request description or in the changelog of the GitHub repo of the dependency to update. We should follow the official migration guides if available. If the changes are significant, affect the architecture and/or requires migrations on external systems like databases or production systems then we should leave it to the user to resolve it manually. Leave a comment in the pull request explaining this and then abort the current workflow.
Tools:
You may use the GitHub CLI to get fetch pull requests from the GitHub repo, see results from checks etc.
Merge exceptions:
- eslint / eslint monorepo should not be updated to >= v10 yet because they haven't patched a bug.
Dependency specific update details:
TypeScript v6
tsconfig.json:- Set
moduletoesnext.moduleResolutionshould probably bebundler. - Set
targettoesnext(we are a greenfield project, so we can use the latest features). lib:- We may add
esnextto the list (so we can access new APIs like Temporal). dom.iterableis now included indom, so if we're already usingdomthen we don't need to adddom.iterableto the list.
- We may add
typesno longer include all libraries innode_modules/@typesso we should make surenodeis added to the list. If we get errors about missing types, then we might have to add missing types to the list.baseUrlcan be removed in 99% of instances, especially if it's.(a single dot).esModuleInteropandallowSyntheticDefaultImportsare now always true, so these can probably be removed.noUncheckedSideEffectImportsnow defaults to true, so this can probably be removed.
- Set
modulesyntax now yields an error, we should rather usenamespace. Note that ambient module declaration form is still fully acceptable.- Make sure that VSCode is using the TypeScript version of the workspace.
.vscode/settings.jsonshould havetypescript.tsdkset to the path of the TypeScript version of the workspace (e.g."typescript.tsdk": "node_modules\\typescript\\lib"). - Blog post announcing TypeScript 6.0: https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/
- You may read more about the changes in the blog post if needed.
Adding logs of agent merges:
-
When we want to log agent merges we append the following information to
AGENT_MERGE.md(in the root folder of the repo).# {agent merge concise title} Date: {date and time} {summary of changes} ## Breaking changes {bullet list of the breaking changes; include a short description of the actual breaking changes and including links to official sources for reading more} ## Pull requests {bullet list with links to pull requests} {comments header and comments if there are any} {separator between entries, use the `---` separator} -
Then we commit and push the changes.
Main workflow:
- Before starting a workflow make sure:
- You are on the
mainbranch and pull latest git changes. - You have installed latest package versions (with e.g.
pnpm install). - Have created a new branch and PR with an unique name with this format
agent-merge-{yyyy}-{MM}-{hh}-{mm}-{ss}(replace placeholders/vars with current date in UTC).
- This is the branch/PR you will be working on during the workflow. You should not merge individual updates/commits directly into the
mainbranch, but rather merge the PR into themainbranch after all open pull requests have been processed.
- You are on the
- Commit often when suitable.
- Do not close processed PRs, these will automatically be handled by renovatebot once the pull request is merged in.
- Do not delete any branches.
1. Processing open pull requests where all checks passed:
- Merge in open pull requests (by renovatebot) where all checks have passed.
- Install latest package versions (with e.g.
pnpm install).- Make sure we are using the latest transitive dependencies in case there are merge conflicts.
- Run type checking, linting and build. If any of them fails, then we should fix them before proceeding.
- Make sure the new branch is pushed, and check the results/checks in CI/GitHub workflow. If the job fails in CI, then we go back to step 3 and try again.
- If we can't fix the errors within a reasonable amount of effort, then leave it to the user to resolve it manually. Leave a comment in the pull request explaining this and then abort the current workflow.
- Log agent merges.
2. Processing open pull requests where any checks failed:
- We should process open pull requests where any checks have failed one by one.
- For each pull request with any failed checks (by renovatebot):
- Merge in the pull request.
- Install latest package versions (with e.g.
pnpm install).- Make sure we are using the latest transitive dependencies in case there are merge conflicts.
- Run type checking, linting and build. If any of them fails, then we should fix them before proceeding.
- Push the fixes and see the results in CI/GitHub workflow. If the job fails in CI, then we go back to step 3 (for the individual pull request) and try again.
- If the task is unresolvable (perhaps due to an open issue in the third-party dependency) then we should leave it to the user to resolve it manually. Leave a comment in the pull request explaining this and then abort the current workflow.
- Log agent merges.
3. After processing all open pull requests:
- After we have processed all open pull requests and checks are passing, then we can merge the new branch into the
mainbranch.