refactor: use provider name as canonical DB foreign key#190
Merged
Conversation
Replace the type/host compound key (e.g. github/github.com) with the
user-configured provider name (e.g. github, internal-github) as the
canonical identifier stored in all provider FK columns.
Provider names are unique by YAML map key constraint, stable across
hostname changes, and human-readable — removing the need for the
type/host compound key entirely.
Changes:
- GitProxyProvider.getProviderId() now returns getName()
- ProviderRegistry.resolveProvider() simplified; type/host fallback removed
- JettyConfigurationBuilder: removed seenProviderIds conflict map (redundant),
updated error messages and Javadocs
- ProfileController + UserController: removed provider.replace('@', '/') decode
- api.ts: removed providerToPathKey function and its two call sites
- scripts/migrate-provider-ids.sql: one-off UPDATE script for existing installs
- Tests: updated all provider ID assertions, removed backwards-compat test,
added two tests for same-type multi-provider (github + internal-github)
closes #188
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
scan-action downloads grype's install.sh from main at runtime and passes
the version directly — the script constructs releases/{version} URLs
which 404 for non-latest versions. Pre-install our checksum-verified
binary first so scan-action uses the PATH binary instead.
Same broken pattern as container-scan.yml — scan-action was downloading grype's install.sh from main which constructs invalid release tag URLs. Pre-install our checksum-verified binary first, drop grype-version.
This was referenced May 3, 2026
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.
closes #188
Summary
Provider FK refactor:
GitProxyProvider.getProviderId()now returnsgetName()instead oftype/hostProviderRegistry.resolveProvider()simplified —type/hostfallback removedJettyConfigurationBuilder: removed redundant duplicate-detection map, updated error messagesProfileController+UserController: removed theprovider.replace('@', '/')decode hackapi.ts: removedproviderToPathKeyand its call sites — provider names are safe in URL path segmentsgithub+internal-githubsharingtype=githubwith different hostnames)Container scan fixes (both workflows):
anchore/scan-actionruns — dropsgrype-versionso scan-action uses the PATH binary instead of downloading grype'sinstall.shfrom main (which constructs invalid release tag URLs and 404s)container-scan.ymlanddocker-publish.ymldocker-publish.yml: removed the brokenfind /opt/hostedtoolcache/grypestep that was silently failingData migration (run before deploying)
The following SQL renames existing
type/hostvalues to provider names. Adjust pairs to match yourgit-proxy.yml.To find what's currently stored:
For a standard single-GitHub deployment (
github/github.com→github):For additional providers repeat the block with the appropriate pair (e.g.
gitlab/gitlab.com→gitlab). A parameterised template is inscripts/migrate-provider-ids.sql.Test plan
./gradlew test)push_records.providershowsgithub(notgithub/github.com)@encoding in URLlatestis only updated after scan clears