Skip to content

[bot] Merge master/253cfe83 into rel/dev - #1765

Merged
yenkins-admin merged 3 commits into
rel/devfrom
snapshot-master-253cfe83-to-rel/dev
Aug 27, 2026
Merged

[bot] Merge master/253cfe83 into rel/dev#1765
yenkins-admin merged 3 commits into
rel/devfrom
snapshot-master-253cfe83-to-rel/dev

Conversation

@yenkins-admin

Copy link
Copy Markdown
Contributor

🚀 Automated PR to perform merge from master into rel/dev with changes up to 253cfe8 (created by https://github.com/gooddata/gooddata-python-sdk/actions/runs/33081399187).

hkad98 and others added 3 commits August 27, 2026 16:11
`CatalogLlmProvider.to_api()` raised `ApiValueError: Invalid value for
`type` (AZURE_FOUNDRY), must be one of ['OPENAI']` for every LLM provider
except one, so `create_llm_provider()` / `update_llm_provider()` were
unusable for OpenAI, AWS Bedrock and Azure Foundry alike (reported against
1.73.0, where the one that worked was Anthropic).

openapi-generator's `python-prior` generator flattens a oneOf's members
into the composed parent model, but for a property that several members
declare it keeps only the *last* member's value. Two things collapse:

  * `allowed_values[('type',)]` holds one member's enum, so the parent
    accepts exactly one variant - and which one depends on the order of
    the oneOf array in the OpenAPI document. That is why the released
    1.73.0 accepted only ANTHROPIC while master accepted only OPENAI:
    the backend had reordered the array, nothing else changed.
  * `openapi_types[prop]` holds one member's class, so the *nested*
    `auth` union could not carry Bedrock or Azure Foundry auth either.

Fixed in the custom templates so it survives regeneration, rather than
in the generated sources or the spec. A spec-side `discriminator` was
ruled out first: v6.6.0 emits the identical collapsed model with and
without one (the existing afm discriminators generate an empty
`discriminator_value_class_map`). Generator v7's `python` generator does
emit a proper `Union`, so this is interim until that migration.

`set_attribute` now validates against the union of the members' types and
enums. This loses no checking - the value is still validated against the
composed schemas by `validate_get_composed_info`; only the parent's bogus
narrowed constraints are widened. `attempt_convert_item` also had to stop
re-raising on the first candidate class when `must_convert` is set, since
a union property has several candidates and the first is not necessarily
the match.

The defect was repo-wide: an audit found 25 collapsed enums and 47
collapsed types across 161 composed models. Fixing it generically retires
the per-site workarounds it has been accumulating, starting with the
`NotificationChannelDestination.allowed_values` monkeypatch removed in the
following commit. Only `model_utils.py` changes in the generated tree.
`CatalogSmtp` and `CatalogDefaultSmtp` had been sitting commented out with a
TODO blaming the generated client:

    # TODO: there is an issue with generated client which causes these two
    # classes to fail. type in declarative_notification_channel_destination.py
    # contains only WEBHOOK as valid value

That was the oneOf-flattening defect fixed in the previous commit, so
`destination` could only ever be a webhook. With the generated composed model
now accepting every member, add the missing destinations and widen the union:

  * CatalogSmtp - custom SMTP server
  * CatalogDefaultSmtp - the platform's own mail server
  * CatalogInPlatform - in-platform notifications

`destination` becomes `CatalogNotificationChannelDestination`, the union the
commented-out code intended.

Also drop the runtime monkeypatch that re-populated
`NotificationChannelDestination.allowed_values[("type",)]`. It treated one
symptom of the same defect from outside the generated client; the template fix
covers every collapsed composed model, so patching class attributes at import
time is no longer needed.

Reading a channel needs an explicit `from_api` rather than cattrs: the four
destination classes have no uniquely-required field to disambiguate a union on
(IN_PLATFORM carries nothing but its type), so dispatch on `type` the way
`_provider_config_from_api` does for LLM providers. It keeps only the fields
each class declares, because the API sends some we do not model - reading a
webhook returns `has_secret_key` - and dropping those matches what cattrs did
before and keeps reads working when the API grows a field.
fix: accept every oneOf variant in generated composed models
@yenkins-admin
yenkins-admin merged commit 405fae9 into rel/dev Aug 27, 2026
1 check passed
@yenkins-admin
yenkins-admin deleted the snapshot-master-253cfe83-to-rel/dev branch August 27, 2026 14:17
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e46b83bf-c98e-4d57-9a32-528e79cd3e91

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.83%. Comparing base (8a7cf06) to head (253cfe8).
⚠️ Report is 567 commits behind head on rel/dev.

Additional details and impacted files
@@             Coverage Diff             @@
##           rel/dev    #1765      +/-   ##
===========================================
+ Coverage    80.65%   80.83%   +0.17%     
===========================================
  Files          272      272              
  Lines        19369    19416      +47     
===========================================
+ Hits         15622    15694      +72     
+ Misses        3747     3722      -25     

☔ View full report in Codecov by Harness.
📢 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.

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