You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mikebridge (via GitHub)" <gi...@apache.org> on 2026/10/08 22:12:20 UTC
[PR] fix(semantic-layer): require write access for configuration schema enrichment [superset]
mikebridge opened a new pull request, #45107:
URL: https://github.com/apache/superset/pull/45107
### SUMMARY
`POST /api/v1/semantic_layer/schema/configuration` returns the JSON Schema for a semantic layer type's configuration form. When the request includes a partial `configuration`, the endpoint parses it and passes it to the provider's `get_configuration_schema`. Some providers use it to call the configured service and fill in choices, for example the available accounts, projects or environments.
That enrichment is part of configuring a layer, so it now requires `can_write` on `SemanticLayer`:
- **Callers with `can_write`:** unchanged. The submitted configuration is parsed and passed to the provider, and they get the enriched schema.
- **Read-only callers (`can_read` only):** they get the static schema, `get_configuration_schema(None)`. The submitted configuration is neither parsed nor passed to the provider.
The endpoint keeps its `read` permission, so read-only users can still load the static form. The response shape is unchanged. The only UI caller is the semantic layer create/edit modal, which already needs write access to save.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A (no UI change for users who can create or edit semantic layers).
### TESTING INSTRUCTIONS
Unit tests:
```bash
pytest tests/unit_tests/semantic_layers/api_test.py -k configuration_schema
```
- `test_configuration_schema_read_only_user_gets_static_schema`: without `can_write`, the provider gets `None` and the configuration is not parsed.
- `test_configuration_schema_writer_gets_enriched_schema`: with `can_write`, the parsed configuration reaches the provider.
- The existing enrichment tests now grant `can_write` explicitly instead of relying on the test fixture.
Manual check, with `SEMANTIC_LAYERS` enabled:
1. As an admin, open **+ Semantic layer**, choose a provider that enriches its form, and fill in the connection fields. The dependent dropdowns populate as before.
2. As a user with `can_read` but not `can_write` on `SemanticLayer`, `POST` the same body to `/api/v1/semantic_layer/schema/configuration`. The response is the static schema.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [x] Required feature flags: `SEMANTIC_LAYERS`
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(semantic-layer): require write access for configuration schema enrichment [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi merged PR #45107:
URL: https://github.com/apache/superset/pull/45107
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(semantic-layer): require write access for configuration schema enrichment [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #45107:
URL: https://github.com/apache/superset/pull/45107#issuecomment-6070062646
@aminghadersohi @rebenitez1802 could you take a look at this when you have a moment? It's a small change to the semantic layer configuration-schema endpoint: enrichment now requires `can_write` on `SemanticLayer`, and read-only callers get the static schema. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(semantic-layer): require write access for configuration schema enrichment [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #45107:
URL: https://github.com/apache/superset/pull/45107#issuecomment-6072285971
## CodeAnt PR Risk: Low Risk
- The PR appears safe to merge; read-only callers receive the static schema without passing submitted configuration to the provider.
- Tests cover both read-only and write-access behavior, including preserving schema enrichment for writers.
**Assessed commit:** `8d51cab080f0`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(semantic-layer): require write access for configuration schema enrichment [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #45107:
URL: https://github.com/apache/superset/pull/45107#issuecomment-6070369395
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/45107?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 79.40%. Comparing base ([`b3d8fdb`](https://app.codecov.io/gh/apache/superset/commit/b3d8fdb60619f1efad9fa404cb277e6537df8ffa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`8d51cab`](https://app.codecov.io/gh/apache/superset/commit/8d51cab080f047f106c2337b729ef10ffd056b0d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #45107 +/- ##
==========================================
- Coverage 82.64% 79.40% -3.24%
==========================================
Files 3007 3007
Lines 187323 187323
Branches 43399 43399
==========================================
- Hits 154812 148750 -6062
- Misses 29744 35631 +5887
- Partials 2767 2942 +175
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/45107/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/45107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `36.18% <0.00%> (ø)` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/45107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/45107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.04% <0.00%> (ø)` | |
| [python](https://app.codecov.io/gh/apache/superset/pull/45107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.32% <100.00%> (-6.13%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/45107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/45107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `79.71% <100.00%> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/45107?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org