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

docs(MAINTAINERS): Cover pre-release generation #9235

Merged
merged 15 commits into from
May 9, 2024

Conversation

gibson042
Copy link
Member

closes: #9234

Description

Update MAINTAINERS.md and scripts/get-released-tags to be more descriptive about expected use.

Security Considerations

n/a

Scaling Considerations

n/a

Documentation Considerations

Included in code changes.

Testing Considerations

None.

Upgrade Considerations

Non-technical processes such as internal handoff are not included and are expected to remain in upgrade runbooks.

@gibson042 gibson042 requested review from mhofman and ivanlei April 15, 2024 16:49
Copy link

cloudflare-workers-and-pages bot commented Apr 15, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 676098a
Status: ✅  Deploy successful!
Preview URL: https://2d8a2fd9.agoric-sdk.pages.dev
Branch Preview URL: https://gibson-9234-improve-release.agoric-sdk.pages.dev

View logs

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

The shell changes look fine, but I haven't tried to replicate

MAINTAINERS.md Outdated Show resolved Hide resolved
) and use previous releases as a template. This uses the
validator-oriented release description.
) and use previous releases as a template. The release description should include the
[_**validator oriented release description**_](#describe-the-release).

### Cleanup
Copy link
Member Author

Choose a reason for hiding this comment

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

@mhofman Please pay particular attention to the changes in this section.

@gibson042
Copy link
Member Author

@mhofman I'm re-requesting review, because there have been substantial changes per our earlier discussion.

@gibson042 gibson042 requested a review from mhofman April 16, 2024 04:49
Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

Thanks for improving these docs. I need to do another pass, and figure out what else I had missing in the draft.


To ease the maintenance process, we want to avoid any commit original to the release branch that has no direct equivalent on the `master` branch, except when needed to generate or test a specific release. To satisfy that, we usually directly cherry-pick commits and PRs from the `master` branch. We do not expect to merge the release branches back into `master`.

To clearly delineate separate releases from each other on the release branch, we now use "dev release" branches to compile all changes going into a release before merging that branch into the release branch when the release is cut. It also allows us to re-scope a release if needed without having to revert commits on the release branch.
Copy link
Member

Choose a reason for hiding this comment

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

I know I wrote this originally, but I think the "no merge back" only applies for this long running release fork. I do expect that release branches in the future will be short lived, and merged back to master.

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 want this to document current practices rather than hopeful improvements. A great deal of changes will be required when we switch to that model.

MAINTAINERS.md Outdated
Comment on lines 31 to 34
- _**release label**_: This is used for the cosmos-sdk upgrade name and git tags, and is currently
expected to follow a sequential pattern (example: `agoric-upgrade-8`).
It is preceded by release candidates numbered from zero (example: `agoric-upgrade-8-rc0`), and the
actual release shares its commit (but not its label) with the final release candidate.
Copy link
Member

Choose a reason for hiding this comment

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

Nit picking here, but the upgrade handler/plan name does not need to be exactly the "release label", and it actually isn't always the same since the plan name for the "test" network upgrades is not the same as rc git tags.

Maybe we should change one to make it clear git tags != plan name ?

MAINTAINERS.md Outdated

- [ ] When a new release is planned, create a new branch from branch `release-mainnet1B` with a name like `dev-$releaseShortLabel` (example: `dev-upgrade-8`). This can be done from the command line or the [GitHub Branches UI](https://github.com/Agoric/agoric-sdk/branches).
- [ ] Initialize the new branch for the planned upgrade:
- [ ] In **golang/cosmos/app/app.go**, update the `upgradeName` constants and the associated upgrade handler function name to correspond with the [_**release label**_](#assign-release-parameters).
Copy link
Member

Choose a reason for hiding this comment

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

I think here we need to also remove any logic specific to the previous upgrade (e.g. core proposals)

MAINTAINERS.md Outdated
- [ ] When a new release is planned, create a new branch from branch `release-mainnet1B` with a name like `dev-$releaseShortLabel` (example: `dev-upgrade-8`). This can be done from the command line or the [GitHub Branches UI](https://github.com/Agoric/agoric-sdk/branches).
- [ ] Initialize the new branch for the planned upgrade:
- [ ] In **golang/cosmos/app/app.go**, update the `upgradeName` constants and the associated upgrade handler function name to correspond with the [_**release label**_](#assign-release-parameters).
- [ ] Ensure that **a3p-integration/package.json** has an object-valued `agoricSyntheticChain` property with `fromTag` set to the [agoric-3-proposals Docker images](https://github.com/Agoric/agoric-3-proposals/pkgs/container/agoric-3-proposals) tag associated with the previous release.
Copy link
Member

Choose a reason for hiding this comment

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

I think an example might help here use-upgrade-7 (if we keep using upgrade-8 as example)

MAINTAINERS.md Outdated
- [ ] Ensure that **a3p-integration/package.json** has an object-valued `agoricSyntheticChain` property with `fromTag` set to the [agoric-3-proposals Docker images](https://github.com/Agoric/agoric-3-proposals/pkgs/container/agoric-3-proposals) tag associated with the previous release.
- [ ] Ensure that **a3p-integration/proposals** contains a single subdirectory with the following characteristics
- named like "$prefix:[_**release short label**_](#assign-release-parameters)" per [agoric-3-proposals: Naming](https://github.com/Agoric/agoric-3-proposals/pkgs/container/agoric-3-proposals#naming) (conventionally using "a" for the unreleased $prefix, e.g. `a:upgrade-8`)
- containing a **package.json** having an object-valued `agoricProposal` property with `sdkImageTag` set to "unreleased" and `planName` set to the [_**release label**_](#assign-release-parameters)
Copy link
Member

Choose a reason for hiding this comment

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

planName definitely needs to be the "upgrade plan name". The conflation with the git tag right now has been bother me.

```sh
git config rerere.enabled true
```
- [ ] Author a `rebase-todo` by selecting relevant changes from the `master` branch rebase log (see below).
Copy link
Member

Choose a reason for hiding this comment

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

I still owe the regex to build the todo log

Copy link
Member

@mhofman mhofman Apr 19, 2024

Choose a reason for hiding this comment

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

Here is how I've been generating the todo log:

  • Switch to master branch
  • git rebase -i --rebase-merges $LAST_COMMIT_IN_PREVIOUS_LOG
  • Run the following substitution to "organize" the todo log
    • \n# Branch (.*)\nreset .*\n(merge -C .*\n)?((?:pick .*\(#\d+\)\n)*)(?:label branch-point.*\n)?((?:pick .*\n)*)(?:merge -C .*\n)?(?:label \1\n) -> $2\n$3\n# Branch $1\nlabel base-$1\n$4label $1\nreset base-$1\n
    • Manually fix the last block
    • Add comments for squashed PRs
    • Copy the resulting todo
  • Run the rebase and verify the commit graph does not change (aka that the re-organization didn't change anything)

Copy link
Member

Choose a reason for hiding this comment

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

Was this useful for dev-upgrade-15?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I did not recognize your todo lists as derived from something produced by git and instead just manually based #9264 and #9266 on what you had done with upgrade-14 PRs like #8942. But even looking now, I don't think I understand where $LAST_COMMIT_IN_PREVIOUS_LOG is coming from, or how those "reorganizations" would be applied. Is the latter scriptable in a way that could be explained and checked in?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is the latter scriptable in a way that could be explained and checked in?

A possibility: restructure blocks, then rename labels.

awk '
  # Restructure branch-specific blocks from `git rebase -i --rebase-merges`
  # so that `merge` commands appear at block end rather than block start.

  NR == 1 && match($0, /^label /) {
    # An initial `label` (but not a following no-op `reset`) belongs in the first block.
    firstBlockPrefix = $0 "\n";
    noopReset = "reset " substr($0, RLENGTH + 1, length($0) - RLENGTH);
    next;
  }
  firstBlockPrefix != "" && $0 == noopReset {
    next;
  }
  /^$|^# Branch .*/ {
    # TODO: We may be able to find the PR number from a commit id or branch name.
    sub(/Branch/, "PR #??? Branch");
    blockHeader = blockHeader $0 "\n";
    next;
  }
  !match($0, /^(reset|merge -C) /) {
    printf "%s%s", blockHeader, firstBlockPrefix;
    blockHeader = "";
    firstBlockPrefix = "";
  }
  {
    print;
  }
  END {
    printf "%s%s", blockHeader, firstBlockPrefix;
  }
' | awk '
  # Rename each label that receives a `merge` to "base-$branchName".

  function addLabel(label) {
    if (++labels[label] == 1) return;
    print "duplicate label: " label > "/dev/stderr";
    exit 1;
  }
  match($0, /^$|^# .*[Bb]ranch /) {
    branch = substr($0, RLENGTH + 1, length($0) - RLENGTH);
  }
  branch != "" && match($0, /^merge -C /) && match(prev, /^reset /) {
    onto = substr(prev, RLENGTH + 1, length($0) - RLENGTH);
    sub(/ .*/, "", onto);
    newOnto = "base-" branch;
    addLabel(newOnto);
    renames[++renameCount] = onto SUBSEP newOnto;
  }
  /^label / {
    addLabel(substr($0, RLENGTH + 1, length($0) - RLENGTH));
  }
  {
    buf = buf $0 "\n";
    prev = $0;
  }
  END {
    # For "last-wins" semantics, apply renames in reverse order.
    for (i = renameCount; split(renames[i], pair, SUBSEP); i--) {
      for (j = split("label reset", rebaseCmds, " "); cmd = rebaseCmds[j]; j--) {
        newBuf = "";
        seekLine = sprintf("\n%s %s", cmd, pair[1]);
        while (k = index(buf, seekLine)) {
          len = length(seekLine);
          r = sprintf("\n%s %s", cmd, pair[2]);
          if (!match(substr(buf, k + len, 1), /[ \n]/)) r = seekLine;
          newBuf = newBuf substr(buf, 1, k - 1) r;
          buf = substr(buf, k + len, length(buf) - (k - 1) - len);
        }
        buf = newBuf buf;
      }
    }
    printf "%s", buf;
  }
'

MAINTAINERS.md Outdated
Comment on lines 327 to 331
- [ ] Open an [agoric-3-proposals](https://github.com/Agoric/agoric-3-proposals) PR to represent the mainnet proposal
corresponding with the upgrade. Include in the proposal files tests copied from this release.

- [ ] Open an [agoric-3-proposals](https://github.com/Agoric/agoric-3-proposals) PR to represent the mainnet proposal
corresponding with the upgrade. Include tests copied from this repository in the proposal files.
Copy link
Member

Choose a reason for hiding this comment

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

This seems partially duplicated.

It's not just test files, but really the whole folder, including package.json.

MAINTAINERS.md Outdated
Comment on lines 321 to 322
- [ ] Review recent changes in the [_**base branch**_](#assign-release-parameters) for anything that
should be merged into its ancestors, all the way up to `master`. This
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove this.

MAINTAINERS.md Outdated
Comment on lines 317 to 319
- [ ] Update the [_**base branch**_](#assign-release-parameters) **a3p-integration/proposals/*/package.json**
`agoricProposal` `sdkImageTag` string contents to match the number from the
["Generate new SDK version" step](#user-content-generate-sdk-version).
Copy link
Member

Choose a reason for hiding this comment

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

It's unclear what to do with this edit, especially given the subsequent request to delete the checkout.

I think this section is better placed as a sub-bullet of copying over the test proposal to agoric-3-proposal, as one of the modifications to be made.

Other modifications:

  • set the releaseNotes to the expected URL
  • generate the expected upgradeInfo from the script

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@mhofman mhofman self-requested a review April 18, 2024 21:13
```sh
git config rerere.enabled true
```
- [ ] Author a `rebase-todo` by selecting relevant changes from the `master` branch rebase log (see below).
Copy link
Member

Choose a reason for hiding this comment

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

Was this useful for dev-upgrade-15?

Comment on lines +157 to +161
- [ ] Review the [next release](https://github.com/Agoric/agoric-sdk/labels/next%20release)
GitHub label for additional tasks particular to this release.
Copy link
Member

Choose a reason for hiding this comment

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

I think we no longer have this.

currently `chore(release): publish _release_label_`. Paste
`have-news.md` as the description of the PR. Follow the example
of previous releases for any other details of the PR.
- [ ] Create the release PR:
Copy link
Member

Choose a reason for hiding this comment

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

In my release PRs I have been trying to include hidden in a details tag, the formatted rebase todo of master since the last release was cut, so we can more easily see which PRs were included, and which weren't, and in the future, just reformat since that point only to avoid duplicate work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you elaborate?


Creating this PR will also kick off the CI tests.
Creating this PR will initiate the CI tests.
Copy link
Member

Choose a reason for hiding this comment

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

We should probably have the PR labelled force:integration (at least until we have better CI logic to detect these kind of release PRs).

The idea is that integration tests should pass before we publish, which happens before we attempt to merge.

@@ -165,20 +256,22 @@ to pass.
```
Copy link
Member

Choose a reason for hiding this comment

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

Commenting here but it's about the section above. I believe publish to NPM should only happen after the publish PR is approved. I thought this was already in the Maintainers file, but it might only be in the run book.

@gibson042 gibson042 force-pushed the gibson-9234-improve-release-instructions branch from 33bd98f to 676098a Compare May 9, 2024 17:55
@gibson042 gibson042 added the automerge:rebase Automatically rebase updates, then merge label May 9, 2024
@mergify mergify bot merged commit 1d3807b into master May 9, 2024
73 checks passed
@mergify mergify bot deleted the gibson-9234-improve-release-instructions branch May 9, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MAINTAINERS.md instructions should be more foolproof
2 participants