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

Release process still has gotchas #7052

Closed
6 of 8 tasks
yarikoptic opened this issue Sep 21, 2022 · 25 comments
Closed
6 of 8 tasks

Release process still has gotchas #7052

yarikoptic opened this issue Sep 21, 2022 · 25 comments
Assignees
Labels
release automation Automatic release and changelog generation

Comments

@yarikoptic
Copy link
Member

yarikoptic commented Sep 21, 2022

woohoo -- 0.17.6 was finally "auto-released" without auto. The last fix needed was #7051 to make secrets available.
A few gotchas to be addressed:

edit: fixes should be implemented and tested on some test repo first.

@jwodder
Copy link
Member

jwodder commented Sep 21, 2022

@yarikoptic

  • The tag is created directly by the release workflow. I don't see an easy way to extract the changelog entries for use as the tag annotation message.
  • The release notes are formatted like that because GitHub treats newlines in release notes (and issue comments and some other Markdown sources) as hard line breaks. The only thing we can do is to modify the snippet generation script to not line-wrap entries.
  • Why shouldn't <a id='changelog-0.17.6'></a> be there? scriv seems to do that automatically (with no way to disable it?), and I don't see the harm.

@yarikoptic
Copy link
Member Author

  • line wraps -- yes, we better to not line wrap since it also breaks down links so we get funny rendering in pycharm even:
    image
    • may be there would also be away to avoid unnecessary empty lines between entries? is that trailing new line somewhere or scriv added? (then might beg for an issue)
  • changelog entries for annotation message -- just all new lines added on top from what it was before running scriv to compose changelog
  • I do not see a good reason for html to be hardcoded in markdown, nobody would even see them in rendering and github produces its own ids so it is possible to permalink. So IMHO just makes markdown uglier and overall not really desired.

FWIW the one in datalad-next which is AFAIK generated by scriv: https://raw.githubusercontent.com/datalad/datalad-next/main/CHANGELOG.md

@mih --

@yarikoptic
Copy link
Member Author

@mih -- did you use scriv to generate releases on github for -next ? https://github.com/datalad/datalad-next/releases/tag/0.6.0 looks rendered fine despite text wrapping (but smart/human one, not breaking markdown control) in .md (which differs from our observation here). tags are signed so you annotate/sign locally and push and then just convert to release on github right? (that is how I did releases manually as well).

@jwodder I think we might better indeed

  • not wrap
  • tag locally annotated with content of changelog, push the tag
  • trigger github making a release from an annotated tag

i.e. to not rely on scriv+github release mechanism

@jwodder
Copy link
Member

jwodder commented Sep 21, 2022

@yarikoptic The HTML anchor tags were added in scriv in response to nedbat/scriv#46, which seems like the proper place to comment on your desire for getting rid of them.

@jwodder
Copy link
Member

jwodder commented Sep 21, 2022

@yarikoptic

trigger github making a release from an annotated tag

What mechanism are you expecting to be used for this? As far as I'm aware, if no release notes are supplied when a GitHub release is created, GitHub will default to displaying the body of the tag annotation or tagged commit message (not sure which) in monospace. Creating a release properly means supplying the release notes in the API request (i.e., ignoring whatever's in the annotated tag), at which point we might as well use scriv.

@jwodder
Copy link
Member

jwodder commented Sep 21, 2022

@yarikoptic

changelog entries for annotation message -- just all new lines added on top from what it was before running scriv to compose changelog

How exactly should I extract that?

@jwodder
Copy link
Member

jwodder commented Sep 21, 2022

@yarikoptic Issues with entry separators reported to scriv at: nedbat/scriv#62

@yarikoptic
Copy link
Member Author

What mechanism are you expecting to be used for this

could you please check how auto did that? it seemed to do "the right thing" -- we did get proper annotated tags and releases with markdown and all the niceness. May be it is just a matter of making a release and then force pushing the tag? I did just that now -- made local signed 0.17.6, force pushed to github and then edited the release notes to have proper markdown (no wrapping). Also may be if tag is pushed before minting a release on github , it would create a release without creating a lightweight tag for it? again -- release notes could be edited and proper markdown could be provided.

changelog entries for annotation message -- just all new lines added on top from what it was before running scriv to compose changelog

How exactly should I extract that?

