[INFRA-392] deployments(fix): rename API key rate limit environment variables to DEFAULT_API_RATE_LIMIT#9141
[INFRA-392] deployments(fix): rename API key rate limit environment variables to DEFAULT_API_RATE_LIMIT#9141akshat5302 wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughRenames the deployment environment key from ChangesDeployment Configuration Update
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
There was a problem hiding this comment.
Pull request overview
This PR aims to standardize the API key throttling environment variable name in deployment artifacts by renaming API_KEY_RATE_LIMIT to DEFAULT_API_RATE_LIMIT.
Changes:
- Renames the API rate limit variable in the CLI community
docker-compose.yml. - Renames the API rate limit variable in the AIO community
.envtemplate andstart.shenv generation logic.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| deployments/cli/community/docker-compose.yml | Renames the container env var to DEFAULT_API_RATE_LIMIT in the shared app env block. |
| deployments/aio/community/variables.env | Updates the AIO env template to use DEFAULT_API_RATE_LIMIT. |
| deployments/aio/community/start.sh | Updates env file generation to write DEFAULT_API_RATE_LIMIT. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deployments/aio/community/start.sh`:
- Line 152: The call to update_env_value currently only honors
API_KEY_RATE_LIMIT and ignores the new DEFAULT_API_RATE_LIMIT input and runtime
checks still read API_KEY_RATE_LIMIT; update the invocation of update_env_value
for DEFAULT_API_RATE_LIMIT so it prefers the new DEFAULT_API_RATE_LIMIT env var
but falls back to API_KEY_RATE_LIMIT and then the hardcoded default (e.g.
DEFAULT_API_RATE_LIMIT ->
${DEFAULT_API_RATE_LIMIT:-${API_KEY_RATE_LIMIT:-60/minute}}), and update runtime
checks to read DEFAULT_API_RATE_LIMIT first with API_KEY_RATE_LIMIT as a
backward-compatible fallback (or export API_KEY_RATE_LIMIT from DEFAULT when
DEFAULT is present) so existing non-default throttles are preserved; touch the
update_env_value call and any runtime references to
API_KEY_RATE_LIMIT/DEFAULT_API_RATE_LIMIT to implement this.
In `@deployments/aio/community/variables.env`:
- Line 50: The env var was renamed to DEFAULT_API_RATE_LIMIT but the runtime
still reads API_KEY_RATE_LIMIT; add a compatibility export so both names exist
at runtime (e.g., set API_KEY_RATE_LIMIT to the same value as
DEFAULT_API_RATE_LIMIT) so apps/api/plane/api/rate_limit.py continues to pick up
configured limits; update the variables.env entry to export both
DEFAULT_API_RATE_LIMIT and API_KEY_RATE_LIMIT (or add an assignment that
forwards DEFAULT_API_RATE_LIMIT into API_KEY_RATE_LIMIT) to ensure backward
compatibility.
In `@deployments/cli/community/docker-compose.yml`:
- Line 58: Export the API_KEY_RATE_LIMIT env var in Compose as well as
DEFAULT_API_RATE_LIMIT so CLI deployments read the expected key; update the
environment block where DEFAULT_API_RATE_LIMIT is defined to also set
API_KEY_RATE_LIMIT (mirror the same default value) so API throttling that reads
API_KEY_RATE_LIMIT honors custom limits until the backend lookup is migrated.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 187d0a0e-7e81-4498-ac58-7f294dafda84
📒 Files selected for processing (3)
deployments/aio/community/start.shdeployments/aio/community/variables.envdeployments/cli/community/docker-compose.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Description
This pull request standardizes the naming of the API key rate limit environment variable across deployment scripts and configuration files. The variable name has been changed from `API_KEY_RATE_LIMIT` to `DEFAULT_API_RATE_LIMIT` to improve clarity and consistency.Type of Change
Summary by CodeRabbit