routes updated for org-policy in project-service#344
Conversation
WalkthroughAdds six new route definitions for project service endpoints under organizationExtension and admin, updates the dev interface routes JSON accordingly, and bumps elevate-project package version from 1.1.47 to 1.1.48. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant G as API Gateway/Router
participant P as elevate-project (project service)
rect rgb(240,248,255)
note right of G: New routes
C->>G: POST /project/v1/organizationExtension/eventListener
G->>P: POST /project/v1/organizationExtension/eventListener
P-->>G: Response
G-->>C: Response
end
rect rgb(245,255,240)
note right of G: Update (POST/PATCH)
C->>G: POST /project/v1/organizationExtension/update[:id]
G->>P: POST /project/v1/organizationExtension/update[:id]
P-->>G: Response
G-->>C: Response
C->>G: PATCH /project/v1/organizationExtension/update[:id]
note over G,P: Target mapped as POST to service
G->>P: POST /project/v1/organizationExtension/update[:id]
P-->>G: Response
G-->>C: Response
end
rect rgb(255,250,240)
note right of G: Admin
C->>G: POST /project/v1/admin/updateRelatedOrgs
G->>P: POST /project/v1/admin/updateRelatedOrgs
P-->>G: Response
G-->>C: Response
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
interface-routes/elevate-dev-routes.json (3)
13673-13685: Add internal rate limiting to event listener.This looks like a backend-triggered webhook; expose it as internal to avoid public abuse.
"targetPackages": [ { "basePackageName": "project", "packageName": "elevate-project" } ], - "service": "project" + "service": "project", + "rateLimit": { "type": "internal" } }
13743-13755: Make admin endpoint internal.Align with existing org-admin/updateRelatedOrgs route (mentoring block uses internal). Add internal rate limit.
"targetPackages": [ { "basePackageName": "project", "packageName": "elevate-project" } ], - "service": "project" + "service": "project", + "rateLimit": { "type": "internal" } }
13687-13713: Confirm dual-method “update” endpoints
Both POST and PATCH routes are defined for/project/v1/organizationExtension/updateand/project/v1/organizationExtension/update/:id(each PATCH is forwarded as a POST inelevate-project/constants/routes.js). Ensure this dual-method setup is intentional (e.g. for backward compatibility) — otherwise remove redundant entries or document the rationale.elevate-project/constants/routes.js (2)
3255-3273: PATCH entries forward to POST — confirm intent or align targetRoute.type to PATCH.If method translation is intentional, no change needed. If the project service supports PATCH on these endpoints, align targetRoute.type for consistency.
Apply if PATCH is supported downstream:
- type: "POST" + type: "PATCH"Apply the above to both targetRoute blocks for:
- /project/v1/organizationExtension/update
- /project/v1/organizationExtension/update/:id
3225-3283: Optional: addorchestrated: falsefor consistency with nearby routes.Property is optional per past discussions, but adding it here keeps style uniform with most entries in this file.
{ sourceRoute: "/project/v1/organizationExtension/eventListener", type: "POST", inSequence: false, + orchestrated: false, targetRoute: { path: "/project/v1/organizationExtension/eventListener", type: "POST" }, service: "project" }, { sourceRoute: "/project/v1/organizationExtension/update", type: "POST", inSequence: false, + orchestrated: false, targetRoute: { path: "/project/v1/organizationExtension/update", type: "POST" }, service: "project" }, { sourceRoute: "/project/v1/organizationExtension/update/:id", type: "POST", inSequence: false, + orchestrated: false, targetRoute: { path: "/project/v1/organizationExtension/update/:id", type: "POST" }, service: "project" }, { sourceRoute: "/project/v1/organizationExtension/update", type: "PATCH", inSequence: false, + orchestrated: false, targetRoute: { path: "/project/v1/organizationExtension/update", type: "POST" }, service: "project" }, { sourceRoute: "/project/v1/organizationExtension/update/:id", type: "PATCH", inSequence: false, + orchestrated: false, targetRoute: { path: "/project/v1/organizationExtension/update/:id", type: "POST" }, service: "project" }, { sourceRoute: "/project/v1/admin/updateRelatedOrgs", type: "POST", inSequence: false, + orchestrated: false, targetRoute: { path: "/project/v1/admin/updateRelatedOrgs", type: "POST" }, service: "project" }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
elevate-project/constants/routes.js(1 hunks)elevate-project/package.json(1 hunks)interface-routes/elevate-dev-routes.json(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-05T09:46:50.071Z
Learnt from: MallanagoudaB
PR: ELEVATE-Project/utils#329
File: elevate-project/constants/routes.js:0-0
Timestamp: 2025-08-05T09:46:50.071Z
Learning: In the elevate-project/constants/routes.js file, the `orchestrated` property is not compulsory for all route configurations. Out of 293 total routes, 33 routes (about 11%) exist without this property, making it optional rather than required.
Applied to files:
interface-routes/elevate-dev-routes.jsonelevate-project/constants/routes.js
📚 Learning: 2025-08-05T09:46:50.071Z
Learnt from: MallanagoudaB
PR: ELEVATE-Project/utils#329
File: elevate-project/constants/routes.js:0-0
Timestamp: 2025-08-05T09:46:50.071Z
Learning: In the elevate-project/constants/routes.js file, the `orchestrated` property is not compulsory for all route configurations. Many routes exist without this property, making it optional rather than required.
Applied to files:
interface-routes/elevate-dev-routes.jsonelevate-project/constants/routes.js
🔇 Additional comments (9)
elevate-project/package.json (2)
3-3: Version bump LGTM.1.1.47 → 1.1.48 is fine for the new routes exposure.
1-18: Routes additions confirmed consistent. constants/routes.js and elevate-dev-routes.json align on methods and paths, PATCH sources correctly map to POST upstream.interface-routes/elevate-dev-routes.json (3)
13687-13741: Naming consistency check: organizationExtension vs organization-extensions.Other services (SCP) use “organization-extensions” (hyphen, plural). Confirm this casing/slug is intentional for project to avoid future confusion.
13673-13755: LGTM overall – routes wired to elevate-project with consistent flags.Priority/inSequence/orchestrated and targetPackages look consistent with the rest of the project service routes.
13715-13741: No changes needed for PATCH→POST mapping: elevate-project’s routes.js maps the new PATCH sourceRoutes to its existing POST handlers, so these endpoints will resolve correctly.elevate-project/constants/routes.js (4)
3225-3233: Event listener route wiring looks correct.Source and target paths/methods align; service selection matches existing patterns.
3235-3253: POST update routes are consistent with existing project service conventions.Mirrors other “update” endpoints that use POST in this file.
3275-3283: Admin route addition looks good.Naming and placement are consistent with existing admin routes.
3225-3283: Cross-file routes alignment verified. All six constants (eventListener, update POST, update PATCH, update/:id POST, update/:id PATCH, updateRelatedOrgs) appear exactly once each inelevate-dev-routes.json, with update and update/:id each having one POST and one PATCH entry.
| { | ||
| "name": "elevate-project", | ||
| "version": "1.1.47", | ||
| "version": "1.1.48", |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Confirm publish/tag before merge.
Ensure 1.1.48 isn’t already on npm and is ready to publish.
🏁 Script executed:
#!/bin/bash
# Check latest published version
npm view elevate-project version
# Show all published versions (optional)
npm view elevate-project versions --json | jq '.[-10:]'Length of output: 129
Bump package.json version to 1.1.49
Version 1.1.48 is already published on npm; update the “version” field in elevate-project/package.json to 1.1.49 before merging.
🤖 Prompt for AI Agents
In elevate-project/package.json around line 3, the package version is still
"1.1.48" but 1.1.48 is already published; update the "version" field to "1.1.49"
so the package.json reflects the next release before merging.
Summary by CodeRabbit
New Features
Chores