Skip to content

Preserve repository ownership in overview snapshots - #151

Merged
AlexanderLanin merged 3 commits into
mainfrom
feat/multi-org-snapshots
Nov 20, 2026
Merged

AlexanderLanin merged 3 commits into
mainfrom
feat/multi-org-snapshots

Conversation

@AlexanderLanin

Copy link
Copy Markdown
Member

Why

A combined repository overview needs to keep repositories with the same name distinct. It also needs to keep existing snapshots readable and primary organization detail links working.

Store repository owners in schema 31, infer owners when reading schema 30, and give secondary organizations their own detail page namespace. Use repository ownership in GitHub links and dependency matching.

Part of #123.

Support rendering snapshots that contain identically named repositories from different organizations. Store the repository owner, reserve a namespace for secondary detail pages, and continue to read schema 30 snapshots.
Copilot AI lite review requested due to automatic review settings November 20, 2026 00:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Approval is blocked by unresolved moderate and critical issues that leave same-named repositories ambiguous, fail to populate owner data through collection, and allow unvalidated owner values to corrupt Markdown links.

3 open issues
What changed in this PR

This pull request upgrades repository overview snapshots to preserve repository ownership across schema migrations and multi-organization views, adding owner-aware links and detail-page paths.

Changes:

  • Adds schema 31 ownership metadata with schema 30 compatibility.
  • Updates Markdown and HTML renderers, dependency matching, and repository links for owned repositories.
  • Adds multi-organization regression tests and documents snapshot behavior.
File Description
tests/​test_multi_organization.py Adds tests for invalid repository paths, secondary-organization namespaces, and schema 30 migration.
src/​generate_repo_overview/​profile_readme.py Renders owner-qualified names and links for repositories in secondary organizations.
src/​generate_repo_overview/​models.py Adds repository ownership metadata, schema migration support, path validation, and owner-aware matching.
src/​generate_repo_overview/​metrics_report.py Updates Markdown report links and dependency matching for repository ownership.
src/​generate_repo_overview/​metrics_html.py Generates detail pages using owner-aware repository paths.
src/​generate_repo_overview/​_html_index.py Updates dashboard links, filters, titles, references, and lockfile handling for owned repositories.
src/​generate_repo_overview/​_html_detail.py Supports nested secondary-organization detail pages and owner-aware navigation and links.
src/​generate_repo_overview/​_html_common.py Generates owner-aware detail and GitHub links in shared HTML components.
docs/​repo-overview/​collection-and-cache.md Documents schema 30 compatibility and schema 31 ownership behavior.

Review effort: Lite

Comment thread src/generate_repo_overview/models.py Resolved
Copilot AI lite review requested due to automatic review settings November 20, 2026 09:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Two active findings remain: repository ownership is not populated or preserved through collection and caching, and empty-owner URL validation fails to fall back to primary_org, allowing malformed links.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Validate primary organization when repository owner is empty

src/​generate_repo_overview/​models.py:364

This validation omits primary_org when entry.owner is empty, which is the normal primary-repository representation in schema 31. HTML callers invoke detail_path before constructing GitHub URLs, so a snapshot with an invalid primary org_name bypasses the new path-segment guard and still emits a malformed link. Validate using primary_org as the default owner here.

3 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings November 20, 2026 12:10
@AlexanderLanin

Copy link
Copy Markdown
Member Author

Follow-up to the empty-owner validation finding. In 5e31bac, HTML detail rendering validates the primary organization when a repository has no explicit owner. The regression test covers a schema 31 snapshot with an empty owner and an invalid primary organization.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because the compatibility change introduces a subtle inconsistency between the loader’s accepted schema versions and its rejection diagnostic.

No open issues 🎉

Review effort: Lite

@AlexanderLanin
AlexanderLanin merged commit d74f7dd into main Nov 20, 2026
7 checks passed
@AlexanderLanin
AlexanderLanin deleted the feat/multi-org-snapshots branch November 20, 2026 14:59
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.

3 participants