Skip to content

[ENG-346] Add required variable to staging settings#3658

Merged
vigneshhari merged 1 commit into
developfrom
ENG-346-treat-staging-as-production
May 20, 2026
Merged

[ENG-346] Add required variable to staging settings#3658
vigneshhari merged 1 commit into
developfrom
ENG-346-treat-staging-as-production

Conversation

@vigneshhari
Copy link
Copy Markdown
Member

@vigneshhari vigneshhari commented May 20, 2026

ENG-346

Summary by CodeRabbit

  • Chores
    • Updated staging environment configuration to enable production mode behavior, ensuring staging environment aligns with production settings.

Review Change Stack

@vigneshhari vigneshhari requested a review from a team as a code owner May 20, 2026 07:12
@vigneshhari vigneshhari merged commit c95a6d6 into develop May 20, 2026
8 of 10 checks passed
@vigneshhari vigneshhari deleted the ENG-346-treat-staging-as-production branch May 20, 2026 07:12
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ef5ec259-1911-4901-a848-e6af43bae818

📥 Commits

Reviewing files that changed from the base of the PR and between 96913a3 and 1d77625.

📒 Files selected for processing (1)
  • config/settings/staging.py

📝 Walkthrough

Walkthrough

The PR adds an explicit IS_PRODUCTION flag set to True in the staging settings module. This single-line addition enables production-mode behavior for the staging environment configuration.

Changes

Staging Production Mode Configuration

Layer / File(s) Summary
Production mode flag for staging
config/settings/staging.py
IS_PRODUCTION is set to True, enabling production-mode behavior in staging settings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ENG-346-treat-staging-as-production

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

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 20, 2026

Greptile Summary

This PR adds IS_PRODUCTION = True to the staging settings file so that staging behaves consistently with the production environment for features gated by this flag.

  • With this flag set, the OTP login flow will generate a real random OTP (instead of the hardcoded \"45612\") when USE_SMS is False on staging, and the load_fixtures management command will be blocked from running on staging.
  • As a side effect, the Swagger UI and API schema endpoints (/swagger/, /api/schema/) will no longer be mounted on staging since config/urls.py guards them with not settings.IS_PRODUCTION.

Confidence Score: 4/5

Safe to merge; the one-line addition is correct and intentional, with a minor side effect on developer tooling worth confirming.

The change is a single flag addition that aligns staging with production behavior. The notable side effect is that Swagger/API schema endpoints will silently disappear from staging after this lands, which could inconvenience developers — worth a quick confirmation before merging.

config/settings/staging.py — confirm the Swagger endpoint loss on staging is acceptable.

Important Files Changed

Filename Overview
config/settings/staging.py Adds IS_PRODUCTION = True to staging settings; side effect is that Swagger/API schema endpoints are hidden on staging and the load_fixtures management command is blocked

Reviews (1): Last reviewed commit: "Add required variable to staging setting..." | Re-trigger Greptile

# Your stuff...
# ------------------------------------------------------------------------------

IS_PRODUCTION = True
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Swagger/API schema docs disabled on staging

In config/urls.py, the swagger and API schema endpoints are only mounted when settings.DEBUG or not settings.IS_PRODUCTION. With IS_PRODUCTION = True now set here (and DEBUG typically False in staging), those endpoints will no longer be accessible on the staging environment. If developers rely on the staging Swagger UI for API exploration, this will break that workflow. This may be intentional, but it's worth confirming.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 75.54%. Comparing base (5b01692) to head (1d77625).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
config/settings/staging.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3658      +/-   ##
===========================================
+ Coverage    75.46%   75.54%   +0.07%     
===========================================
  Files          479      479              
  Lines        22984    22985       +1     
  Branches      2375     2375              
===========================================
+ Hits         17344    17363      +19     
+ Misses        5068     5051      -17     
+ Partials       572      571       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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