Skip to content

Conversation

@xmudrii
Copy link
Member

@xmudrii xmudrii commented Oct 1, 2025

This PR implements some required patches to make the publishing-bot work for kcp:

  • Fix git command failing due to missing remote (already tested)
  • Add two new options to allow better control over tags (skip-non-semver-tags and destination-tag-base)
  • Add support for ARM64

Speaking of tags, the upstream publishing-bot always pushes two tags: <source-repo-name>-<source-tag-name> and <tag-name> (if --publish-v0-semver flag is set in artifacts/scripts/construct.sh).

However, publishing-bot constructs <tag-name> with v0 major regardless of the major version of the source tag. But even if that wasn't the case, our source repo (kcp-dev/kcp) is at v0 major, while staged repositories (apimachinery and code-generator to be precise) are at v2 and v3 major. For those affected staged repositories, we can't push a tag with v0 major, because the Go module is also at v2 and v3, respectively.

Instead, we'll push tags that are v2 major and v3 major for those repositories, and these two new options will allow us to do that. For example, when we push v0.29.0 to kcp-dev/kcp, publishing-bot will push v2.29.0 to kcp-dev/apimachinery and v3.29.0 to kcp-dev/code-generator.

/assign @xrstf @embik

@kcp-ci-bot kcp-ci-bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 1, 2025
@xmudrii
Copy link
Member Author

xmudrii commented Oct 1, 2025

/hold

@kcp-ci-bot kcp-ci-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 1, 2025

if [ ! $# -eq 15 ]; then
echo "usage: $0 repo src_branch dst_branch dependent_k8s.io_repos required_packages kubernetes_remote subdirectories source_repo_org source_repo_name base_package is_library recursive_delete_pattern skip_tags last_published_upstream_hash git_default_branch"
if [ ! $# -eq 17 ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱

if [ "${new_branch}" = "true" ] && [ "${src_branch}" = "${git_default_branch}" ]; then
# new master branch
filter-branch "${commit_msg_tag}" "${subdirectories}" "${recursive_delete_pattern}" ${src_branch} filtered-branch
filter-branch "${commit_msg_tag}" "${subdirectories}" "${recursive_delete_pattern}" "upstream/${src_branch}" filtered-branch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this the same as before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sttts I'm not sure I understand this comment, ${src_branch} has been replaced with "upstream/${src_branch}". The effect and the result are the same, but omitting upstream/ caused an error for kcp.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. So upstream was dervied by filter-branch, but it was always "upstream/" as (implicit) prefix.

SkippedSourceBranches []string `yaml:"skip-source-branches,omitempty"`
SkipGomod bool `yaml:"skip-gomod,omitempty"`
SkipTags bool `yaml:"skip-tags,omitempty"`
SkipNonSemverTags bool `yaml:"skip-non-semver-tags,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs docs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment for this field, is that enough?

Copy link
Member

@embik embik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 1, 2025
@kcp-ci-bot
Copy link

LGTM label has been added.

Git tree hash: a5e78b6d5273d39b55f9c4d0fcd046d8d2f6e460

@kcp-ci-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: embik

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 1, 2025
@embik
Copy link
Member

embik commented Oct 1, 2025

Lift hold when feedback is addressed.

@sttts
Copy link
Member

sttts commented Oct 1, 2025

/lgtm

@xmudrii
Copy link
Member Author

xmudrii commented Oct 1, 2025

Feedback is addressed, thank you for the review @sttts @embik
/hold cancel

@kcp-ci-bot kcp-ci-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 1, 2025
@kcp-ci-bot kcp-ci-bot merged commit dbb94ec into kcp-dev:master Oct 1, 2025
6 checks passed
@xmudrii xmudrii deleted the bot-changes branch October 1, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants