Skip to content

[INFRA-392] deployments(fix): rename API key rate limit environment variables to DEFAULT_API_RATE_LIMIT#9141

Open
akshat5302 wants to merge 3 commits into
previewfrom
fix-api-rate-limit-env-rename
Open

[INFRA-392] deployments(fix): rename API key rate limit environment variables to DEFAULT_API_RATE_LIMIT#9141
akshat5302 wants to merge 3 commits into
previewfrom
fix-api-rate-limit-env-rename

Conversation

@akshat5302
Copy link
Copy Markdown
Member

@akshat5302 akshat5302 commented May 26, 2026

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

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Chores
    • Standardized API rate limit configuration across deployments by introducing a default rate-limit setting while preserving the existing per-key limit and the 60 requests/minute default. This aligns environment variables for consistent behavior without changing runtime throttling.

Review Change Stack

Copilot AI review requested due to automatic review settings May 26, 2026 08:36
@akshat5302 akshat5302 requested a review from mguptahub as a code owner May 26, 2026 08:36
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07369b1a-d17e-4bcf-af4c-f406b558949d

📥 Commits

Reviewing files that changed from the base of the PR and between 3a78ba5 and 449cac0.

📒 Files selected for processing (1)
  • deployments/aio/community/variables.env
💤 Files with no reviewable changes (1)
  • deployments/aio/community/variables.env

📝 Walkthrough

Walkthrough

Renames the deployment environment key from API_KEY_RATE_LIMIT to DEFAULT_API_RATE_LIMIT in AIO variables, AIO startup persistence, and the CLI docker-compose anchor; the value and fallback remain ${API_KEY_RATE_LIMIT:-60/minute} / 60/minute.

Changes

Deployment Configuration Update

Layer / File(s) Summary
API rate limit variable rename across deployment configs
deployments/aio/community/variables.env, deployments/aio/community/start.sh, deployments/cli/community/docker-compose.yml
Declaration in variables.env, startup script persistence in start.sh, and x-app-env in docker-compose.yml now use DEFAULT_API_RATE_LIMIT instead of API_KEY_RATE_LIMIT, preserving the 60/minute value and ${API_KEY_RATE_LIMIT:-60/minute} fallback.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny hop across the land,
DEFAULT takes the rate in hand,
Sixty a minute, steady and light,
Keys renamed, the config's right,
A cheerful nibble, soft and bright.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: renaming API rate limit environment variables to DEFAULT_API_RATE_LIMIT across deployment files.
Description check ✅ Passed The description covers the main objective and includes the Type of Change section, but lacks Test Scenarios, Screenshots, and References sections specified in the template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix-api-rate-limit-env-rename

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.

@makeplane
Copy link
Copy Markdown

makeplane Bot commented May 26, 2026

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 .env template and start.sh env 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.

Comment thread deployments/cli/community/docker-compose.yml
Comment thread deployments/aio/community/variables.env
Comment thread deployments/aio/community/start.sh
Copy link
Copy Markdown
Contributor

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9f77ea5 and a256358.

📒 Files selected for processing (3)
  • deployments/aio/community/start.sh
  • deployments/aio/community/variables.env
  • deployments/cli/community/docker-compose.yml

Comment thread deployments/aio/community/start.sh
Comment thread deployments/aio/community/variables.env
Comment thread deployments/cli/community/docker-compose.yml
akshat5302 and others added 2 commits May 26, 2026 14:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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