Skip to content

feat(QTDI-2862): Add watch() attribute to @FixedSchema#1255

Closed
thboileau wants to merge 1 commit into
masterfrom
copilot/QTDI-2862_fixed-schema-watch
Closed

feat(QTDI-2862): Add watch() attribute to @FixedSchema#1255
thboileau wants to merge 1 commit 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?

QTDI-2862 — The @FixedSchema annotation currently offers no way to tell Studio which configuration parameters should trigger an automatic schema refresh. Without this, Studio cannot know when the fixed schema may have changed (e.g. when the user selects a different dataset or changes a connection URL), and the schema is never refreshed dynamically.

What does this PR add (design/code thoughts)?

Adds a new optional watch() attribute to @FixedSchema accepting parameter path strings in the same dot-notation as @Updatable#parameters().

  • component-apiFixedSchema.java: new String[] watch() default {} attribute with Javadoc.
  • component-runtime-managerComponentSchemaEnricher.java: new constant FIXED_SCHEMA_WATCH_META_PREFIX = "tcomp::ui::schema::fixed::watch". When watch() is non-empty, the enricher emits the comma-joined paths under this key. When empty (default), the key is not emitted — full backward compatibility.
  • ComponentSchemaEnricherTest.java: 3 new unit tests covering single path, multiple paths (comma-joined), and empty watch() (key absent).
  • studio-schema.adoc: documents all three @FixedSchema attributes in a reference table.

Studio-side wiring (ElementParameterCreator + IValueChangedListener) is out of scope for this PR and will be handled in a follow-up ticket in the Studio repository.

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

Add a new optional watch() attribute to @FixedSchema that accepts
parameter path strings (same dot-notation as @updatable#parameters()).

When set, ComponentSchemaEnricher emits the comma-joined paths under
the metadata key tcomp::ui::schema::fixed::watch so Studio can
trigger an automatic schema refresh when a watched parameter changes.

When watch() is empty (default), the key is not emitted, preserving
full backward compatibility.

Closes QTDI-2862
Co-Authored-By: AI Tool <ai@noreply>
@thboileau

Copy link
Copy Markdown
Contributor Author

Scope & Design Review — QTDI-2862

Verdict: ✅ No findings — implementation matches spec exactly.

Scope check

  • All changes are confined to the 4 files listed in the plan: FixedSchema.java, ComponentSchemaEnricher.java, ComponentSchemaEnricherTest.java, studio-schema.adoc.
  • No Studio-side wiring attempted (correctly deferred to follow-up).
  • Backward compatibility preserved: watch() defaults to {} → key not emitted when empty.

Design check

  • Metadata key tcomp::ui::schema::fixed::watch follows the established tcomp::ui::schema::* naming convention.
  • Path format (dot-notation, comma-joined) is consistent with @Updatable#parameters() / FIXED_SCHEMA_FLOWS_META_PREFIX.
  • No validation of paths against declared @Options — intentionally out of scope (same posture as @Updatable).

Compliance check

  • ✅ No wildcard imports
  • ✅ Spotless applied before commit
  • ✅ No new Sonar-triggerable patterns (no unused params, no generic catches, no public on @Test)
  • ✅ Javadoc present on new API method
  • ✅ Documentation updated

Generated by GitHub Copilot agent — 2026-07-17

@thboileau thboileau closed this Jul 17, 2026
@thboileau
thboileau deleted the copilot/QTDI-2862_fixed-schema-watch branch July 17, 2026 13:17
@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