Skip to content

fix(webapp): allow divisors of 60 for API_RATE_LIMIT_METRICS_BUCKET_SECONDS - #4993

Closed
StackedByAdit wants to merge 1 commit into
triggerdotdev:mainfrom
StackedByAdit:fix/api-rate-limit-metrics-bucket-validation
Closed

StackedByAdit wants to merge 1 commit into
triggerdotdev:mainfrom
StackedByAdit:fix/api-rate-limit-metrics-bucket-validation

Conversation

@StackedByAdit

Copy link
Copy Markdown

Closes #4983

## Checklist

- [x] I have followed every step in the [contributing guide](https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md)
- [x] The PR title follows the convention.
- [x] I ran and tested the code works

---

## Testing

1. **Regression tests in `apps/webapp/test/env.server.test.ts`**:
   - Added unit and regression test coverage for `API_RATE_LIMIT_METRICS_BUCKET_SECONDS`.
   - Verified that `15` and `120` are accepted, default `10` is preserved, and invalid values (`7`, `0`, `-10`, `15.5`, `"not-a-number"`) are rejected.      
   - Ran `npx vitest --no-file-parallelism ./test/env.server.test.ts --run --test-timeout=15000` (all 30 tests passed).

2. **Aggregator tests in `apps/webapp/test/apiRateLimitMetricsAggregator.test.ts`**:
   - Ran `npx vitest --no-file-parallelism ./test/apiRateLimitMetricsAggregator.test.ts --run` (all 17 tests passed).

3. **Typecheck & Linting**:
   - Ran `pnpm run typecheck --filter webapp` (passed with 0 errors).
   - Ran `pnpm run lint` (`oxlint` passed with 0 errors/warnings).
   - Verified formatting via `oxfmt`.

---

## Changelog

Allow divisors of 60 (such as `15`) and multiples of 60 for `API_RATE_LIMIT_METRICS_BUCKET_SECONDS` by removing the overly restrictive `.multipleOf(10)`     

constraint from the environment schema.

---

## Screenshots

N/A (backend environment schema change)

@changeset-bot

changeset-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e54f808

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Hi @StackedByAdit, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Oct 2, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Self-hosted configuration fix lacks release note

Self-hosted operators can now configure 15-second metrics buckets, but this fix has no new server release note. The release-note guidance calls for one when users would notice a server-only fix.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 20ef3d1f-1362-4206-82f2-b83658e86df0

📥 Commits

Reviewing files that changed from the base of the PR and between c3b0a24 and e54f808.

📒 Files selected for processing (3)
  • apps/webapp/app/env.server.ts
  • apps/webapp/test/env.server.test.ts
  • docs/self-hosting/env/webapp.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

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.

bug: webapp rejects API_RATE_LIMIT_METRICS_BUCKET_SECONDS=15 although the schema says divisors of 60 are valid

1 participant