sync-tags: skip deps that are not in the module cache
packageDepToGoModCache skips a dependency whose tagged commit has no go.mod, but the require/replace edit still ran. go mod download then looks for a version that exists neither in the module cache nor at origin and fails (kubernetes/kubernetes#56876, v1.38.0-alpha.3 vs the new apiextensions-api repo). Mirror the update-deps-in-gomod check in util.sh and skip the dependency.
Signed-off-by: Davanum Srinivas davanum@gmail.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Kubernetes Publishing Bot
Overview
The publishing bot publishes the code in
k8s.io/kubernetes/stagingto their own repositories. It guarantees that the master branches of the published repositories are compatible, i.e., if a usergo geta published repository in a clean GOPATH, the repo is guaranteed to work.It pulls the latest k8s.io/kubernetes changes and runs
git filter-branchto 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 inKubernetes-sha: <sha>lines in the commit messages.The robot is also responsible to update the
go-modand thevendor/directory for the target repos.Playbook
Publishing a new repo or a new branch
Adapt the rules in config/kubernetes-rules-configmap.yaml
For a new repo, add it to the repo list in hack/repos.sh
Test and deploy the changes
Updating rules
Adapting rules for a new branch
If 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.yamlfile on themasterbranch.For each repository, add a new branch to the
branchesstanza. If the branch is using the same Go version as the default Go version, you don’t need to specify the Go version for the branch (otherwise you need to do that).Adapting rules for a Go update
If you’re updating Go version for the master or release branches, you need to adapt the
rules.yamlfile in kubernetes/kubernetes on themasterbranch.Testing and deploying the robot
Currently we don’t have tests for the bot. It relies on manual tests:
Fork the repos you are going the publish.
Run 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.
Use hack/create-repos.sh from the bot root directory to create any missing repos in the destination github org.
Create a config and a corresponding ConfigMap in configs,
configs/<yourconfig>configs/<yourconfig>-configmap.yaml.Create a rule config and a corresponding ConfigMap in configs,
configs/<yourconfig>configs/<yourconfig>-rules-configmap.yaml.Deploy the publishing bot by running make from the bot root directory, e.g.
for a fire-and-forget pod. Or use
to run a ReplicaSet that publishes every 24h (you can change the
INTERVALconfig value for different intervals).This will not push to your org, but runs in dry-run mode. To run with a push, add
DRYRUN=falseto yourmakecommand line.Running in Production
make deploy CONFIG=configs/kubernetes-nightlyCaution: 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#123patterns in published commits.Note:: Details about running the publishing-bot for the Kubernetes project can be found in production.md.
Update rules
To add new branch rules or update go version for configured destination repos, check update-branch-rules.
Contributing
Please see CONTRIBUTING.md for instructions on how to contribute.
Known issues
.publishing.yamlfile.