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

rotate responsibility for release process #7011

Merged
merged 1 commit into from
Aug 5, 2020
Merged

Conversation

garyverhaegen-da
Copy link
Contributor

This PR attempts to add some automation around assigning release management. The PR adds a file release/rotation; each week, the updated CI cron job will:

  • Open a PR for the new release [as current].
  • Assign the first user in the file to that PR.
  • Add the Standard-Change label to the PR.
  • Start the build for that PR [as current].
  • Open a new PR that rotates the release/rotate file, i.e. pushes back the first line to the end of the file.

This PR also adds mentions of the "release handler" (the first line of release/rotation) to the various messages we send to Slack along the release process.

The initial state of the release/rotation file has been created by listing all the volunteers (Language team, Application Runtime team, as well as @SamirTalwar-DA and @stefanobaghino-da) and piping the file through shuf. (Then I put myself at the top so I can hopefully iron out the issues with the first attempt.)

CHANGELOG_BEGIN
CHANGELOG_END

@garyverhaegen-da garyverhaegen-da requested review from cocreature and a user August 5, 2020 13:28
@@ -475,10 +475,11 @@ jobs:
condition: not(eq(variables['skip-github'], 'TRUE'))
- bash: |
set -euo pipefail
pr_handler=$(head -1 release/rotation | awk "${print $1}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This step of the release process runs on the trigger commit on the master branch, so the release/rotation file is the right one. (As opposed to many steps in the release process that checkout the target commit.)

-H "$AUTH" \
--silent \
--location \
-d "{\"title\": \"$title\", \"head\": \"$branch\", \"base\": \"master\", \"body\": \"$body\"}" \
Copy link

Choose a reason for hiding this comment

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

If you're wary about special characters in the title or body, you could do something like this:

jq -n --arg branch "$branch" --arg title "$title" --arg body "$body" '{"title": $title, "head": $branch, "base": "master", "body": $body}' \
  | curl ... -d @- https://...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not know jq had such a syntax. Thanks!

local tmp
tmp=$(mktemp)
cp release/rotation $tmp
cat <(tail -n +2 $tmp) <(head -1 $tmp) > release/rotation
Copy link

Choose a reason for hiding this comment

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

You don't need to get cat involved here.

Suggested change
cat <(tail -n +2 $tmp) <(head -1 $tmp) > release/rotation
(tail -n +2 $tmp; head -1 $tmp) > release/rotation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You always want to oust my cats. 😿

Copy link

Choose a reason for hiding this comment

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

Let the cat sleep. It's had a hard day.

--definition-name "digital-asset.daml" \
--org "https://dev.azure.com/digitalasset" \
--project daml
echo $pr_number > $out
Copy link

Choose a reason for hiding this comment

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

This doesn't seem to be used anywhere. I might be mistaken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's used to get the PR number so we can assign the Standard-Change label to it, assign the release handler, and mention it in the second PR message.

Copy link

Choose a reason for hiding this comment

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

Aha, it's unused in the second open_pr, but not the first. Can I suggest making it an optional parameter, rather than calling mktemp?

Suggested change
echo $pr_number > $out
if [[ -n "$out" ]]; then
echo $pr_number > $out
fi

@garyverhaegen-da
Copy link
Contributor Author

Finally confirmed working as intended (see #7020 & #7021).

Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

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

Great work, thank you very much! I’ll leave the Bash bikeshedding to @SamirTalwar 🙂

@@ -523,7 +524,14 @@ jobs:
# using basic auth format:
# https://username:password@github.com/:user/:repo.git
# This series of pipes extracts the `username:password` part.
AUTH="$(git config remote.origin.url | grep -o "://.*:.*@" | cut -c4- | rev | cut -c2- | rev)"
#
# It looks like in some cases the credentials get stored separately as
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this always the case and we just didn’t hit it so far or did something change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. It's probably a git version change between our GCP-hosted nodes and the Azure ones.

Making it work for both seemed like less effort than trying to figure out when I should support which one.

azure-pipelines.yml Show resolved Hide resolved
ci/cron/wednesday.yml Show resolved Hide resolved
This PR attempts to add some automation around assigning release
management. The PR adds a file `release/rotation`; each week, the
updated CI cron job will:

- Open a PR for the new release [as current].
- Assign the first user in the file to that PR.
- Add the Standard-Change label to the PR.
- Start the build for that PR [as current].
- Open a new PR that rotates the `release/rotate` file, i.e. pushes back
  the first line to the end of the file.

This PR also adds mentions of the "release handler" (the first line of
`release/rotation`) to the various messages we send to Slack along the
release process.

The initial state of the `release/rotation` file has been created by
listing all the volunteers (Language team, Application Runtime team, as
well as @SamirTalwar-DA and @stefanobaghino-da) and piping the file
through `shuf`. (Then I put myself at the top so I can hopefully iron
out the issues with the first attempt.)

CHANGELOG_BEGIN
CHANGELOG_END
@garyverhaegen-da garyverhaegen-da merged commit 00f3de6 into master Aug 5, 2020
@garyverhaegen-da garyverhaegen-da deleted the release-rotation branch August 5, 2020 16:58
@stefanobaghino-da
Copy link
Contributor

Nice! Is there a way for people to know in advance about this?

@cocreature
Copy link
Contributor

@stefanobaghino-da We just go through the file top to bottom so you can just look at the entries to see when you are up.

@stefanobaghino-da
Copy link
Contributor

How would I go about that? I don't know who was last.

@cocreature
Copy link
Contributor

The file is rotated every week so the one at the top is always the next one.

@garyverhaegen-da
Copy link
Contributor Author

garyverhaegen-da commented Aug 17, 2020

Nice! Is there a way for people to know in advance about this?

Ah, sorry. I discussed it in team meetings, but obviously that doesn't work for you and @SamirTalwar-DA. Happy to answer any further questions here, on Slack, or on a call, though the gist of it really is just that when it's your turn, you will be @-mentioned both in relevant PRs and relevant Slack messages. (That is, if it works as intended — it did not quite do so last week, but I tried to fix it, so maybe this week it will.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants