Use project handle as gateway.api-platform.wso2.com/project-id annotation#2704
Merged
Conversation
thivindu
requested review from
AnuGayan,
Arshardh,
CrowleyRajapakse,
HeshanSudarshana,
HiranyaKavishani,
Krishanx92,
PasanT9,
RakhithaRR,
Tharsanan1,
Thushani-Jayasekera,
VirajSalaka,
ashera96,
chamilaadhi,
dushaniw,
hisanhunais,
lasanthaS,
malinthaprasan,
pubudu538,
renuka-fernando,
senthuran16,
tgtshanika,
tharikaGitHub and
tharindu1st
as code owners
July 15, 2026 13:31
Contributor
📝 WalkthroughWalkthroughGateway examples now carry normalized project annotations. Artifact import context and project resolution use project handles, with regression coverage confirming display names are rejected and handles resolve successfully. ChangesProject Handle Import Resolution
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thushani-Jayasekera
approved these changes
Jul 15, 2026
Thushani-Jayasekera
left a comment
Contributor
There was a problem hiding this comment.
approved since this is a platform api change
Thushani-Jayasekera
requested changes
Jul 15, 2026
Thushani-Jayasekera
left a comment
Contributor
There was a problem hiding this comment.
blocking merging temporally
Thushani-Jayasekera
approved these changes
Jul 16, 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.
Summary
This PR resolve project-scoped artifacts by project handle, not display name
Resolves: #2678
Problem
When a project-scoped artifact (LLM Proxy, MCP Proxy, REST API) is pushed from the gateway to the control plane, the owning project is conveyed via the
gateway.api-platform.wso2.com/project-id annotation. Per the platform's "CRs carry handles" design, this annotation carries the project handle — but the DP→CP import path resolved it against the project display name (GetProjectByNameAndOrgID).As a result, a push with the correct handle (
project-id: default) failed withProjectNotFound, while a push using the display name (Default) coincidentally succeeded. This blocked bottom-up creation of any project-scoped artifact.Approach
ArtifactImportServicenow resolves the owning project viaGetProjectByHandleAndOrgID, so the annotation is interpreted as the project handle. This is the single, shared resolution point, so the fix applies uniformly to all project-scoped kinds (REST API, LLM Proxy, MCP Proxy).ImportContext.ProjectNamefield toProjectHandleand updatedResolveImportProjectdocs/log messages to reflect that the value is a handle, not a display name.Examples
gateway.api-platform.wso2.com/project-id: defaultannotation to every project-scoped example that was missing it (anthropic-openai-proxy, azure-openai-proxy, mistral-openai-proxy, openai-multi-provider-proxy, basic-ratelimit-demo-api, sample-echo-api).Behaviour change
The project-id annotation must now be the project handle. A value matching only the display name (that isn't also the handle) will no longer resolve — this is the intended contract.