feat(AF-579): assign review plans to API connectors#585
Merged
Conversation
Parity with SQL/NoSQL datasources: admins can pick a review plan when creating an API connector, change or clear it from connector settings, and the backend validates the plan belongs to the caller's organization. - reviewPlanId on create/update is now resolved via ReviewPlanLookupService and rejected with 404 REVIEW_PLAN_NOT_FOUND when missing or cross-org - new clearReviewPlan flag on the update request (datasource clearAiConfig convention) persists review_plan_id = NULL; null still means unchanged - Review-plan Select (allowClear, loading, 1-approval-default hint) in the connector create modal and settings ConfigTab; i18n keys in all 7 locales - component tests for both pages, service tests for validate/clear paths, and an e2e spec covering assign -> persist -> clear Closes #579
Contributor
Contributor
Coverage Report for Frontend Coverage (frontend)
File CoverageNo changed files found. |
Contributor
Backend Test Results4 646 tests 4 646 ✅ 13m 53s ⏱️ Results for commit 2acc89c. |
Contributor
Backend Code Coverage
|
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 #579
Brings API connectors to parity with SQL/NoSQL datasources for review-plan assignment.
What changed
Frontend
Select(options fromGET /review-plans,allowClear, loading placeholder, and a "no plan → single approval" hint) in the New connector modal (ApiConnectorsListPage) and the settings Config tab (ApiConnectorSettingsPage), mirroring the datasource wizard/settings UX.clear_review_plan: true(UpdateApiConnectorInputinsrc/types/api.ts);review_plan_id: nullkeeps meaning "unchanged" on update.apiGov.connectors.reviewPlan*) translated in all 7 locale files.Backend
DefaultApiConnectorAdminServicenow validatesreviewPlanIdon create and update viaReviewPlanLookupService: a non-existent or cross-org plan id is rejected with404 REVIEW_PLAN_NOT_FOUND(cross-org reads as not-found on purpose).clearReviewPlanflag onUpdateApiConnectorRequest/UpdateApiConnectorCommand(same convention as the datasource update'sclearAiConfig) persistsreview_plan_id = NULL; it wins over areviewPlanIdsent in the same request.Tests
DefaultApiConnectorAdminServiceTest: 9 new cases covering assign/validate/clear/unchanged on create and update.ApiConnectorsListPage.test.tsx(selector renders, selected plan rides the create payload) andApiConnectorSettingsPage.test.tsx(assigned plan shown, submit with/without plan →clear_review_planmapping).e2e/tests/api-governance.spec.ts: assign → persist across reload → clear →review_plan_idNULL via API;createApiConnectorViaApihelper gained an optionalaiAnalysisEnabledknob.Docs updated
docs/04-api-spec.md— review-plan assignment semantics on the connector endpoints (org validation,clearReviewPlan, 1-approval default).docs/06-frontend.md— review-planSelecton the connector settings page + create modal.website/— no change needed:website/docs/index.htmlalready documents "Set the review plan" for API connectors; this PR closes that gap in the app.README.md— unaffected (no setup/tech-stack/feature-list change).Verification
mvn verify -Pcoverage: 4646 tests, 0 failures, JaCoCo gate green (incl.ApplicationModulesTest,ApiPackageDependencyTest).lint(0 errors) +typecheck+test:coverage(94.2% lines / 83.7% branches) +buildgreen.