Skip to content

fix: make registry project field required for gitlab/github types#97

Open
Dygerydoo wants to merge 1 commit into
betafrom
fix/registry-project-required-for-git-types
Open

fix: make registry project field required for gitlab/github types#97
Dygerydoo wants to merge 1 commit into
betafrom
fix/registry-project-required-for-git-types

Conversation

@Dygerydoo

Copy link
Copy Markdown
Contributor

Summary

  • Use Zod discriminated union in RegistryEntrySchema so project is validated at schema level for gitlab/github types, instead of relying on runtime checks
  • Export narrowed types (ResolvedGitLabRegistry, ResolvedGitHubRegistry, ResolvedDefaultRegistry) so constructors enforce the constraint at compile time
  • Remove runtime null checks in GitLabRegistryClient, GitHubRegistryClient, GitLabRepositoryBrowser, and GitHubRepositoryBrowser
  • Update resolver to return properly narrowed types via switch

Test plan

  • All 610 existing tests pass
  • Added schema tests for rejecting gitlab/github entries without project
  • Added schema tests for accepting default entries without project
  • Removed obsolete runtime-throw tests (now caught by type system)
  • Clean tsc --noEmit

Closes #93

Use Zod discriminated union in RegistryEntrySchema so project is
validated at schema level instead of runtime. Narrow ResolvedRegistry
into typed variants (ResolvedGitLabRegistry, ResolvedGitHubRegistry,
ResolvedDefaultRegistry) so constructors enforce the constraint at
compile time, eliminating runtime null checks.

Closes #93
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