Skip to content

fix: pub.dev per-version changelogs and public-only GitHub repositories - #12

Merged
fleizean merged 3 commits into
developfrom
gsd/quick-261021-pubdev-repo-visibility
Oct 21, 2026
Merged

fleizean merged 3 commits into
developfrom
gsd/quick-261021-pubdev-repo-visibility

Conversation

@fleizean

@fleizean fleizean commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

pub.dev release notes are read from each version's own changelog page, and a GitHub repository is only used (for notes, the repository link and the trust lookup) when the API confirms it is public.

Why

  • virusis_api_client_ng on pub.dev has a note for every version, but pkgdiff stored all of them empty. /packages/<name>/changelog renders only the CHANGELOG of the latest upload; older versions' notes live on /packages/<name>/versions/<version>/changelog.
  • The same package declares a private GitHub repository, and its sibling virusis_api_client declares an organization URL (https://github.com/virusis-company/). The GitHub token may be able to read private repositories, so their release notes and changelog files could be scraped and published. A private repository can also become public later, so the decision cannot be made once and stored for good.

Changes

  • PubDevService reads /versions/{version}/changelog first and falls back to the package changelog page. The heading must name the exact version (1.2.0 no longer matches 1.2.0+1 or 1.2.0-dev).
  • GitHubScraperService checks GET /repos/{owner}/{repo} before reading releases, changelog files, release files or milestones. Only "private": false counts as public; 404 or a URL without owner/repo counts as not usable. The answer is cached for 6 hours. When the check fails and a token is configured, nothing is read for now. Without a token, nothing private is reachable, so no check is made.
  • PackageCacheService stores a GitHub URL only when it is not known to be private or missing. This applies to new packages, to every metadata refresh (so a repository that turns public comes back) and to repositories found while scraping (PackageAnalysisService). With no stored URL, the package page hides the repository link and "View on GitHub", and the trust lookup falls back to the project URL.
  • Updated the two pub.dev tests that pin the requested URLs.

Notes for reviewers

  • One extra GitHub API call per repository every 6 hours, from the shared budget.
  • Registries that do not publish notes (npm, PyPI) need a repository URL for a complete cache entry. A package whose repository is private is therefore refetched from the registry on each visit, the same as a package without a repository today.
  • Existing rows change only on their next metadata refresh. The stored virusis_api_client_ng rows are corrected with a separate one-off SQL update.
  • Not built or tested locally; CI is the check.

Checklist

  • The pull request targets develop and is about one thing
  • Commit messages follow Conventional Commits (feat(scope): ..., fix(scope): ...)
  • CI is green (backend tests, frontend build and tests, dependency gate)
  • Schema changes are EF Core migrations generated by the tool, not hand-edited
  • A changed backend DTO has its TypeScript twin updated in src/frontend/src/app/core/models
  • New dependencies are justified and their lock files are updated in the same commit
  • No secrets, tokens or personal data in code, logs or this description
  • Code comments are kept to a minimum; the reasoning lives in this description

Enes Yağız and others added 2 commits October 21, 2026 10:41
The package changelog page on pub.dev shows only the CHANGELOG of the
latest upload, so every older version whose entry was dropped from that
file was stored with empty notes. Each version's page keeps the file it
was published with; the package page stays the fallback. The entry is
now matched on the exact version, so 1.2.0 no longer takes the entry of
1.2.0+1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The GitHub token may see private repositories, so release notes and
changelog files of a private repository could be read and published.
Before anything is read, the repository is checked through the API and
only a public one is used; the answer is cached for six hours. A
repository that is private, missing or not an owner/repo URL is no
longer stored on the package, so the page shows no link to it and the
trust lookup does not use it. The check runs again on every metadata
refresh, so a repository that turns public is picked up again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fleizean
fleizean merged commit 035e882 into develop Oct 21, 2026
5 checks passed
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