Skip to content

fix(sourcehut): parse web urls on instance root host - #266

Merged
serhalp merged 2 commits into
mainfrom
serhalp/fix/sourcehut-meta-host
Nov 1, 2026
Merged

serhalp merged 2 commits into
mainfrom
serhalp/fix/sourcehut-meta-host

Conversation

@serhalp

@serhalp serhalp commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

N/A

🧭 Context

Bare https://sr.ht/~foo/bar is a valid alias for https://git.sr.ht/~foo/bar, but we weren't handling it.

Caught while integrating forges into npmx.

🧪 Testing

Added unit tests

📚 Docs

Added a note about it


Play the walkthrough    Follow each request

@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
forges.link Ready Ready Preview Nov 1, 2026 4:37pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c76a137b-1f77-4804-9196-5f3892abf536
Commits

Reviewing files that changed from the base of the PR and between 7d36d6c and 8d1e823.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0c44b2e5-9e07-48bd-98b2-6d0c9c949de1
Commits

Reviewing files that changed from the base of the PR and between beed311 and 7d36d6c.

Files selected for processing: 3
  • docs/content/4.providers/sourcehut.md
  • src/sourcehut/web.ts
  • test/unit/sourcehut.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

Sourcehut repository URLs on the instance root now use the existing parser. Profile URLs on that root remain unparsed. Repository URL generation continues to use the Git service host.

Changes

Sourcehut instance-root URL parsing

Layer / File(s) Summary
Instance-root parsing and coverage
src/sourcehut/web.ts, test/unit/sourcehut.test.ts, docs/content/4.providers/sourcehut.md
The host list includes the instance root. Tests cover repository parsing, profile URL handling, and Git host URL generation. The documentation describes these behaviours.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • danielroe/forges#259: Changes Sourcehut instance derivation and passes the instance into sourcehutWeb.

Suggested reviewers: danielroe

Merge Risk: Minimal · previous review 7d36d

The SourceHut URL alias behavior is implemented and documented consistently, with no actionable merge-blocking risk identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: parsing SourceHut web URLs on the instance root host.
Description check Passed The description explains the SourceHut URL alias issue and mentions the added tests and documentation. It is directly related to the changeset.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@serhalp
serhalp marked this pull request as ready for review November 1, 2026 15:31
@pkg-pr-new

pkg-pr-new Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/danielroe/forges@266

commit: 8d1e823

@coldtea-pr-lens

coldtea-pr-lens Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
  • Redraw · drawn at 7d36d6c, the branch has moved on

Architecture

Architecture diagram for danielroe/forges at 7d36d6c

Play the walkthrough


Data flow

Data flow diagram for danielroe/forges at 7d36d6c

Follow each request


Tip

Open a diagram on the canvas, then press W or click play to walk through the change one step at a time

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture… row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion
  • Set github.description: false in .github/pr-lens.yml to stop PR Lens adding buttons to your PR descriptions

Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.  Star PR Lens on GitHub

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Bundle size

Browser entry bundles compared with the PR base. All sizes are in bytes. Lazy totals the minified chunks besides the entry, which load on demand or never.

Bundle Minified Gzip Lazy
forges 4,065 1,793 49,285
forges/github 139,467 42,308 29,906
forges/gitlab 100,703 31,241 10,042
forges/tangled 95,724 31,260 11,766
forges/gitea 97,604 30,074 8,414
forges/bitbucket 76,014 24,249 3,936
forges/web 8,148 3,481 0

Size changes are informational. pnpm test:size checks entry chunks for webhook translation, and the provider-free bundle against its budget.

Measured for 7d36d6c109fb12715523005d4031340c4af8b499.

@serhalp
serhalp enabled auto-merge (squash) November 1, 2026 16:35
@serhalp
serhalp merged commit 1f95983 into main Nov 1, 2026
17 of 18 checks passed
@serhalp
serhalp deleted the serhalp/fix/sourcehut-meta-host branch November 1, 2026 16:37
@github-actions github-actions Bot mentioned this pull request Nov 1, 2026

This branch was successfully deployed

1 active deployment
Preview — 8d1e8232 Deployed Nov 1, 2026 by vercel[bot]
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