feat(QTDI-2862): add watch() attribute to @FixedSchema for dynamic schema refresh - #1256
feat(QTDI-2862): add watch() attribute to @FixedSchema for dynamic schema refresh#1256thboileau wants to merge 5 commits into
Conversation
…hema refresh - Add String[] watch() attribute to @FixedSchema annotation in component-api to declare parameter paths that trigger schema refresh at design time. - Emit 'tcomp::ui::schema::fixed::watch' metadata key in ComponentSchemaEnricher when watch() is non-empty (comma-joined paths, mirrors FIXED_SCHEMA_FLOWS_META_PREFIX). - Add FixedSchemaValidator check: watch() non-empty with empty value() is an error. - Add unit tests for both ComponentSchemaEnricher and FixedSchemaValidator. - Update fixed-schema sample to demonstrate the watch() attribute.
Scope & Design Review — QTDI-2862
Approval gate: APPROVED — no Blocker or Major findings. 2 Minors resolved. Signed: Claude Sonnet 4.6 |
Compliance Report — QTDI-2862Files reviewed: 7
Verdict: COMPLIANT — 0 critical findings, 0 warnings. Signed: Claude Sonnet 4.6 |
| "Annotation's value must match the name of a DiscoverSchema or a DiscoverSchemaExtended annotation. " + | ||
| "The related action will return the fixed schema for the specified flows.") | ||
| "The related action will return the fixed schema for the specified flows. " + | ||
| "Use watch() to declare parameter paths whose changes should trigger a schema refresh at design time.") |
There was a problem hiding this comment.
It looks like that we need to update the documentation of the framework (cf "documentation" root directory of this repository)
There was a problem hiding this comment.
Fixed in 20da2fb3eb0 — added a "Watching parameters for schema refresh" subsection to documentation/src/main/antora/modules/ROOT/pages/studio-schema.adoc documenting the watch() attribute, with a code example mirroring the sample-features/fixed-schema usage.
Add a "Watching parameters for schema refresh" subsection to studio-schema.adoc documenting the new @FixedSchema.watch() attribute, mirroring the sample-features/fixed-schema usage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Review round 1 — summary
Fixes pushed: Rebased on Round summary generated by AI. Please resolve threads after verifying the fixes. |
|

0 New Issues
0 Fixed Issues
0 Accepted Issues
Requirements
Why this PR is needed?
@FixedSchemacurrently provides no way to trigger a schema refresh when a related configuration parameter changes value. Snowflake works around this with a hardcoded special-case in Studio. QTDI-2862 generalises the mechanism: a newwatch()attribute on@FixedSchemadeclares which configuration paths should trigger a re-discovery, removing the need for connector-specific hacks.Jira ticket: QTDI-2862
What does this PR adds (design/code thoughts)?
component-api—FixedSchema.javaString[] watch() default {};attribute with Javadoc documenting the relative path syntax (same as@Updatable.parameters()).component-runtime-manager—ComponentSchemaEnricher.javaFIXED_SCHEMA_WATCH_META_PREFIX = "tcomp::ui::schema::fixed::watch".fixedSchema.watch().length > 0, emits the comma-separated path list under that key in the component metadata.component-runtime-manager—ComponentSchemaEnricherTest.java@FixedSchema(value="discover", watch={"config/param"})→ key emitted.@FixedSchemawithoutwatch→ key absent.component-tools—FixedSchemaValidator.javawatch()is non-empty andvalue()is empty → build-time error.component-tools—FixedSchemaValidatorTest.javasample-parent/sample-features/fixed-schema—FixedSchemaInput.javawatch = {"configuration/someConfig"}to the sample to demonstrate the feature.Build:
mvn clean verifypasses on all affected modules (component-api, component-runtime-manager, component-tools, sample-features/fixed-schema). Spotless applied.AI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code