Skip to content

fix(docs): openapi labels for different bulk api variants#4223

Open
carderne wants to merge 1 commit into
mainfrom
fix/bulk-openapi-spec-nit
Open

fix(docs): openapi labels for different bulk api variants#4223
carderne wants to merge 1 commit into
mainfrom
fix/bulk-openapi-spec-nit

Conversation

@carderne

Copy link
Copy Markdown
Collaborator

Replace Option 1 Option 2 etc with labelled variants.

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2f3ec47

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

@carderne carderne marked this pull request as ready for review July 10, 2026 10:58
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Updated CreateBulkActionRequestBody in the OpenAPI schema with explicit cancel and replay variants. Cancel requests now require either a filter or run IDs alongside action: cancel. Replay requests similarly require either a filter or run IDs alongside action: replay; filter-based replay also supports an optional targetRegion. Existing run ID array constraints are retained.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is far too brief and misses required sections like issue closure, checklist, testing, changelog, and screenshots. Add the full template sections, including issue reference, checklist items, testing steps, changelog summary, and screenshots or a note that none are needed.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title matches the main change: labeling bulk-action OpenAPI variants more clearly.
✨ 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/bulk-openapi-spec-nit

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.

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
docs/v3-openapi.yaml (1)

4828-4903: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add additionalProperties: false to each oneOf variant for stricter validation.

The upstream Zod schema uses .refine() to enforce exactly one of filter or runIds, and z.never() to reject targetRegion on cancel. Without additionalProperties: false, the OpenAPI oneOf variants will:

  • Match multiple variants when both filter and runIds are present (both validate as extra properties are allowed), causing ambiguous oneOf resolution.
  • Accept targetRegion on cancel variants (it would be an extra property), contradicting the Zod z.never() constraint.

Adding additionalProperties: false to each variant aligns the OpenAPI schema with the runtime validation behavior.

♻️ Proposed fix — add additionalProperties: false to all four variants
     CreateBulkActionRequestBody:
       oneOf:
         - title: Cancel by filter
           type: object
+          additionalProperties: false
           required:
             - action
             - filter
           properties:
             action:
               type: string
               enum:
                 - cancel
             filter:
               $ref: "`#/components/schemas/BulkActionFilter`"
             name:
               type: string
               maxLength: 255
         - title: Cancel by run IDs
           type: object
+          additionalProperties: false
           required:
             - action
             - runIds
           properties:
             action:
               type: string
               enum:
                 - cancel
             runIds:
               type: array
               minItems: 1
               maxItems: 500
               items:
                 type: string
             name:
               type: string
               maxLength: 255
         - title: Replay by filter
           type: object
+          additionalProperties: false
           required:
             - action
             - filter
           properties:
             action:
               type: string
               enum:
                 - replay
             filter:
               $ref: "`#/components/schemas/BulkActionFilter`"
             name:
               type: string
               maxLength: 255
             targetRegion:
               type: string
               description: Region identifier to replay runs in. When omitted, each replay keeps the original run's region.
         - title: Replay by run IDs
           type: object
+          additionalProperties: false
           required:
             - action
             - runIds
           properties:
             action:
               type: string
               enum:
                 - replay
             runIds:
               type: array
               minItems: 1
               maxItems: 500
               items:
                 type: string
             name:
               type: string
               maxLength: 255
             targetRegion:
               type: string
               description: Region identifier to replay runs in. When omitted, each replay keeps the original run's region.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d3d9cb7c-e693-46de-96ad-72397b8327ec

📥 Commits

Reviewing files that changed from the base of the PR and between b4866f0 and 2f3ec47.

📒 Files selected for processing (1)
  • docs/v3-openapi.yaml
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: code-quality / code-quality
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (1)
**/{Dockerfile*,*.{yml,yaml}}

📄 CodeRabbit inference engine (AGENTS.md)

When updating Docker image references, always use multiplatform/index digests rather than architecture-specific digests.

Files:

  • docs/v3-openapi.yaml
🔇 Additional comments (2)
docs/v3-openapi.yaml (2)

4830-4854: Variant titles and required selectors align well with the upstream Zod contract.

The four oneOf variants correctly split cancel/replay by filter/run-IDs with appropriate required fields, matching the discriminated union and refinement logic in the Zod schema. The targetRegion field is correctly omitted from cancel variants and included only in replay variants, consistent with z.never().optional() vs z.string().optional().

Also applies to: 4864-4881


4855-4863: 🗄️ Data Integrity & Integration

maxItems: 500 matches the runtime limit

BULK_ACTION_MAX_RUN_IDS defaults to 500, so the OpenAPI schema matches the route handler.

			> Likely an incorrect or invalid review comment.

@kathiekiwi kathiekiwi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍 👍

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