something like this in bash - tune to your liking, probably also removing more header lines since we do not need to repeat the version in the release record etc.

  • nlines=$(wc -l CHANGELOG.md)
  • update CHANGELOG.md
  • newrecord=$(head -n -$nlines CHANGELOG.md | grep -v '<.*>')

@yarikoptic
Copy link
Member Author

re html tags, ok -- let's just keep them for now, not the major hassle.

@jwodder
Copy link
Member

jwodder commented Sep 22, 2022

@yarikoptic

What mechanism are you expecting to be used for this

could you please check how auto did that?

I'm positive that auto just uses the GitHub API and supplies the release notes in the request body. Note that auto's tag annotations are all of the form "Update version to 0.46.3"; they do not include the new CHANGELOG section.

Is there really a need to include the CHANGELOG in the tag annotation?

@yarikoptic
Copy link
Member Author

I'm positive that auto just uses the GitHub API and supplies the release notes in the request body. Note that auto's tag annotations are all of the form "Update version to 0.46.3"; they do not include the new CHANGELOG section.

it could well be -- how do they get then annotated git tags?

Is there really a need to include the CHANGELOG in the tag annotation?

not really. I just did and considered it a good practice, but does not have to be really. ok to not do it.

I am going to fix up CHANGELOG.md and .rst now -- our CI is failing etc. I will push directly into maint

@yarikoptic
Copy link
Member Author

another gotcha is that if we are to keep html tags, then need to have an empty line after for pandoc to correctly convert them to .rst . Since unlikely to happen, I will just remove tags before converting to .rst. All done in 2de6ee6

@jwodder
Copy link
Member

jwodder commented Sep 23, 2022

@yarikoptic

it could well be -- how do they get then annotated git tags?

The annotated tags are created in a separate operation from the GitHub releases.

@jwodder
Copy link
Member

jwodder commented Sep 23, 2022

@yarikoptic So what do you want the tag annotation messages to say?

@yarikoptic
Copy link
Member Author

if not changelog -- keep consistent with auto e.g. Update version to {version}

@jwodder
Copy link
Member

jwodder commented Sep 23, 2022

@yarikoptic I've successfully tested the requested changes in https://github.com/datalad/temp-release-devel. The latest release includes emoji in the category headers (also in the CHANGELOG), and the lines are not broken. GitHub doesn't seem to display tag annotations in a way that distinguishes them from lightweight tags, but you can still see the tag message by clicking on the ellipsis next to "0.0.2" in https://github.com/datalad/temp-release-devel/tags.

This just leaves the matter of the CHANGELOG section divider.

@yarikoptic
Copy link
Member Author

re tags - cool. Confirmed locally by cloning and

❯ git describe 0.0.2
0.0.2

;) re divider: dropped an idea in nedbat/scriv#62 (comment) . And we lack new line since we do not have it in our templates/new_fragment.md.j2 so quick fix would be to add empty line after fragment like shown in nedbat/scriv#62 (comment) .

@jwodder
Copy link
Member

jwodder commented Sep 23, 2022

@yarikoptic As I understand scriv, new_fragment.md.j2 is only used by scriv create, which we don't use (favoring automatic snippet generation instead).

@yarikoptic
Copy link
Member Author

@jwodder - would you be so kind to go through original checklist of issues and mark the ones which were already dealt with in the datalad/release-action (just ran into nonannotated tag so decided to check if known/addressed)

@jwodder
Copy link
Member

jwodder commented Oct 17, 2022

@yarikoptic The only remaining issue not fixed in release-action is the section divider issue, which requires changes on scriv's end.

@yarikoptic
Copy link
Member Author

@yarikoptic The only remaining issue not fixed in release-action is the section divider issue, which requires changes on scriv's end.

please file an issue. IIRC also using pandoc there could have provided a solution.

@jwodder
Copy link
Member

jwodder commented Oct 18, 2022

@yarikoptic I already filed an issue: nedbat/scriv#62.

@mih
Copy link
Member

mih commented Nov 7, 2022

We have just released 0.9.4

image

This is likely fallout from the switch to maint as default branch.

edit by @yarikoptic: dedicated issue - #7146

@bpoldrack
Copy link
Member

Are you aware of something that still needs doing here, @yarikoptic ?

@yarikoptic
Copy link
Member Author

I think we are ok, thanks!

@jwodder jwodder added the release automation Automatic release and changelog generation label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release automation Automatic release and changelog generation
Projects
None yet
Development

No branches or pull requests

4 participants