Skip to content

EDM-3217: ImageBuilder API must receive org_id#473

Open
celdrake wants to merge 1 commit intoflightctl:mainfrom
celdrake:EDM-3217-imagebuilder-org-id
Open

EDM-3217: ImageBuilder API must receive org_id#473
celdrake wants to merge 1 commit intoflightctl:mainfrom
celdrake:EDM-3217-imagebuilder-org-id

Conversation

@celdrake
Copy link
Collaborator

@celdrake celdrake commented Feb 4, 2026

The UI was not passing the org_id query parameter to ImageBuilder API.
So it only worked when the user had access to just 1 organization.

Summary by CodeRabbit

  • Refactor
    • Improved API request handling logic for organization identification with enhanced path routing conditions and clearer conditional flow for specific API endpoints.

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

Walkthrough

Updated middleware request routing logic in the organization proxy middleware. Refactored path validation checks by introducing an isImageBuilderAPICall() helper function and restructured shouldAddOrgIDFromHeader() to conditionally gate behavior behind isFlightCtlAPICall() checks with explicit exclusions for specific organization and auth config endpoints.

Changes

Cohort / File(s) Summary
Middleware Organization Logic
proxy/middleware/organization.go
Consolidated path validation by extracting isImageBuilderAPICall() helper; expanded shouldAddOrgIDFromHeader() with isFlightCtlAPICall() gates and added exclusions for /api/flightctl/api/v1/organizations and /api/flightctl/api/v1/auth/config; updated org_id addition logic to include alerts and image builder API calls.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'EDM-3217: ImageBuilder API must receive org_id' directly describes the main change: adding org_id parameter to ImageBuilder API calls.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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