chore: regenerate api-client, fix local docker stack, environment-agnostic VCR cassettes#1507
Open
chore: regenerate api-client, fix local docker stack, environment-agnostic VCR cassettes#1507
Conversation
e81ff59 to
c5db746
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1507 +/- ##
==========================================
+ Coverage 77.32% 78.18% +0.85%
==========================================
Files 227 228 +1
Lines 14768 14930 +162
==========================================
+ Hits 11420 11673 +253
+ Misses 3348 3257 -91 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
hkad98
reviewed
Apr 2, 2026
hkad98
reviewed
Apr 2, 2026
hkad98
reviewed
Apr 2, 2026
tychtjan
added a commit
that referenced
this pull request
Apr 2, 2026
Address PR #1507 review comments: - Add client_secret and private_key_passphrase to _ENV_SPECIFIC_BODY_FIELDS - Switch from stdlib json to orjson for faster JSON processing - Add _normalization_configured guard to prevent silent no-op recording risk: low
tychtjan
added a commit
that referenced
this pull request
Apr 2, 2026
Address PR #1507 review comments: - Add client_secret and private_key_passphrase to _ENV_SPECIFIC_BODY_FIELDS - Switch from stdlib json to orjson for faster JSON processing - Add _normalization_configured guard to prevent silent no-op recording risk: low
Regenerate gooddata-api-client from latest staging OpenAPI spec. Add parameters field to CatalogDeclarativeAnalyticsLayer. risk: low
- Use duration strings for api-gw cache config (60 -> 1m) - Persist DS password after layout upload via entities PATCH - Fix _patch_ds_credentials to fall back to test_config ds_password risk: low
Add normalization to vcrpy_utils.py so cassettes recorded from staging or local docker-compose produce identical files. configure_normalization() reads active test config and builds string replacements (longest-first) for host, org_id, org_name, ds_url, ds_password, result hashes, createdAt timestamps, and proxy headers. Normalization runs only during recording (before_record_* callbacks); playback is unaffected. risk: low
…tion All gooddata-sdk cassettes re-recorded from staging with normalization active. Cassettes contain only canonical localhost:3000 / default values. Expected JSON fixtures updated to match current API responses. risk: low
jaceksan
requested changes
Apr 7, 2026
| X-Requested-With: | ||
| - XMLHttpRequest | ||
| method: POST | ||
| uri: http://localhost:3000/api/v1/actions/workspaces/demo/execution/afm/execute |
Contributor
There was a problem hiding this comment.
Double-checking - is this URI normalized, so when running against staging, it is not changed?
| - no-cache, no-store, max-age=0, must-revalidate | ||
| Content-Length: | ||
| - '3913' | ||
| - '1128' |
Contributor
There was a problem hiding this comment.
Do we want to normalize this field too?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the SDK in sync with latest staging: regenerated api-client, added a new feature field, fixed the local docker-compose stack, fixed data source credential handling, and made VCR cassettes fully environment-agnostic so they produce identical files whether recorded from local or staging.
1. Remove accidental Pydantic v2 model files
Cleans up Pydantic v2 model files that were accidentally committed and don't belong in the codebase.
2. Regenerate api-client and add parameters field
Re-generates
gooddata-api-clientfrom the latest staging OpenAPI spec, picking up new endpoints and schema changes. Addsparametersfield toCatalogDeclarativeAnalyticsLayer.3. Fix docker-compose api-gw config and DS credential handling
api-gwECR image switched to Kotlin duration parsing — bare numbers like60are no longer accepted. ChangedCACHE_EXPIRE_AFTER_WRITEandUSER_CACHE_EXPIRE_AFTER_WRITEfrom60to1m. Without this fix,api-gwcrashes on startup._patch_ds_credentialsfixture to fall back totest_config["ds_password"]when the env var is absent.4. Environment-agnostic VCR cassette normalization
Core change —
vcrpy_utils.pynow normalizes all environment-specific values during cassette recording so that cassettes recorded from staging or local docker-compose produce identical files.What
configure_normalization()doesCalled at session start from
conftest.py, it reads the active test config and builds a list of string replacements (longest-first to prevent partial matches):https://python-sdk-dex.dev-latest.stg11.panther.intgdc.comhttp://localhost:3000python-sdk-dex.dev-latest.stg11.panther.intgdc.comlocalhostPython SDK DexDefault Organizationpython-sdk-dexdefaultWhen running against local, the replacements list is empty (no-op).
Where normalization is applied
custom_before_request): staging host →http://localhost:3000custom_before_request): org_id, org_name in JSON payloadscustom_before_response): handles bothbytesandstrbody types (VCR passesbyteswithdecode_compressed_response=True)custom_before_response):Locationheaders containing org_id pathscreatedAttimestamps replaced with canonical value,ds_passwordnormalized via context-aware regex (handles both orjson compact and stdlib spaced JSON), proxy headers strippedKey implementation details
bytes, notstr— the normalization decodes, replaces, and re-encodesmatch_on, custom serializer, and body matcher are unchangedbefore_record_*callbacks); playback is unaffected5. Re-record all cassettes from staging
All gooddata-sdk, gooddata-fdw, and gooddata-pandas cassettes re-recorded from staging with normalization active. The cassettes contain only canonical
localhost:3000/defaultvalues.tests-supportThe
tests-supportpackage is installed as a wheel in tox environments. When modifyingvcrpy_utils.py(or any file intests-support), you must clear the caches before running tests, otherwise tox will use the stale installed version:This is also documented in the
configure_normalization()docstring.Files changed
packages/tests-support/src/tests_support/vcrpy_utils.py—configure_normalization(), request/response/header normalizationpackages/gooddata-sdk/tests/conftest.py— callsconfigure_normalization(config)at session startpackages/gooddata-sdk/tests/**/*.yaml— all SDK cassettes re-recorded with normalized valuespackages/gooddata-fdw/tests/**/*.yaml— fdw cassettes re-recordedpackages/gooddata-pandas/tests/**/*.yaml— pandas cassettes re-recordedTest plan
make testpasses all tests against local stack (normalization is no-op)make test-stagingpasses all 364 tests against staging (cassettes recorded with normalization)python-sdk-dex,stg11.panther, orPython SDK Dexin cassettes (excludinggd_test_config.yaml)JIRA: TRIVIAL
risk: low