fix(mod,deploy): reject private repos with a clear error#119
Merged
Conversation
- dot deploy --modable now calls assertPublicGitHubRepo during preflight and throws ModablePreflightError for private or missing GitHub repos, preventing the obscure downstream failure - resolveDefaultBranch in dot mod detects 401/404 API responses and surfaces 'private or does not exist' instead of the misleading 'pin one in metadata.branch' hint - Covers both paths with unit tests
Contributor
|
Dev build ready — try this branch: |
Contributor
E2E Test Pass · ✅ PASSTag:
Sentry traces: view spans for this run |
5 tasks
ottovlotto
pushed a commit
that referenced
this pull request
May 5, 2026
* fix(mod,deploy): reject private repos with a clear error message - dot deploy --modable now calls assertPublicGitHubRepo during preflight and throws ModablePreflightError for private or missing GitHub repos, preventing the obscure downstream failure - resolveDefaultBranch in dot mod detects 401/404 API responses and surfaces 'private or does not exist' instead of the misleading 'pin one in metadata.branch' hint - Covers both paths with unit tests * chore: fix biome formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dot deploy --modablenow fails at preflight with aModablePreflightErrorwhen the configured origin repo is private or missing on GitHub, instead of proceeding and failing cryptically downstreamdot modnow surfaces "private or does not exist" instead of the misleading "pin one in metadata.branch" hint when the GitHub API returns 401/404assertPublicGitHubRepo(url, fetch?)tomodable.ts— exported and fully unit-tested with injectable fetchfetch?toResolveRepoOptionsso the check is mockable in testsRoot cause
playground-e2e-app.dotwas registered as modable but its source (paritytech/playground-app) is private. The picker showed it as a valid mod target; clicking through gave a confusing "pin metadata.branch" error. This PR fixes the error surfaces — a separate deploy will fix the fixture data.Test plan
pnpm test— 464 tests passassertPublicGitHubRepo: 7 unit tests covering public, private, 404, 401, non-GitHub URL, network error, rate-limitresolveRepositoryUrl: existing test updated to inject mock fetch; new test for private-origin pathresolveDefaultBranch: 2 new tests for 404 and 401 API responses