Skip to content

chore(openapi-codegen): drop spec post-processing workarounds and regenerate client#1594

Merged
jaceksan merged 2 commits into
masterfrom
jacek/DX-346-remove-openapi-codegen-workarounds
May 11, 2026
Merged

chore(openapi-codegen): drop spec post-processing workarounds and regenerate client#1594
jaceksan merged 2 commits into
masterfrom
jacek/DX-346-remove-openapi-codegen-workarounds

Conversation

@jaceksan
Copy link
Copy Markdown
Contributor

Summary

Upstream gdc-nas shipped DX-346, which cleans two shapes in the OpenAPI spec that previously forced this repo to carry Makefile + jq + Python post-processing around openapi-generator-cli:

  1. DeclarativeColumn.name no longer carries the NUL-rejecting regex pattern. The constraint moved to a runtime Bean Validation annotation, so the JSON unicode-zero escape stops leaking into the spec.
  2. Springdoc sealed-interface oneOf parents no longer emit a redundant child-to-parent allOf ref, breaking the cycle that crashed openapi-generator-cli v6.6.0 with StackOverflowError in recursiveGetDiscriminator.

This PR:

  • Drops the corresponding workarounds in Makefile: the NUL-stripping tr, the jq cycle-break on DashboardCompoundComparisonCondition and DashboardCompoundRangeCondition, and the scripts/postprocess_api_client.py regex repair call.
  • Deletes the now-dead scripts/postprocess_api_client.py.
  • Repoints make api-client STAGING=1 from demo-cicd (production) to staging.dev-latest.stg11.panther.intgdc.com (actual staging). The previous URL silently regenerated against production and would re-introduce the workarounds.
  • Regenerates the API client against staging with the workarounds removed (separate commit). The regenerated client picks up the spec drift: DeclarativeColumn.name loses its regex validation block (constraint now in the field description), and a new DeclarativeIpAllowlistPolicy model is exposed under DeclarativeOrganization.

Test plan

  • make api-client STAGING=1 completes with no StackOverflowError from openapi-generator-cli.
  • No NUL escapes in the merged spec after regen.
  • python -c "import gooddata_api_client; from gooddata_api_client import models" reports import OK.
  • Live staging spec verified clean across metadata, scan, automation, export, afm, result.
  • CI lint + type-check + unit tests pass on the regenerated client.

JIRA: DX-346
risk: low

jaceksan added 2 commits May 11, 2026 13:35
Upstream gdc-nas (DX-346) cleaned the OpenAPI spec so the regen pipeline no longer needs local repairs:

- Drop the NUL-stripping `tr` after the jq merge — `DeclarativeColumn.name` no longer carries a `^[^NUL]*$` pattern that leaked literal NUL bytes through jq decoding.
- Drop the jq cycle-break on `DashboardCompoundComparisonCondition` / `DashboardCompoundRangeCondition` — Springdoc no longer emits the redundant child-to-parent `allOf: [{$ref: ...}]` that crashed openapi-generator-cli v6.6.0 with StackOverflowError in `recursiveGetDiscriminator`.
- Drop the `scripts/postprocess_api_client.py` invocation and delete the script — it only existed to repair regex patterns mangled by the now-absent NUL escape.
- Repoint `make api-client STAGING=1` from `demo-cicd.cloud.gooddata.com` (production) to `staging.dev-latest.stg11.panther.intgdc.com` (actual staging). The previous URL silently regenerated against production and would re-introduce the workarounds.

Verified by regenerating the client against staging with the workarounds removed: no StackOverflowError, no NUL bytes in the merged spec, no mangled regex in the generated Python.

JIRA: DX-346
risk: low
Regenerate `gooddata-api-client` against `staging.dev-latest.stg11.panther.intgdc.com` after the DX-346 spec cleanup landed there. Run with the previous commit's slimmed-down `_api-client-generate` (no NUL stripping, no jq cycle-break, no postprocess script) to confirm the workarounds are no longer needed.

Notable spec drift picked up incidentally:

- `DeclarativeColumn.name`: drops the `regex` validation block; the NUL constraint is now carried in the field description (`Must not contain NUL (0x00) characters.`).
- New `DeclarativeIpAllowlistPolicy` model exposed under `DeclarativeOrganization` (added on staging since the previous regen).

JIRA: DX-346
risk: low
@jaceksan jaceksan requested review from hkad98, lupko and pcerny as code owners May 11, 2026 11:36
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.96%. Comparing base (88138a3) to head (194436f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1594   +/-   ##
=======================================
  Coverage   78.96%   78.96%           
=======================================
  Files         231      231           
  Lines       15578    15578           
=======================================
  Hits        12301    12301           
  Misses       3277     3277           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jaceksan jaceksan enabled auto-merge May 11, 2026 11:49
@jaceksan jaceksan merged commit dff0a00 into master May 11, 2026
12 checks passed
@jaceksan jaceksan deleted the jacek/DX-346-remove-openapi-codegen-workarounds branch May 11, 2026 11:50
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