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

(chore) document and refactor release scripts #8078

Merged
merged 7 commits into from
Jan 12, 2022
Merged

Conversation

kikito
Copy link
Member

@kikito kikito commented Nov 15, 2021

  • chore(scripts) add instructions to some steps
  • refactor(scripts) extract check_requirements to common.sh
  • chore(scripts) make-prererelease-release works without flags
  • chore(scripts) pass all global arguments to usage function in release scripts
  • refactor(scripts) move duplicated release steps to common.js

Summary

SUMMARY_GOES_HERE

Full changelog

  • [Implement ...]
  • [Add related tests]
  • ...

Issues resolved

Fix #XXX

The other scripts use positional arguments, this script should use the same.
There have been some changes in the scripts as well:

* Some steps were renamed (e.g `luarocks` became `publish_luarock`)
* Steps that are now partially done by the CI only have the human part
  left (review the machine-generated prs)
@kikito kikito requested a review from gszr November 16, 2021 14:51
@jschmid1 jschmid1 added the chore Not part of the core functionality of kong, but still needed label Nov 22, 2021
@fffonion
Copy link
Contributor

@kikito Is there a specific parts needs to be reviewed other than trying this out locally (which I assume you have already did)?

scripts/common.sh Outdated Show resolved Hide resolved
@kikito
Copy link
Member Author

kikito commented Dec 2, 2021

@fffonion that is in fact a very good point. There is no "dry-run" mode for these scripts so "manually trying" is often not even an option.

I have tried some of the steps manually, but I have not tried all the combinations I am afraid T__T

Copy link
Contributor

@jschmid1 jschmid1 left a comment

Choose a reason for hiding this comment

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

looks good overall, hard to actually test though without a proper dryrun mode.

scripts/common.sh Outdated Show resolved Hide resolved
scripts/common.sh Outdated Show resolved Hide resolved
CONFIRM "Press Enter to push the branch and open the release PR" \
"or Ctrl-C to cancel."

set -e
Copy link
Contributor

Choose a reason for hiding this comment

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

an overall comment on the set -e and SUCCESS interaction. A nicer and more userfriendly way would be to use traps. This maybe out of scope for PR but I'll leave it here for inspiration.

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 admit that I have never used trap in such a way (I try to avoid bash script when I can ...).

From what I have read, it seems that we would still need set -e (to produce the signal that then would be captured by trap).

Let's call it out of scope for now, it seems a bit ... philosophical as well (one global rescue function vs lots of small traps?)

Copy link
Member Author

Choose a reason for hiding this comment

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

We had a live conversation about this.

@gszr , I think there must be a particular reason why set -e is set/unset on every action instead of setting it once globally. Is there? What is your opinion of using trap to recover? At the very least we should be able to print "the command blablabla failed with blebleble"

kikito and others added 2 commits January 10, 2022 20:48
Co-authored-by: Joshua Schmid <joshua.schmid@konghq.com>
Co-authored-by: Michael Martin <flrgh@protonmail.com>
@kikito kikito force-pushed the chore/release-scripts branch from d381c18 to 87125eb Compare January 10, 2022 19:49
@kikito kikito merged commit c97261d into master Jan 12, 2022
@kikito kikito deleted the chore/release-scripts branch January 12, 2022 12:49
kikito added a commit that referenced this pull request Mar 1, 2022
Our jenkins server expects and uses some steps in scripts/make-patch-release that were removed in #8078. This commit adds them back as a temporary way of releasing 2.8.0
kikito added a commit that referenced this pull request Mar 3, 2022
Our jenkins server expects and uses some steps in scripts/make-patch-release that were removed in #8078. This commit adds them back as a temporary way of releasing 2.8.0
kikito added a commit that referenced this pull request Mar 3, 2022
This function was removed accidentally in #8078
kikito added a commit that referenced this pull request Apr 8, 2022
This function was removed by mistake on a script refactor (#8078).

It was cherry-picked back into the master branch (#8495) but not to the
release/2.8.x branch. It is not needed for kong to work, but it might be
needed in order to do the post-release steps of a hypothetical 2.8.2
release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Not part of the core functionality of kong, but still needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants