Add github releases-created stat (#310)#472
Open
szaimen wants to merge 1 commit into
Open
Conversation
The GitHub search API does not support releases, so they are fetched
per repository via the /repos/{owner}/{repo}/releases endpoint and
filtered locally by published date and author. This requires one or
more repositories to be configured via the `repo` option.
Adds a Release class, a GitHub.release_list helper, the ReleasesCreated
stat (--gh-releases-created) and unit tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Simon L. <szaimen@e.mail.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #310 — track GitHub releases created (published) by the user.
The GitHub search API does not support releases, so unlike the other GitHub stats this cannot reuse
search(). Instead releases are fetched per repository viaGET /repos/{owner}/{repo}/releases(with Link-header pagination) and filtered locally by:published_atfalling within the reporting period (draft releases have nopublished_atand are skipped),Because of this,
releases-createdrequires one or more repositories to be configured via therepooption, e.g.repo = psss/did, teemtee/tmt. When no repo is configured the stat logs a warning and returns nothing.Changes
Releaseclass modeled onIssue(__str__for plain + markdown,__eq__,__hash__); falls back to the tag name when a release has no title.GitHub.release_list()helper.ReleasesCreatedstat, registered as--gh-releases-created.reporequirement.Testing
Full
tests/unit/plugins/test_github.pysuite run locally: 12 passed, 3 skipped (skips needGITHUB_TOKEN). No existing tests affected.Supersedes the draft #314.
🤖 Generated with Claude Code