Skip to content

Conversation

@Dhirenderchoudhary
Copy link
Contributor

@Dhirenderchoudhary Dhirenderchoudhary commented Dec 27, 2025

Date: 28 Dec 2025

Developer Name: Dhirender Choudhary


Issue Ticket Number

#2525

Tech Doc Link

https://docs.google.com/document/d/11ydUBODXS1FB_ebxgRxOD6-1wL3lTTBc/edit

Business Doc Link

https://docs.google.com/document/d/1q_AabPkKPpXMbSlp5rR4it5sJBQvI1kI/edit

Description

Removes the dev=true feature flag requirement from the Out-Of-Office (OOO) request creation endpoint (POST /requests), enabling the feature for production use.

Changes Made

  • Removed the req.query.dev === "true" check from controllers/oooRequests.ts.
  • Updated all integration tests in test/integration/requests.test.ts to use the production endpoint /requests instead of /requests?dev=true.
  • Removed the integration test case that validated the 501 Feature not implemented response.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Feature flag has been completely removed.


Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Backward compatible — existing clients sending ?dev=true will continue to work, as the parameter is now ignored.


Development Tested?

  • Yes
  • No

Verified locally using integration tests.


Screenshots

Screenshot 1
Screen.Recording.2025-12-29.at.8.mp4

Test Coverage

Integration Tests Ran yarn test-integration test/integration/requests.test.ts All OOO request tests passed without dev fl
Screen.Recording.2025-12-30.at.1.03.11.AM.mov
Screenshot 2025-12-29 at 9 00 21 PM

Additional Notes

Authorization logic, Discord role checks, and user status validation remain unchanged and fully active.

@coderabbitai
Copy link

coderabbitai bot commented Dec 27, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Removed feature flag gating from OOO request creation controller, enabling the endpoint by default. Updated integration test endpoints from /requests?dev=true to /requests and removed the 501 test case for the disabled feature. Applied minor formatting adjustments across files.

Changes

Cohort / File(s) Summary
OOO Request Feature Flag Removal
controllers/oooRequests.ts
Removed dev query parameter check and notImplemented return in createOooRequestController, enabling OOO creation path by default. Whitespace adjustments around logging and response flows in both createOooRequestController and acknowledgeOooRequestController.
Request Validators Formatting
middlewares/validators/requests.ts
Pure indentation and whitespace adjustments in getRequestsMiddleware, updateRequestsMiddleware, and updateRequestValidator. No logic or validation rule changes.
Integration Tests Endpoint Update
test/integration/requests.test.ts
Changed test endpoint calls from /requests?dev=true to /requests across multiple test cases. Removed test assertion for 501 "Feature not implemented" response. Updated both POST and PATCH test scenarios. Minor formatting adjustments in object spread syntax.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Thump thump! The feature flag has hopped away,
OOO requests run free at last!
Tests now dance on /requests plain,
No more "dev" in the query game,
This bunny celebrates! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title partially refers to the changeset but is unclear and uses vague phrasing. It mentions 'user OOO approve reject' which doesn't accurately describe the main change of removing the dev flag from OOO request creation. Revise the title to be more specific and clear, such as 'Remove dev flag from OOO request creation endpoint' or 'Enable OOO creation endpoint for production use'.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly describes the feature flag removal for OOO creation, lists specific changes made to files, and explains the rationale and testing approach.

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

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
middlewares/validators/requests.ts (1)

84-84: Consider updating or clarifying the TODO comment.

The TODO comment mentions removing the validator once the feature is "tested and ready to be used." Since this PR enables the OOO creation feature by default, you may want to update this comment to clarify that the validator now serves backward compatibility (accepting dev parameter without error) rather than being a temporary measure.

test/integration/requests.test.ts (1)

163-185: Update the test description to reflect current behavior.

The test description states "should create a new request when dev is true", but the endpoint no longer requires or uses the dev flag. Update the description to reflect that this tests standard OOO request creation.

