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

(feat): use towncrier for changelog automations #1604

Merged
merged 23 commits into from
Aug 27, 2024
Merged

Conversation

ilan-gold
Copy link
Contributor

@ilan-gold ilan-gold commented Aug 22, 2024

Blocked by twisted/towncrier#661 and twisted/towncrier#648 (comment).

Also, need to figure out exactly where to inject this into the CI. If not, this can be done manually, although I'd rather not.

I've set up the 0.10.9 release to use towncrier - so all you need to do is run towncrier before building the docs.

  • Closes #
  • Tests added
  • Release note added (or unnecessary)

@ilan-gold ilan-gold changed the title (feat): use towncrier for docs automations (feat): use towncrier for changelog automations Aug 22, 2024
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.25%. Comparing base (229e2a6) to head (dac333b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1604      +/-   ##
==========================================
- Coverage   86.74%   84.25%   -2.49%     
==========================================
  Files          37       37              
  Lines        5989     5989              
==========================================
- Hits         5195     5046     -149     
- Misses        794      943     +149     

see 8 files with indirect coverage changes

Copy link
Member

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

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

Wow, if that’s it, that looks extremely clean, seems instantly nicer than what we have now.

Also, need to figure out exactly where to inject this into the CI. If not, this can be done manually, although I'd rather not.

Ideally release-please style:

  1. A workflow-generated PR¹ that contains the result of running towncrier to prepare a release. Two options for how it’s created:
    1. some workflow reacts to pushes on main and the current version branch by creating/updating a “do a patch release” PR and a “do a minor/major release” PR. The effect is two PRs always existing, except directly after a release1.
    2. a manually run workflow with the dropdown choices “patch”, “minor”, “major” creates that PR
  2. When that(/one of these) PRs is merged, a workflow creates Git tag, GitHub release, and PyPI release.

Footnotes

  1. After merging the patch release PR, the minor/major PR would still be open. After merging the minor/major PR, the patch release PR gets auto-closed.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@flying-sheep
Copy link
Member

flying-sheep commented Aug 23, 2024

FYI: I pushed eefafad:

  • This allows to just hatch run towncrier:

    anndata/hatch.toml

    Lines 1 to 3 in eefafad

    [envs.default]
    installer = "uv"
    features = ["dev"]
  • This allows to rely on standard metadata without allow-direct-references:
    "towncrier>=24.8.0rc1",

@flying-sheep
Copy link
Member

flying-sheep commented Aug 23, 2024

Some thoughts:

  1. https://towncrier.readthedocs.io/en/stable/pre-commit.html
  2. We can maybe simply use sections for our minor version headers:
    1. create directories release-notes/0.10 and release-notes/0.11
    2. create feature snippets in 0.11 and others in 0.10
    3. if we release a bugfix release, we stash the 0.11 directory and run towncrier, if we create a feature release, we move all snippets to the 0.11 directory and run towncrier.

@ilan-gold
Copy link
Contributor Author

ilan-gold commented Aug 23, 2024

We can maybe simply use sections for our minor version headers:

Is there something wrong with our current system? I like the separate branches, like v0.10, which will contain fragments (after the the inital feature release) that aren't features so there's no need to stash or for separate directories etc.

@flying-sheep
Copy link
Member

flying-sheep commented Aug 23, 2024

I like the separate branches, like v0.10, which will contain fragments (after the the inital feature release) that aren't features so there's no need to stash or for separate directories etc.

ah, sure, the bugfix branch doesn’t have the feature fragments, makes sense!

And actually we can’t use sections for what I was thinking.

My comment was about this structure:

grafik

when we do a feature release, we’d want to insert

(v0.11)=
## Version 0.11

before the new 0.11.0 version we’re creating.

and when we do a bugfix release, we want our new section to be inserted below the “Version 0.10” header.

There is only one insertion point: see here

but maybe moving that around as part of the release automation isn’t so bad!

@flying-sheep

This comment was marked as outdated.

@flying-sheep
Copy link
Member

flying-sheep commented Aug 25, 2024

Ooof, now that I wrote all this code, I realized there’s an even better solution:

Replace the whole content of release-notes/index.md with

# Release notes

```{release-notes} .
```

and implement the release-notes directive that collects all *.*.*.{rst,md} file names in the directory . and constructs the whole doctree that file currently contains.

@ilan-gold ilan-gold added this to the 0.10.9 milestone Aug 26, 2024
@flying-sheep
Copy link
Member

flying-sheep commented Aug 26, 2024

TODO:

  • migrate 0.11.0.md to feature fragments ((chore): v0.11 fragments #1611)
  • backport everything except for feature fragments to 0.10.x branch (this PR has the milestone 0.10.9)

@ilan-gold
Copy link
Contributor Author

@flying-sheep It will be easier to backport this if we simply don't do the 0.11 fragments on this branch. I will open up a follow-up PR.

@ilan-gold ilan-gold marked this pull request as ready for review August 27, 2024 08:52
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Co-authored-by: Philipp A. <[email protected]>
@flying-sheep flying-sheep merged commit 21a3a6d into main Aug 27, 2024
8 of 13 checks passed
@flying-sheep flying-sheep deleted the ig/towncrier branch August 27, 2024 14:19
@scverse scverse deleted a comment from lumberbot-app bot Aug 27, 2024
flying-sheep added a commit that referenced this pull request Aug 27, 2024
flying-sheep added a commit that referenced this pull request Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants