Skip to content

superseded: OpenAPI adopt recovery / classifier / drift (split) - #52

Closed
carlostasada wants to merge 4 commits into
mainfrom
ctasada/harden-openapi
Closed

superseded: OpenAPI adopt recovery / classifier / drift (split)#52
carlostasada wants to merge 4 commits into
mainfrom
ctasada/harden-openapi

Conversation

@carlostasada

@carlostasada carlostasada commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Superseded

This branch was split into a smaller review stack. Please review and merge in order:

  1. fix: harden OpenAPI adopt recovery and pin-forced regenerate #53 — adopt recovery + pin-forced regenerate + enum additive
  2. fix: refine OpenAPI semantic diff and adopt status JSON #54 — semantic diff refinements + openapi-adopt-status.json (stacks on fix: harden OpenAPI adopt recovery and pin-forced regenerate #53)
  3. ci: open one OpenAPI adopt PR instead of breaking issues #55 — one-PR drift workflow instead of breaking issues (stacks on fix: refine OpenAPI semantic diff and adopt status JSON #54)

Backup tip: 2ddd5fe on ctasada/harden-openapi (also refs/backup/pre-split-* locally).

Closing this PR to avoid duplicate review; the stacked PRs carry the full change set.

Treat additive enum widenings as non-breaking, and make failed adopt regeneration restore pins then regenerate from specs/ so partial syncs cannot leave pins and generated sources out of step.
@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown

Greptile Summary

The PR reclassifies additive enum values as non-breaking and adds rollback-and-regeneration handling for failed OpenAPI adoption. It also broadens SpotBugs coverage, hardens JaCoCo XML parsing, and centralizes spec downloads.

  • Adds recursive enum-widening classification for schemas and inline operation definitions.
  • Backs up pins during adoption and attempts to restore and regenerate after generation failures.
  • Expands build-quality coverage and adds focused tests and documentation.

Confidence Score: 4/5

The spec-override propagation must be fixed before merging because adoption can succeed while generated sources do not correspond to the newly committed pins.

The nested regeneration forwards spec-source properties even though successful generation clears the only rollback marker, allowing overridden inputs to produce committed sources that disagree with the adopted specifications.

Files Needing Attention: build-logic/src/main/groovy/alpaca.openapi-generation.gradle

Important Files Changed

Filename Overview
build-logic/src/main/groovy/alpaca.openapi-generation.gradle Adds adoption rollback orchestration, but the initial regeneration forwards spec overrides and can clear the backup after generating from the wrong source.
scripts/adopt_openapi.py Adds transactional pin writes, manual restoration, and recovery regeneration with focused unit coverage.
scripts/openapi_tools.py Folds additive enum values out of surface comparisons and collects inline operation enums for reporting.
build-logic/src/main/groovy/markets/alpaca/gradle/OpenApiSpecSupport.groovy Centralizes HTTP spec loading with status checks, request headers, timeouts, and empty-download rejection.
build-logic/src/main/groovy/alpaca.testing.gradle Disables external entity and DTD loading while retaining support for JaCoCo's DOCTYPE.
build-logic/src/main/groovy/alpaca.quality.gradle Replaces the handwritten-class allowlist with an exclusion limited to generated OpenAPI classes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Apply adopted pins] --> B[Create pin backup]
  B --> C[Forward Gradle project properties]
  C --> D[Nested generateApis]
  D --> E{Spec override present?}
  E -- No --> F[Generate from adopted specs]
  E -- Yes --> G[Generate from overridden source]
  F --> H[Delete pin backup]
  G --> H
  H --> I[Nested tests]
Loading

Fix All in Cursor

Reviews (1): Last reviewed commit: "fix: harden OpenAPI adopt recovery and e..." | Re-trigger Greptile

Comment thread build-logic/src/main/groovy/alpaca.openapi-generation.gradle Outdated
carlostasada and others added 3 commits August 10, 2026 13:06
Drop brokerSpec/dataSpec/tradingSpec when nesting generateApis after
adopt, and force pin paths so overrides cannot leave generated sources
out of sync with specs/.
Treat allOf member growth as breaking while keeping oneOf/anyOf additive,
compare pin drift structurally, ensure triage labels exist before applying,
and land the one-PR drift workflow with classifier false-positive fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@carlostasada carlostasada changed the title fix: harden OpenAPI adopt recovery and enum classification superseded: OpenAPI adopt recovery / classifier / drift (split) Aug 10, 2026
@carlostasada

Copy link
Copy Markdown
Contributor Author

Superseded by the stacked split: #53#54#55. Closing to keep review focused.

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.

1 participant