Skip to content

refactor: remove dead parse() code from git provider adapters#2761

Merged
serhalp merged 1 commit into
mainfrom
serhalp/refactor/remove-dead-parse-adapter-code
May 17, 2026
Merged

refactor: remove dead parse() code from git provider adapters#2761
serhalp merged 1 commit into
mainfrom
serhalp/refactor/remove-dead-parse-adapter-code

Conversation

@serhalp
Copy link
Copy Markdown
Member

@serhalp serhalp commented May 17, 2026

🔗 Linked issue

N/A

🧭 Context

This was refactored at some point long ago to use a shared parseRepoUrl but the old unused parse methods were orphaned.

📚 Description

Remove the dead code!

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment May 17, 2026 2:20pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview May 17, 2026 2:20pm
npmx-lunaria Ignored Ignored May 17, 2026 2:20pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9f7c8d58-16ec-4c17-b295-230d3429311f

📥 Commits

Reviewing files that changed from the base of the PR and between 2c063eb and 99af280.

📒 Files selected for processing (1)
  • app/composables/useRepoMeta.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/composables/useRepoMeta.ts

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Improved repository metadata resolution for better performance and reliability.
    • Streamlined provider detection and direct lookup, making repository detail retrieval faster and more consistent.
    • Simplified adapter interfaces to reduce duplication and clarify provider responsibilities, aiding maintainability.

Walkthrough

useRepoMeta now parses repository URLs with parseRepoUrl and selects provider adapters via a keyed providers Record. ProviderAdapter no longer requires id/parse; adapters only provide links(ref) and fetchMeta(...). The registry changed from an ordered array to a Record<ProviderId, ProviderAdapter> and missing adapters return null.

Changes

useRepoMeta provider adapter refactoring

Layer / File(s) Summary
Type contract, imports and repoRef
app/composables/useRepoMeta.ts
Import parseRepoUrl and GIT_PROVIDER_API_ORIGINS. ProviderAdapter type updated to remove id/parse and keep only links and fetchMeta. repoRef now returns parseRepoUrl(url) directly.
Provider adapters (links & fetchMeta only)
app/composables/useRepoMeta.ts
GitHub, GitLab, Bitbucket, Codeberg, Gitee, Gitea, SourceHut, Tangled, Radicle, and Forgejo adapters were reshaped to remove embedded id/parse logic; each adapter now exposes only links(ref) and fetchMeta(...) and uses fields supplied by parseRepoUrl (e.g., ref.provider, ref.host).
Providers registry and adapter selection
app/composables/useRepoMeta.ts
Provider registry changed from an ordered ProviderAdapter[] to a keyed Record<ProviderId, ProviderAdapter>. Adapter selection uses providers[ref.provider] and metadata fetch returns null if no adapter exists.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing unused parse() methods from git provider adapters, which aligns with the 254 lines removed and the refactoring focus.
Description check ✅ Passed The description is directly related to the changeset, explaining the context (previous refactoring to use shared parseRepoUrl) and the objective (removing dead parse code from adapters).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch serhalp/refactor/remove-dead-parse-adapter-code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@serhalp serhalp force-pushed the serhalp/refactor/remove-dead-parse-adapter-code branch 2 times, most recently from 3ef3ef1 to 2c063eb Compare May 17, 2026 14:16
This was refactored at some point long ago to use a shared
`parseRepoUrl` but the old unused `parse` methods were orphaned.
@serhalp serhalp force-pushed the serhalp/refactor/remove-dead-parse-adapter-code branch from 2c063eb to 99af280 Compare May 17, 2026 14:18
@serhalp serhalp requested a review from a team May 17, 2026 14:18
@serhalp serhalp added this pull request to the merge queue May 17, 2026
Merged via the queue into main with commit b539c51 May 17, 2026
27 checks passed
@serhalp serhalp deleted the serhalp/refactor/remove-dead-parse-adapter-code branch May 17, 2026 16:30
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.

2 participants