Skip to content

Consolidate repository and semantic-version utilities - #54148

Draft
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/refactor-repoutil-semverutil
Draft

Consolidate repository and semantic-version utilities#54148
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/refactor-repoutil-semverutil

Conversation

Copilot AI commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Repository slug parsing remained duplicated across CLI paths, with several implementations accepting empty owner or repository components. Semantic-version prefixing and parsing also had duplicated logic and logging.

  • Canonical repository validation
    • Route CLI slug parsing through repoutil.SplitRepoSlug.
    • Preserve whitespace-specific validation in setup repository checks.
    • Compose NormalizeRepoForAPI with SplitRepoSlug for host-qualified overrides.
  • Semantic-version consolidation
    • Use semverutil.EnsureVPrefix for AWF schema URLs.
    • Remove redundant pkg/cli/semver.go logging around ParseVersion.
  • Regression coverage
    • Cover empty and host-qualified repository components.
ownerRepo, host := repoutil.NormalizeRepoForAPI(repoOverride)
if owner, repo, err := repoutil.SplitRepoSlug(ownerRepo); err == nil {
    dlHost, dlOwner, dlRepo = host, owner, repo
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Hey @pelikhan 👋 — thanks for initiating this refactor! The goal to eliminate duplicated repo-slug and semver logic across the codebase (from #54124) is well-aligned with the project's utility consolidation strategy.

However, this PR is currently in draft with zero code changes. Here's what needs to happen before this is ready for review:

  • Implement the refactor — apply the checklist items: replace all 7 reimplementations of SplitRepoSlug with the canonical repoutil.SplitRepoSlug, consolidate the EnsureVPrefix duplication, and address NormalizeRepoForAPI reuse (as detailed in [refactor] repoutil/semverutil: 9 external reimplementations, 3 with weaker validation #54124).
  • Add test coverage — include regression tests for invalid slugs (the three high-severity sites that currently accept empty owner/repo) and behavior-sensitive parsing edge cases.
  • Verify no new deps — confirm the changes don't introduce dependency bloat (low risk for this refactor, but good to check).
  • Update PR description — once code is pushed, replace the checklist with a clear summary of what was changed, which 7+ sites were consolidated, and why (fixes latent correctness bugs in three sites).

This is exactly the kind of internal consistency work the project values. Once the changes land and tests pass, this should be ready to ship.

Generated by ✅ Contribution Check · auto · 51.8 AIC · ⌖ 5.57 AIC · ⊞ 9.2K ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor repository utility and semantic version utility for adoption Consolidate repository and semantic-version utilities Aug 20, 2026
Copilot AI requested a review from pelikhan August 20, 2026 05:09
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Category: refactor | Risk: low | Priority: low (score 23/100)
Score breakdown: impact 8 + urgency 5 + quality 10
Recommended action: defer
Small, clean consolidation of repo-slug/semver utilities. Draft and no urgency; revisit once ready for review.

Generated by 🔧 PR Triage Agent · auto · 62.9 AIC · ⌖ 7.05 AIC · ⊞ 8.3K ·

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.

[refactor] repoutil/semverutil: 9 external reimplementations, 3 with weaker validation

2 participants