Skip to content

Conversation

@bastimeyer
Copy link
Member

This rewrites the changelog and GitHub release body. The goal was to get rid of the git shortlog in the changelog.md file, as it bloats up the entire file by a lot and is mostly unnecessary. I've replaced each shortlog with a simple link to the git commit history between the previous tag and the current one on GitHub, where commit diffs are just one click away, which is much better in most cases.

The changelog is used in a couple of different places and removing the git shortlog has different implications:

  1. The changelog file itself
    • accessed via the git repo on GitHub
      A link to the commit history with access to diffs makes more sense than a shortlog
    • accessed via a locally cloned git repo
      The commit log and diffs can be read locally
    • accessed via a downloaded tarball / zip archive from GitHub
      A link to the commit history with access to diffs makes more sense than a shortlog
    • accessed via the source-dist tarballs uploaded to PyPi / GitHub releases
      Removing the git shortlog could be a problem here, but I don't think it's too big of an issue
  2. The docs
    A link to the commit history with access to diffs makes more sense than a shortlog
  3. As part of the GitHub release body message
    The new release script automatically generates a shortlog in a addition to a new contributors list with GitHub account names for automatic highlighting, so nothing will be changed here. Having a shortlog on the releases page makes sense, because the changelog often doesn't include everything and refers to the shortlog for minor plugin changes/fixes.

This doesn't split the changelog in the docs into multiple pages like I originally intended, as it would require writing a new Sphinx extension. Removing the shortlogs however already solves most of the navigation / legibility issues of the current changelog page in the docs.


I haven't verified these changes in my test repo with a test-release yet, but the dry-runs all looked fine. Opening this as a draft for now, because it won't be part of 4.0.0 anyway.

@gravyboat
Copy link
Member

gravyboat commented Apr 30, 2022

This looks really good to me. It's very clear how everything works and the usage of the diff in the changelog file itself is a good idea.

@bastimeyer bastimeyer force-pushed the changelog-and-release-rework branch 4 times, most recently from c6428a2 to 92ca030 Compare May 1, 2022 07:17
@bastimeyer bastimeyer force-pushed the changelog-and-release-rework branch from 92ca030 to 52f0d27 Compare May 1, 2022 10:07
@bastimeyer bastimeyer force-pushed the changelog-and-release-rework branch from 52f0d27 to 1713d98 Compare May 1, 2022 12:55
@bastimeyer bastimeyer force-pushed the changelog-and-release-rework branch from 1713d98 to d2becf1 Compare May 1, 2022 17:58
@bastimeyer bastimeyer marked this pull request as ready for review May 1, 2022 18:02
@bastimeyer
Copy link
Member Author

This should now be ready for review. As mentioned, I did some test releases and it should be fine. I deleted these test releases, but if you want confirmation, I can push another test release again.

I unfortunately made a mistake in #4503 and forgot about the wheels in the dist directory which are now also uploaded to 4.0.1 on GitHub. This PR would fix it again and would only upload the tarball (plus signature).

There's also the option of replacing the streamlink-bot token with a simple GitHub actions token when creating a GitHub release. streamlink-bot has become obsolete and was only added in the past because some API OAuth token was needed to create releases or to push commits (in other repos). This is now fully automated via GITHUB_TOKEN and the according token permissions. I've modified the script so that both kinds of API tokens can be used. It's just a simple choice of which GH account will be used for GH releases. The streamlink-bot one however is non-temporal and thus has the potential to be stolen/abused. And I believe it's a deprecated OAuth token, too.

@gravyboat
Copy link
Member

gravyboat commented May 1, 2022

The streamlink-bot one however is non-temporal and thus has the potential to be stolen/abused. And I believe it's a deprecated OAuth token, too.

Yeah I'd prefer we no longer use this account for security purposes if we don't have to. I don't see any reason to support both.

Edit: @bastimeyer were there any changes made since I looked at this a few days ago other than the change in #4503?

@bastimeyer
Copy link
Member Author

were there any changes made since I looked at this a few days ago

This is the diff compared to the very first push
https://github.com/streamlink/streamlink/compare/717fffa..d2becf1

So basically just a few clean-ups, bugfixes and minor changes in regards to the API key. Nothing functional.

Considering that there could be more problems with 4.0.x, I'd suggest not merging this yet. It's just an improvement for the readability of the changelog anyway (with the added contributors list).

bastimeyer added 3 commits May 2, 2022 06:44
- Completely rewrite GitHub release script
  - Remove --dry-run and make it implicit when no API key is set
  - Remove --api-key and read from RELEASES_API_KEY or GITHUB_TOKEN
  - Add --template, --changelog, --no-contributors and --no-shortlog
  - Refactor GitHub API stuff
  - Update release template logic and use Jinja2
  - Get list of contributors (with support for commit co-authors):
    GitHub highlights usernames in releases, which this is meant for
  - Generate git shortlog automatically
  - Always close open file handles
- Update release template based on Jinja2 logic
- Update release CI job
  - Install Jinja2
  - Upgrade Python to 3.10 and setup-python to v2
  - Fetch entire repo
  - Don't upload wheels to GitHub releases
@bastimeyer bastimeyer force-pushed the changelog-and-release-rework branch from d2becf1 to bc4be51 Compare May 2, 2022 05:02
@bastimeyer
Copy link
Member Author

bastimeyer commented May 2, 2022

One final update:

  • ignore merge commits in contributors list
  • don't include release commit in shortlog or contributors list
  • use GITHUB_TOKEN for deploying to GH releases (instead of custom OAuth token from streamlink-bot)
  • rename the file and make it consistent with other script file names (using a second commit to retain git history)

Test release for demonstration purposes:

env:
RELEASES_API_KEY: ${{ secrets.RELEASES_API_KEY }}
run: ./script/github_releases.py "${STREAMLINK_DIST_DIR}"/*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Collaborator

@back-to back-to May 7, 2022

Choose a reason for hiding this comment

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

there is no secrets.GITHUB_TOKEN in
https://github.com/streamlink/streamlink/settings/secrets/actions
or is it hidden?

Copy link
Member Author

Choose a reason for hiding this comment

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

@back-to back-to merged commit bcd624c into streamlink:master May 7, 2022
@bastimeyer bastimeyer deleted the changelog-and-release-rework branch May 7, 2022 11:53
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.

3 participants