Skip to content

routes updated for org-policy in project-service#344

Merged
aks30 merged 1 commit intomasterfrom
chore/utils-routes-update-2
Sep 9, 2025
Merged

routes updated for org-policy in project-service#344
aks30 merged 1 commit intomasterfrom
chore/utils-routes-update-2

Conversation

@Prajwal17Tunerlabs
Copy link
Copy Markdown
Collaborator

@Prajwal17Tunerlabs Prajwal17Tunerlabs commented Sep 8, 2025

Summary by CodeRabbit

  • New Features

    • Added API endpoints under /project/v1/organizationExtension:
      • POST /eventListener
      • POST/PATCH /update
      • POST/PATCH /update/:id
    • Added admin endpoint: POST /project/v1/admin/updateRelatedOrgs
    • These routes are now available for client use.
  • Chores

    • Version bump to 1.1.48.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Sep 8, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary
Project service route constants
elevate-project/constants/routes.js
Appends 6 routes: organizationExtension eventListener (POST), update (POST, PATCH), update/:id (POST, PATCH), and admin/updateRelatedOrgs (POST). All set inSequence: false. PATCH entries target POST at the service.
Interface routes (dev)
interface-routes/elevate-dev-routes.json
Adds corresponding 6 route entries for the elevate-project package with priority MUST_HAVE, inSequence false, orchestrated false, service project.
Package version bump
elevate-project/package.json
Version updated 1.1.47 → 1.1.48.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • VISHNUDAS-tunerlabs

Poem

In corridors of routes we hop along,
New paths mapped true, steady and strong.
POSTs and PATCHes, a tidy array,
The project burrow guides the way.
Version ticks up—thump, thump, hooray! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/utils-routes-update-2

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/update and /project/v1/organizationExtension/update/:id (each PATCH is forwarded as a POST in elevate-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: add orchestrated: false for 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

📥 Commits

Reviewing files that changed from the base of the PR and between f458e5e and 2dfe997.

📒 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.json
  • elevate-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.json
  • elevate-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 in elevate-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",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.

@aks30 aks30 merged commit 17ec9d7 into master Sep 9, 2025
1 check passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 16, 2025
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.

2 participants