In this article, we analyze kodiak.toml found in tRPC source code.
Kodiak
Automate your GitHub Pull Requests using Kodiak
Auto Update — Keep your PRs up to date with master automatically
Auto Merge — Add the automerge label to auto merge once CI and Approvals pass.
Bot Collaboration — Combine Kodiak with a dependency bot (dependabot, snyk, greenskeeper.io) to automate updating of dependencies
When you visit kodiak’s website, you will find that Kodiak is a tool that
automates Github pull requests.
Check out its quick start guide.
kodiak.yaml in trpc repository:
The below code snippet is picked from .kodiak.toml
# .kodiak.toml
version = 1
[approve]
auto_approve_usernames = ["dependabot", "renovate"]
[merge]
method = "squash"
automerge_label = ["🚀 merge", "⬆️ dependencies"]
[merge.automerge_dependencies]
# only auto merge "minor" and "patch" version upgrades.
versions = ["minor", "patch"]
usernames = ["dependabot", "renovate"]
[update]
autoupdate_label = "♻️ autoupdate"
Let’s now refer to the documentation based on this configuration file. The first option is approve. If a PR is opened by a user with a username in the approve.auto_approve_usernames list, Kodiak will automatically add an approval to the PR. Read more about approve.
Next option in above file is merge. It has two variables set, method
and automerge_label
. Label your pull request with the kodiak: merge.method = ‘rebase’ label, for example, to set merge.method to “rebase” for your pull request. Read more about merge. automerge_label is a label to enable Kodiak to merge a PR. Kodiak can only merge pull requests passing your GitHub branch protection rules.If multiple labels are specified in an array, any of the specified labels will trigger merge.
[merge.automerge_dependencies]
# only auto merge "minor" and "patch" version upgrades.
versions = ["minor", "patch"]
usernames = ["dependabot", "renovate"]
Kodiak will only automerge dependency upgrades for pull request authors in this list. Check out automerge_dependenciesusernames.
[update]
autoupdate_label = "♻️ autoupdate"
Pull requests with the update.autoupdate_label will be updated when they are out-of-date with their base branch.
Checkout Configuration Reference for a comprehensive list of
configuration options.
About me:
Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.
I am open to work on an interesting project. Send me an email at ramu.narasinga@gmail.com
My Github - https://github.com/ramu-narasinga
My website - https://ramunarasinga.com
My Youtube channel - https://www.youtube.com/@thinkthroo
Learning platform - https://thinkthroo.com
Codebase Architecture - https://app.thinkthroo.com/architecture
Best practices - https://app.thinkthroo.com/best-practices
Production-grade projects - https://app.thinkthroo.com/production-grade-projects
References:
1. https://kodiakhq.com/
2. https://github.com/trpc/trpc/blob/next/.kodiak.toml
Top comments (0)