Skip to content

feat(QTDI-2862): add watch() attribute to @FixedSchema for dynamic schema refresh#1256

Open
thboileau wants to merge 3 commits into
masterfrom
copilot/QTDI-2862_fixed-schema-watch
Open

feat(QTDI-2862): add watch() attribute to @FixedSchema for dynamic schema refresh#1256
thboileau wants to merge 3 commits into
masterfrom
copilot/QTDI-2862_fixed-schema-watch

Conversation

@thboileau

@thboileau thboileau commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Requirements

  • Any code change adding any logic MUST be tested through a unit test executed with the default build
  • Any API addition MUST be done with a documentation update if relevant

Why this PR is needed?

@FixedSchema currently 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 new watch() attribute on @FixedSchema declares 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-apiFixedSchema.java

  • New String[] watch() default {}; attribute with Javadoc documenting the relative path syntax (same as @Updatable.parameters()).

component-runtime-managerComponentSchemaEnricher.java

  • New constant FIXED_SCHEMA_WATCH_META_PREFIX = "tcomp::ui::schema::fixed::watch".
  • When fixedSchema.watch().length > 0, emits the comma-separated path list under that key in the component metadata.

component-runtime-managerComponentSchemaEnricherTest.java

  • New test: @FixedSchema(value="discover", watch={"config/param"}) → key emitted.
  • Regression test: plain @FixedSchema without watch → key absent.

component-toolsFixedSchemaValidator.java

  • New validation: if watch() is non-empty and value() is empty → build-time error.

component-toolsFixedSchemaValidatorTest.java

  • Test covering the new validation error.

sample-parent/sample-features/fixed-schemaFixedSchemaInput.java

  • Added watch = {"configuration/someConfig"} to the sample to demonstrate the feature.

Build: mvn clean verify passes 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

  • this PR has been written with the help of GitHub Copilot or another generative AI tool

…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.
@thboileau

Copy link
Copy Markdown
Contributor Author

Scope & Design Review — QTDI-2862

# Severity File Description Resolution
1 MINOR ComponentSchemaEnricherTest.java fixedSchemaMetadataWithoutWatchDoesNotEmitWatchKey() was a complete duplicate of fixedSchemaMetadataNoFlowPresent() FIXED — removed redundant test
2 MINOR ComponentSchemaEnricher.java Constant FIXED_SCHEMA_WATCH_META_KEY used _KEY suffix inconsistent with existing _PREFIX peers FIXED — renamed to FIXED_SCHEMA_WATCH_META_PREFIX

Approval gate: APPROVED — no Blocker or Major findings. 2 Minors resolved.


Signed: Claude Sonnet 4.6

@thboileau

Copy link
Copy Markdown
Contributor Author

Compliance Report — QTDI-2862

Files reviewed: 7

File Findings
.gitignore None — pre-existing line
FixedSchema.java None
ComponentSchemaEnricher.java None
ComponentSchemaEnricherTest.java None
FixedSchemaValidator.java None
FixedSchemaValidatorTest.java None
FixedSchemaInput.java None

Verdict: COMPLIANT — 0 critical findings, 0 warnings.


Signed: Claude Sonnet 4.6

@sonar-rnd

sonar-rnd Bot commented Jul 17, 2026

Copy link
Copy Markdown

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.

1 participant