Skip to content

chore: drop min success default#1111

Merged
adityachoudhari26 merged 2 commits intomainfrom
drop-min-success-default
May 7, 2026
Merged

chore: drop min success default#1111
adityachoudhari26 merged 2 commits intomainfrom
drop-min-success-default

Conversation

@adityachoudhari26
Copy link
Copy Markdown
Member

@adityachoudhari26 adityachoudhari26 commented May 6, 2026

fixes #1071

Summary by CodeRabbit

API Changes

  • Added new minimum soak time field to environment progression rule configuration
  • Made minimum success percentage optional by removing its default value

Copilot AI review requested due to automatic review settings May 6, 2026 20:34
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@adityachoudhari26 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 35 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eb149eeb-bda9-475c-929d-fa2b5da587f8

📥 Commits

Reviewing files that changed from the base of the PR and between 4e83d9f and dcc3056.

📒 Files selected for processing (7)
  • apps/api/src/routes/v1/workspaces/policies.ts
  • apps/web/app/api/openapi.ts
  • apps/workspace-engine/oapi/openapi.json
  • apps/workspace-engine/oapi/spec/schemas/policy.jsonnet
  • e2e/api/schema.ts
  • e2e/tests/api/policies/policies.spec.ts
  • packages/workspace-engine-sdk/src/schema.ts
📝 Walkthrough

Walkthrough

The PR modifies the OpenAPI schema for EnvironmentProgressionRule to remove the default value of minimumSuccessPercentage, making it optional, and introduces a new minimumSoakTimeMinutes field. This resolves Terraform provider inconsistencies where the field was unexpectedly populated with defaults.

Changes

EnvironmentProgressionRule Schema Update

Layer / File(s) Summary
Schema Definition
apps/api/openapi/schemas/policies.jsonnet
minimumSuccessPercentage default of 100 is removed, making the field optional.
OpenAPI Specification
apps/api/openapi/openapi.json
minimumSoakTimeMinutes field is added; minimumSuccessPercentage loses its default attribute.
TypeScript Types
apps/api/src/types/openapi.ts
minimumSuccessPercentage property signature changes from required (number) to optional (number?).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • ctrlplanedev/ctrlplane#973: Related schema modifications for EnvironmentProgressionRule handling of minimumSoakTimeMinutes and backward compatibility.

Poem

🐰 No defaults to surprise,
Just schemas that are wise,
Now optional fields flow,
And Terraform's fears go!
Soak time blooms anew

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: drop min success default' directly and clearly summarizes the main change: removing the default value from the minimumSuccessPercentage field.
Linked Issues check ✅ Passed The changes directly address issue #1071 by removing the default value (100) from minimumSuccessPercentage, preventing the provider from introducing an unintended default that caused Terraform drift errors.
Out of Scope Changes check ✅ Passed All changes are in-scope modifications to the EnvironmentProgressionRule schema (adding minimumSoakTimeMinutes field and removing the default from minimumSuccessPercentage) directly related to fixing the reported Terraform provider issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch drop-min-success-default

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

Removes the OpenAPI default for EnvironmentProgressionRule.minimumSuccessPercentage so generated clients/providers don’t implicitly write 100 when the user leaves the field unset (addressing Terraform provider “inconsistent result after apply” behavior from #1071).

Changes:

  • Dropped the default: 100 from the OpenAPI schema for minimumSuccessPercentage.
  • Regenerated the published OpenAPI document to reflect the schema change.
  • Regenerated openapi-typescript typings so minimumSuccessPercentage is no longer required.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
apps/api/src/types/openapi.ts Regenerated OpenAPI TS types; minimumSuccessPercentage becomes optional.
apps/api/openapi/schemas/policies.jsonnet Removed default: 100 from the minimumSuccessPercentage schema.
apps/api/openapi/openapi.json Regenerated OpenAPI JSON output with the default removed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 182 to 188
dependsOnEnvironmentSelector: {
type: 'string',
description: 'CEL expression to match the environment(s) that must have a successful release before this environment can proceed.',
},

minimumSuccessPercentage: { type: 'number', format: 'float', minimum: 0, maximum: 100, default: 100 },
minimumSuccessPercentage: { type: 'number', format: 'float', minimum: 0, maximum: 100 },
successStatuses: { type: 'array', items: openapi.schemaRef('JobStatus') },
Comment on lines 186 to 188

minimumSuccessPercentage: { type: 'number', format: 'float', minimum: 0, maximum: 100, default: 100 },
minimumSuccessPercentage: { type: 'number', format: 'float', minimum: 0, maximum: 100 },
successStatuses: { type: 'array', items: openapi.schemaRef('JobStatus') },
},

minimumSuccessPercentage: { type: 'number', format: 'float', minimum: 0, maximum: 100, default: 100 },
minimumSuccessPercentage: { type: 'number', format: 'float', minimum: 0, maximum: 100 },
@adityachoudhari26 adityachoudhari26 merged commit 117e472 into main May 7, 2026
14 checks passed
@adityachoudhari26 adityachoudhari26 deleted the drop-min-success-default branch May 7, 2026 17:35
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.

Terraform provider policy soak test issues

3 participants