Skip to content

fix(mod,deploy): reject private repos with a clear error#119

Merged
EnderOfWorlds007 merged 2 commits into
mainfrom
fix/modable-private-repo-preflight
May 5, 2026
Merged

fix(mod,deploy): reject private repos with a clear error#119
EnderOfWorlds007 merged 2 commits into
mainfrom
fix/modable-private-repo-preflight

Conversation

@EnderOfWorlds007

Copy link
Copy Markdown
Collaborator

Summary

  • dot deploy --modable now fails at preflight with a ModablePreflightError when the configured origin repo is private or missing on GitHub, instead of proceeding and failing cryptically downstream
  • dot mod now surfaces "private or does not exist" instead of the misleading "pin one in metadata.branch" hint when the GitHub API returns 401/404
  • Adds assertPublicGitHubRepo(url, fetch?) to modable.ts — exported and fully unit-tested with injectable fetch
  • Adds fetch? to ResolveRepoOptions so the check is mockable in tests

Root cause

playground-e2e-app.dot was 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 pass
  • assertPublicGitHubRepo: 7 unit tests covering public, private, 404, 401, non-GitHub URL, network error, rate-limit
  • resolveRepositoryUrl: existing test updated to inject mock fetch; new test for private-origin path
  • resolveDefaultBranch: 2 new tests for 404 and 401 API responses

- 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
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Dev build ready — try this branch:

curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/fix/modable-private-repo-preflight bash

@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

E2E Test Pass · ✅ PASS

Tag: e2e-ci-pr · Branch: fix/modable-private-repo-preflight · Commit: c32bba2 · Run logs

Cell Result Time
pr-init-session ✅ PASS 1m14s
pr-preflight ✅ PASS 2m17s
pr-deploy-foundry ✅ PASS 1m26s
pr-mod ✅ PASS 1m18s
pr-install ✅ PASS 1m34s
pr-deploy-frontend ✅ PASS 16m53s
${{ matrix.cell }} ⏭️ SKIP 0m-1s
${{ matrix.cell }} ⏭️ SKIP 0m-1s

Sentry traces: view spans for this run

@EnderOfWorlds007 EnderOfWorlds007 merged commit 88d78d3 into main May 5, 2026
17 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the fix/modable-private-repo-preflight branch May 5, 2026 09:54
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
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