🔎 Suggested fix
-    it("should create a new request when dev is true", function (done) {
+    it("should create a new OOO request", function (done) {
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12f8cdf and 6685c0c.

📒 Files selected for processing (3)
  • controllers/oooRequests.ts
  • middlewares/validators/requests.ts
  • test/integration/requests.test.ts
🧰 Additional context used
🧬 Code graph analysis (1)
controllers/oooRequests.ts (1)
constants/requests.ts (3)
  • OOO_STATUS_ALREADY_EXIST (49-49)
  • REQUEST_ALREADY_PENDING (46-46)
  • ERROR_WHILE_ACKNOWLEDGING_REQUEST (42-42)
🔇 Additional comments (8)
middlewares/validators/requests.ts (2)

54-70: LGTM - Formatting improvements.

The indentation and spacing adjustments improve code readability without affecting the validation logic.


91-91: LGTM - Formatting improvements.

The formatting adjustments maintain consistency and improve readability without changing the validation behavior.

Also applies to: 141-154

test/integration/requests.test.ts (4)

61-61: LGTM - Endpoint updated correctly.

The endpoint constant correctly reflects the production path without the dev flag.


207-207: LGTM - Formatting improvements.

The object spread syntax adjustments maintain consistency without affecting test behavior.

Also applies to: 222-222


339-493: LGTM - Skipped test endpoints updated consistently.

Although these tests are currently skipped, the endpoint URLs have been correctly updated to remove the dev flag, maintaining consistency with the production behavior.


569-569: LGTM - GET endpoint updated correctly.

The endpoint correctly reflects the production path for retrieving all requests.

controllers/oooRequests.ts (2)

41-90: LGTM - OOO creation controller enabled for production use.

The feature flag gating has been successfully removed, enabling the OOO creation endpoint by default. All critical safeguards remain in place:

  • Discord membership authorization check (line 50-52)
  • User status validation (line 55-65)
  • Duplicate pending request check (line 67-79)
  • Comprehensive error handling and logging

The formatting improvements enhance readability without affecting the control flow.


159-182: LGTM - Formatting improvements in acknowledge controller.

The try-catch block formatting adjustments improve code structure while preserving all error handling logic.

Copy link
Member

@MayankBansal12 MayankBansal12 left a comment

Choose a reason for hiding this comment

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

  • please try to improve PR title
  • please use HTTP client like postman to test and provide demo recording as proof
  • please include test run and coverage as well
  • build is failing for one test please fix that
 1) /requests OOO
       GET /requests
         should return all requests:
     Uncaught AssertionError: expected { id: 'jvYQTCnv4hOdHT6aksK8', …(10) } to have property 'state'
      at fn (test/integration/requests.test.ts:576:44)
      at Test.Request.callback (node_modules/superagent/src/node/index.js:913:12)
      at Test.callback (node_modules/newrelic/lib/instrumentation/superagent.js:55:21)
      at fn (node_modules/superagent/src/node/index.js:1166:18)
      at IncomingMessage.<anonymous> (node_modules/superagent/src/node/parsers/json.js:19:7)
      at IncomingMessage.emit (node:events:530:35)
      at IncomingMessage.emit (node:domain:489:12)
      at endReadableNT (node:internal/streams/readable:1698:12)
      at processTicksAndRejections (node:internal/process/task_queues:90:21)

@Dhirenderchoudhary Dhirenderchoudhary changed the title feature flag removed for OOO creation Feature flag removed : user OOO approve reject Dec 28, 2025
.string()
.valid(REQUEST_STATE.APPROVED, REQUEST_STATE.PENDING, REQUEST_STATE.REJECTED)
.optional(),
dev: joi.boolean().optional(),
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we adding dev in schema again, if we want to remove this feature from dev flag.

@iamitprakash iamitprakash merged commit da40cfa into RealDevSquad:develop Dec 31, 2025
3 of 4 checks passed
@MayankBansal12 MayankBansal12 mentioned this pull request Dec 31, 2025
10 tasks
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.

4 participants