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

make-release.py script #2393

Merged
merged 29 commits into from
May 23, 2017
Merged

Conversation

nathan-at-least
Copy link
Contributor

@nathan-at-least nathan-at-least commented May 22, 2017

ref #2391

This is a new make-release.py script which automates creation of the 'release PR' branch.

It has partial unittest coverage (large around version parsing/sorting/serializing) and always runs unittests prior to doing actual work. Most of the testing was done manually by using the --repo arg on a test repo, then reseting its state each time I needed a new test (to get around git checks). There is no other 'dry run' functionality.

Nathan Wilcox added 24 commits May 19, 2017 12:14
@bitcartel
Copy link
Contributor

ERROR | Expected branch 'master', found branch 'nathan-at-least-2391.make-release-script'

The release process used to be performed on a branch, which was then used to create a release PR.

Is that not the case anymore?

@str4d
Copy link
Contributor

str4d commented May 22, 2017

@bitcartel looks like the script itself creates the release branch, meaning it has to start from master.

@bitcartel
Copy link
Contributor

For reference, if the branch already exists, the script exists with the following message:
2017-05-22 15:40:58 L32 ERROR | Nonzero exit status: 128

@bitcartel
Copy link
Contributor

bitcartel commented May 22, 2017

On completion, the git commit messages don't contain any version or release information such as 1.0.9. e.g.

make-release.py: Versioning changes.

Copy link
Contributor

@bitcartel bitcartel left a comment

Choose a reason for hiding this comment

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

Minor comment above. I guess the pull request itself can include the version number of the release.

@nathan-at-least
Copy link
Contributor Author

@bitcartel Good idea. I think those git commit messages could easily say 'for release X.Y.Z'.

@nathan-at-least
Copy link
Contributor Author

Running on non-master or when there's already a release branch are both errors in release process and should force the release coordinator to stop and figure out what's wrong.

Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

NACK, see comments. Also needs a version test of e.g. 1.0.10 to check double-digit regex.


$ git add ./doc/authors.md ./doc/release-notes/release-notes-$ZCASH_RELEASE.md
$ ./zcutil/make-release.py v1.0.8-1 v1.0.9
Copy link
Contributor

Choose a reason for hiding this comment

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

Example has argument order reversed relative to the specified command.

initialize_git(release)
patch_version_in_files(release, releaseprev)
patch_release_height(releaseheight)
commit('Versioning changes.')
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be useful for at least one of these commit messages to contain release.

def verify_releaseprev_tag(releaseprev):
candidates = []
for tag in sh_out('git', 'tag', '--list').splitlines():
if tag.startswith('v1'): # Ignore v0.* bitcoin tags and other stuff.
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll need to change this before Sapling. Perhaps would be better to search for v0 and ignore? Or search for v, require second char to be an int, and check for val > 0?



@phase('Patching release height for auto-senescence.')
def patch_release_height(releaseheight):
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't patch WEEKS_UNTIL_DEPRECATION, which may also need to 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.

WEEKS_UNTIL_DEPRECATION should only change when the policy changes, in which case I believe that should be in a PR prior to the release PR.

Copy link
Contributor

@str4d str4d May 23, 2017

Choose a reason for hiding this comment

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

The deprecation policy is not "18 weeks after a release", but "the third Tuesday four months after a release", which is a variable duration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 'auto-sensence' feature design, as I imagined it, is 'sometime after a release is deprecated it will automatically halt'. The 'sometime after' was deliberate wording to let us rely on block heights and conservative estimates even though the deprecation policy is in calendar time. In terms of protocol planning we can rely on block heights. Humans have a calendar deadline even though it's a conservative fiction.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I reread https://z.cash/blog/release-cycle-and-lifetimes.html and I don't see my careful wording there. I think it got lost in the edits. Anyway, I don't think anyone would be unpleasantly surprised if the auto-senescence cutoff is always sometime after the policy date, and I prefer to keep the code and block heights simpler. Does that seem acceptable?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine, but then we should just say that a release is deprecated 18 weeks after it is released. If that is the official policy, then there are no inconsistencies beyond block-height vs. calendar-time discrepancies. But with the current policy, we have calendar-time vs. calendar-policy discrepancies, which IMHO are more serious.

Copy link
Contributor

Choose a reason for hiding this comment

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

More concretely, we have not confirmed that 18 weeks is always "sometime after" the third Tuesday four months after release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, in the case I think we should say the policy is 16 weeks after release, and autosenescence kicks in approximately 18 weeks after release.

with PathPatcher(path) as (inf, outf):
outf.write(inf.readline())

secondline = inf.readline()
Copy link
Contributor

Choose a reason for hiding this comment

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

Fine for now, but more fragile than the assumption that the README change happens on the first line.

'REVISION': release.patch,
'BUILD': release.build,
'IS_RELEASE': (
'false' if release.betarc == 'beta' else 'true'
Copy link
Contributor

Choose a reason for hiding this comment

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

This should instead be release.build < 50 (at least for now).

@nathan-at-least
Copy link
Contributor Author

I addressed all feedback from @str4d and @bitcartel either by making changes or clarifying the intent.

Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

ACK 187e64c but overall NACK pending further clarification.

Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

ACK. Still missing a double-digit version unit test, but that's non-blocking.

Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

ACK 88bf7eb

@nathan-at-least
Copy link
Contributor Author

@zkbot r+

@zkbot
Copy link
Contributor

zkbot commented May 23, 2017

📌 Commit 88bf7eb has been approved by nathan-at-least

@zkbot
Copy link
Contributor

zkbot commented May 23, 2017

⌛ Testing commit 88bf7eb with merge 57c7838...

zkbot added a commit that referenced this pull request May 23, 2017
…han-at-least

make-release.py script

ref #2391

This is a new `make-release.py` script which automates creation of the 'release PR' branch.

It has partial unittest coverage (large around version parsing/sorting/serializing) and always runs unittests prior to doing actual work. Most of the testing was done manually by using the ``--repo`` arg on a test repo, then reseting its state each time I needed a new test (to get around git checks). There is no other 'dry run' functionality.
@zkbot
Copy link
Contributor

zkbot commented May 23, 2017

☀️ Test successful - pr-merge
Approved by: nathan-at-least
Pushing 57c7838 to master...

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

Successfully merging this pull request may close these issues.

None yet

4 participants