{"id":14975765,"url":"https://github.com/kubernetes/publishing-bot","last_synced_at":"2025-10-19T11:30:24.189Z","repository":{"id":27343787,"uuid":"113460341","full_name":"kubernetes/publishing-bot","owner":"kubernetes","description":"Code behind the robot to publish from staging to real repositories.","archived":false,"fork":false,"pushed_at":"2025-01-23T19:41:33.000Z","size":12950,"stargazers_count":86,"open_issues_count":2,"forks_count":84,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-01-29T13:03:15.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kubernetes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-07T14:26:05.000Z","updated_at":"2025-01-23T19:41:30.000Z","dependencies_parsed_at":"2023-10-13T03:33:26.921Z","dependency_job_id":"89f7041e-affb-46ff-860c-ffac1d774ed5","html_url":"https://github.com/kubernetes/publishing-bot","commit_stats":{"total_commits":505,"total_committers":37,"mean_commits":13.64864864864865,"dds":0.6534653465346535,"last_synced_commit":"57e0ab089e0cd75dfc1e96ece0e15f15ff45dcfb"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubernetes%2Fpublishing-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubernetes%2Fpublishing-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubernetes%2Fpublishing-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubernetes%2Fpublishing-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubernetes","download_url":"https://codeload.github.com/kubernetes/publishing-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237116382,"owners_count":19258240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T13:52:30.930Z","updated_at":"2025-10-19T11:30:18.841Z","avatar_url":"https://github.com/kubernetes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Publishing Bot\n\n[![sig-release-publishing-bot/build](https://testgrid.k8s.io/q/summary/sig-release-publishing-bot/build/tests_status?style=svg)](https://testgrid.k8s.io/sig-release-publishing-bot#build)\n[![](https://img.shields.io/uptimerobot/status/m779759348-04b1f4fd3bb5ce4a810670d2.svg?label=bot)](https://stats.uptimerobot.com/wm4Dyt8kY)\n[![](https://img.shields.io/uptimerobot/status/m779759340-0a6b2cb6fee352e75f58ba16.svg?label=last%20publishing%20run)](https://github.com/kubernetes/kubernetes/issues/56876)\n\n## Overview\n\nThe publishing bot publishes the code in `k8s.io/kubernetes/staging` to their own repositories. It guarantees that the master branches of the published repositories are compatible, i.e., if a user `go get` a published repository in a clean GOPATH, the repo is guaranteed to work.\n\nIt pulls the latest k8s.io/kubernetes changes and runs `git filter-branch` to distill the commits that affect a staging repo. Then it cherry-picks merged PRs with their feature branch commits to the target repo. It records the SHA1 of the last cherrypicked commits in `Kubernetes-sha: \u003csha\u003e` lines in the commit messages.\n\nThe robot is also responsible to update the `go-mod` and the `vendor/` directory for the target repos.\n\n## Playbook\n\n### Publishing a new repo or a new branch\n\n* Adapt the rules in [config/kubernetes-rules-configmap.yaml](configs/kubernetes-rules-configmap.yaml)\n  * For Kubernetes, the configuration is located in the [kubernetes/kubernetes repository](https://github.com/kubernetes/kubernetes/blob/master/staging/publishing/rules.yaml)\n\n* For a new repo, add it to the repo list in [hack/repos.sh](hack/repos.sh)\n\n* [Test and deploy the changes](#testing-and-deploying-the-robot)\n\n### Updating rules\n\n#### Adapting rules for a new branch\n\nIf you're creating a new branch, you need to update the publishing-bot rules to reflect that. For Kubernetes, this means that you need to update the [`rules.yaml` file](https://github.com/kubernetes/kubernetes/blob/master/staging/publishing/rules.yaml) on the `master` branch.\n\nFor each repository, add a new branch to the `branches` stanza. If the branch is using the same Go version as the [default Go version](https://github.com/kubernetes/kubernetes/blob/489fb9bee3f626b3eeb120a5af89ad8c2b2f1c20/staging/publishing/rules.yaml#L10), you don't need to specify the Go version for the branch (otherwise you need to do that).\n\n#### Adapting rules for a Go update\n\nIf you're updating Go version for the master or release branches, you need to adapt the [`rules.yaml` file in kubernetes/kubernetes](https://github.com/kubernetes/kubernetes/blob/master/staging/publishing/rules.yaml) on the `master` branch.\n\n* If you're updating Go version for the master branch, you need to change the [default Go version](https://github.com/kubernetes/kubernetes/blob/489fb9bee3f626b3eeb120a5af89ad8c2b2f1c20/staging/publishing/rules.yaml#L10) to the new version.\n  * If release branches that depend on the default Go version use a different (e.g. old) Go version, you need to explicitly set Go version for those branches (e.g. [like here](https://github.com/kubernetes/kubernetes/blob/489fb9bee3f626b3eeb120a5af89ad8c2b2f1c20/staging/publishing/rules.yaml#L37))\n* If you're updating Go version for a previous release branch\n  * if it's the same version as the default Go version, you don't need to specify the Go version for that branch\n  * if it's **NOT** the same version as the default Go version, you need to explicitly specify the Go version for that branch (e.g. [like here](https://github.com/kubernetes/kubernetes/blob/489fb9bee3f626b3eeb120a5af89ad8c2b2f1c20/staging/publishing/rules.yaml#L37))\n    * Examples: https://github.com/kubernetes/kubernetes/pull/93998, https://github.com/kubernetes/kubernetes/pull/101232, https://github.com/kubernetes/kubernetes/pull/104226\n\n### Testing and deploying the robot\n\nCurrently we don't have tests for the bot. It relies on manual tests:\n\n* Fork the repos you are going the publish.\n* Run [hack/fetch-all-latest-and-push.sh](hack/fetch-all-latest-and-push.sh) from the bot root directory to update the branches of your repos. This will sync your forks with upstream. **CAUTION:** this might delete data in your forks.\n* Use [hack/create-repos.sh](hack/create-repos.sh) from the bot root directory to create any missing repos in the destination github org.\n\n* Create a config and a corresponding ConfigMap in [configs](configs),\n  - by copying [configs/example](configs/example) and [configs/example-configmap.yaml](configs/example-configmap.yaml),\n  - and by changing the Makefile constants in `configs/\u003cyourconfig\u003e`\n  - and the ConfigMap values in  `configs/\u003cyourconfig\u003e-configmap.yaml`.\n\n* Create a rule config and a corresponding ConfigMap in [configs](configs),\n  - by copying [configs/example-rules-configmap.yaml](configs/example-rules-configmap.yaml),\n  - and by changing the Makefile constants in `configs/\u003cyourconfig\u003e`\n  - and the ConfigMap values in  `configs/\u003cyourconfig\u003e-rules-configmap.yaml`.\n\n* Deploy the publishing bot by running make from the bot root directory, e.g.\n\n```shell\n$ make build-image push-image CONFIG=configs/\u003cyourconfig\u003e\n$ make run CONFIG=configs/\u003cyourconfig\u003e TOKEN=\u003cgithub-token\u003e\n```\n\n  for a fire-and-forget pod. Or use\n\n```shell\n$ make deploy CONFIG=configs/\u003cyourconfig\u003e TOKEN=\u003cgithub-token\u003e\n```\n\n  to run a ReplicaSet that publishes every 24h (you can change the `INTERVAL` config value for different intervals).\n\nThis will not push to your org, but runs in dry-run mode. To run with a push, add `DRYRUN=false` to your `make` command line.\n\n### Running in Production\n\n* Use one of the existing [configs](configs) and\n* launch `make deploy CONFIG=configs/kubernetes-nightly`\n\n**Caution:** Make sure that the bot github user CANNOT close arbitrary issues in the upstream repo. Otherwise, github will close, them triggered by `Fixes kubernetes/kubernetes#123` patterns in published commits.\n\n**Note:**: Details about running the publishing-bot for the Kubernetes project can be found in [production.md](production.md).\n\n\n### Update rules\n\nTo add new branch rules or update go version for configured destination repos, check [update-branch-rules](cmd/update-rules/README.md).\n\n## Contributing\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for instructions on how to contribute.\n\n## Known issues\n\n1. Testing: currently we rely on manual testing. We should set up CI for it.\n2. Automate release process (tracked at https://github.com/kubernetes/kubernetes/issues/49011): when kubernetes release, automatic update the configuration of the publishing robot. This probably means that the config must move into the Kubernetes repo, e.g. as a `.publishing.yaml` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubernetes%2Fpublishing-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubernetes%2Fpublishing-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubernetes%2Fpublishing-bot/lists"}