Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[krel] Introduce krel subcommand for pushing git objects #1446

Closed
saschagrunert opened this issue Jul 29, 2020 · 3 comments · Fixed by #1595
Closed

[krel] Introduce krel subcommand for pushing git objects #1446

saschagrunert opened this issue Jul 29, 2020 · 3 comments · Fixed by #1595
Assignees
Labels
area/release-eng Issues or PRs related to the Release Engineering subproject kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/release Categorizes an issue or PR as relevant to SIG Release.

Comments

@saschagrunert
Copy link
Member

saschagrunert commented Jul 29, 2020

There are multiple issues with pushing the git references inside anago, which makes the overall process not idempotent. For example network flakes can abort the push, even if specified as dry-run. If the remote tag already exists due to another issue in anago, then we're not able to skip this step accordingly.

I would like to solve that issue inside a dedicated krel subcommand for pushing the git objects. This means that we would replace this complete part in anago:

release/anago

Lines 807 to 851 in 6e27776

##############################################################################
# Push git objects to github
# NOTES:
# * alpha is alone, pushes tags only
# * beta is alone, pushes tags only
# * rc is alone, pushes branch and tags
# * official pushes both official and RC items - branch and tags
# * New branch tags a new alpha on master, new RC on new branch and pushes
# new branch and tags on both
PROGSTEP[push_git_objects]="PUSH GIT OBJECTS"
push_git_objects () {
local b
local dryrun_flag=" --dry-run"
# The real deal?
((FLAGS_nomock)) && dryrun_flag=""
((FLAGS_yes)) \
|| common::askyorn -e "Pausing here. Confirm push$dryrun_flag of tags" \
"and bits" \
|| common::exit 1 "Exiting..."
logecho -n "Checkout master branch to push objects: "
logrun -s git checkout master || return 1
logecho "Pushing$dryrun_flag tags"
for release_type in "${ORDERED_RELEASE_KEYS[@]}"; do
logecho -n "Pushing ${RELEASE_VERSION[$release_type]} tag: "
logrun -v -s git push $dryrun_flag origin ${RELEASE_VERSION[$release_type]} || return 1
done
if [[ "$RELEASE_BRANCH" =~ release- ]]; then
logecho -n "Pushing$dryrun_flag $RELEASE_BRANCH branch: "
logrun -v -s git push $dryrun_flag origin $RELEASE_BRANCH || return 1
# Additionally push the parent branch if a branch of branch
if [[ "$PARENT_BRANCH" =~ release- ]]; then
logecho -n "Pushing$dryrun_flag $PARENT_BRANCH branch: "
logrun -v -s git push $dryrun_flag origin $PARENT_BRANCH || return 1
fi
fi
# For files created on master with new branches and
# for $CHANGELOG_FILEPATH, update the master
gitlib::push_master
}

Additionally, we should enhance the implementation to:

  • retry pushing on network failures
  • check if the remote tag already exists and do not fail if so
  • enhance testing around the common error cases

Refers to #1353
/priority important-soon

@saschagrunert saschagrunert added kind/feature Categorizes issue or PR as related to a new feature. sig/release Categorizes an issue or PR as relevant to SIG Release. area/release-eng Issues or PRs related to the Release Engineering subproject labels Jul 29, 2020
@k8s-ci-robot k8s-ci-robot added needs-priority priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority labels Jul 29, 2020
@puerco
Copy link
Member

puerco commented Jul 29, 2020

+1 If we are going to add more checks to the process, I think it's best to do it in go and strip anago as much as we can.

@saschagrunert saschagrunert changed the title Introduce krel subcommand for pushing git objects [krel] Introduce krel subcommand for pushing git objects Aug 4, 2020
@saschagrunert
Copy link
Member Author

@kubernetes/release-managers anyone wants to take this? :)

@puerco
Copy link
Member

puerco commented Sep 28, 2020

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/release-eng Issues or PRs related to the Release Engineering subproject kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/release Categorizes an issue or PR as relevant to SIG Release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants