Skip to content

feat(groups,projects): accept the full path as external-name - #411

Open
ahauserv wants to merge 3 commits into
crossplane-contrib:masterfrom
ahauserv:feat/path-external-name
Open

ahauserv wants to merge 3 commits into
crossplane-contrib:masterfrom
ahauserv:feat/path-external-name

Conversation

@ahauserv

@ahauserv ahauserv commented Sep 18, 2026

Copy link
Copy Markdown

Description of your changes

I want to declare observe-only Group and Project resources for cases where only the full path is known, not the numeric ID.

  • A numeric crossplane.io/external-name is still the ID.
  • A non-numeric one is sent to the lookup as the full path. Update and Delete already passed the annotation through unchanged, so only the check in Observe is removed.
  • The annotation is not rewritten to the ID. A Composition re-applies the annotation on every reconcile, so any value the provider wrote would be reverted and, with LateInitialize, loop.

Note

GitLab follows its redirect routes for renamed projects, so a project lookup by the old path keeps working. It does not for groups; an observe-only group renamed in GitLab needs its annotation updated. A fully managed group is renamed back by drift correction anyway.

Fixes #318

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

  • Unit tests for both controllers cover the path lookup and assert the annotation is left as set.
  • Verified against GitLab 19.3.2-ee with a scratch group and project that both are found by full path, and that the old path still resolves for a renamed project but not for a renamed group.

Observe rejected any external-name that was not a numeric ID, so an
observe-only Group could not be declared when only the path was known.
GitLab's GET /groups/:id accepts the URL-encoded full path as well, and
Update and Delete already pass the external-name through unchanged.

Pass the external-name to the lookup as it is. The annotation is not
rewritten to the ID: a Composition re-applies the annotation on every
reconcile, so any value the provider wrote would be reverted.

Refs crossplane-contrib#318

Signed-off-by: ahauser <andreas.hauser@vector.com>
Apply the same lookup as for groups: a non-numeric external-name is sent
to GET /projects/:id as the full path. GitLab follows its redirect routes
for projects, so the lookup keeps working after a rename.

Refs crossplane-contrib#318

Signed-off-by: ahauser <andreas.hauser@vector.com>
Observe-only Group and Project examples show the path form.

Fixes crossplane-contrib#318

Signed-off-by: ahauser <andreas.hauser@vector.com>
@ahauserv
ahauserv force-pushed the feat/path-external-name branch from b2ce50c to c44f431 Compare September 22, 2026 09:50
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.

Support GitLab group resource with full path

1 participant