Skip to content

Add github releases-created stat (#310)#472

Open
szaimen wants to merge 1 commit into
psss:mainfrom
szaimen:add-github-releases-stat
Open

Add github releases-created stat (#310)#472
szaimen wants to merge 1 commit into
psss:mainfrom
szaimen:add-github-releases-stat

Conversation

@szaimen

@szaimen szaimen commented Jun 24, 2026

Copy link
Copy Markdown

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 via GET /repos/{owner}/{repo}/releases (with Link-header pagination) and filtered locally by:

  • published_at falling within the reporting period (draft releases have no published_at and are skipped),
  • author login matching the configured user.

Because of this, releases-created requires one or more repositories to be configured via the repo option, e.g. repo = psss/did, teemtee/tmt. When no repo is configured the stat logs a warning and returns nothing.

Changes

  • Release class modeled on Issue (__str__ for plain + markdown, __eq__, __hash__); falls back to the tag name when a release has no title.
  • GitHub.release_list() helper.
  • ReleasesCreated stat, registered as --gh-releases-created.
  • Module docstring updated to document the new stat and the repo requirement.
  • Unit tests for both the happy path and the missing-repo warning.

Testing

Full tests/unit/plugins/test_github.py suite run locally: 12 passed, 3 skipped (skips need GITHUB_TOKEN). No existing tests affected.

Supersedes the draft #314.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant