Skip to content

fix(projects): resolve IntegrationHarbor projectIdRef - #458

Open
henrysachs wants to merge 1 commit into
masterfrom
fix/project-harbor-resolve-references
Open

henrysachs wants to merge 1 commit into
masterfrom
fix/project-harbor-resolve-references

Conversation

@henrysachs

@henrysachs henrysachs commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Description of your changes

Fixes #446

Why

Project IntegrationHarbor has projectIdRef and projectIdSelector, but no ResolveReferences. A resource that set only the ref kept an empty projectId.

What changed

  • Add IntegrationHarbor.ResolveReferences in apis/namespaced/projects/v1alpha1/referencers.go. It matches the other project kinds, such as IntegrationMattermost.
  • Regenerate the cluster-scoped copy (apis/cluster/projects/v1alpha1/zz_referencers.go).
  • Add a ResolveReferences unit test with a mock reader, plus its generated cluster copy.

Scope

Only IntegrationHarbor was missing a resolver. Every other kind with *Ref fields under apis/{namespaced,cluster}/{groups,projects,instance} has one. Some are hand-written in referencers.go. Others are generated in zz_generated.resolvers.go from +crossplane:generate:reference markers: AccessToken, DeployKey, PipelineSchedule, ProjectShareGroup, ProtectedBranch, ProtectedEnvironment.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Verification

  • go build ./..., go test ./apis/... ./pkg/{namespaced,cluster}/controller/projects/integrationharbor/..., and golangci-lint on apis/{namespaced,cluster}/projects all pass. go generate -tags generate ./apis/... leaves no diff.
  • The new test fails to compile without the fix because ResolveReferences is undefined. With the fix it passes.
  • Live test on kind with GitLab 19.4. I applied a Group, a Project, and an IntegrationHarbor that set only projectIdRef. projectId resolved to the project ID (654778), and the resource became Ready and Synced. GET /projects/654778/integrations/harbor returned active: true with the configured url, project_name, and username. After delete, the integration showed active: false and empty properties.

Signed-off-by: Henry Sachs <henry.sachs@deutschebahn.com>
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.

bug(projects): IntegrationHarbor projectIdRef is never resolved

1 participant