Skip to content

[FLINK-39042][webui] Port timezone-aware watermark timestamps to release-2.1#28092

Open
featzhang wants to merge 1 commit intoapache:release-2.1from
featzhang:backport/FLINK-39042-release-2.1
Open

[FLINK-39042][webui] Port timezone-aware watermark timestamps to release-2.1#28092
featzhang wants to merge 1 commit intoapache:release-2.1from
featzhang:backport/FLINK-39042-release-2.1

Conversation

@featzhang
Copy link
Copy Markdown
Member

What is the purpose of the change

Port PR #27552 (FLINK-39042) from master to release-2.1. Makes watermark timestamps in the Web UI timezone-aware and user-configurable: the Watermarks drawer now shows a timezone selector populated from Intl.supportedValuesOf('timeZone'), defaulting to the browser's local IANA zone, and the datetime pipe honours the selection (DST handled automatically via the Intl API).

Brief change log

Cherry-pick of 64d0316aad22e83888b65e6c3036d0a980ae33a9 onto release-2.1. Four files changed, +172 / -11:

  • humanize-watermark.pipe.tsHumanizeWatermarkToDatetimePipe accepts an optional IANA timezone arg and formats via Intl.DateTimeFormat; keeps legacy behaviour when no zone is passed.
  • job-overview-drawer-watermarks.component.{ts,html,less} — adds timezone dropdown (nz-select), populates options from Intl.supportedValuesOf('timeZone'), defaults to Intl.DateTimeFormat().resolvedOptions().timeZone, wires it into the datetime column.

Backport notes (conflicts resolved)

Two conflicts resolved manually — both are environmental drift, not logic drift:

  1. job-overview-drawer-watermarks.component.ts@Component.imports: release-2.1 still uses the legacy ng-zorro name NzToolTipModule (capital T), while master has been renamed to NzTooltipModule. Kept release-2.1's NzToolTipModule spelling in both the import and the imports array, while adopting the new array entries the PR requires (NgForOf, FormsModule, NzSelectModule).
  2. job-status.component.less: the .back-link block reordered by the original PR does not exist on release-2.1 — it was introduced on master by an unrelated later PR. Dropped this hunk; the resulting net diff for this file is 0, so release-2.1 is untouched here. (This accounts for the slightly smaller overall diff vs the original PR's 178/14.)

No other code changes, no semantic deviation from the master PR.

Verification

  • npm ci && npm run lint — ✅ clean
  • npm run build (i.e. ng build --configuration production) — ✅ produced watermarks-job-overview-drawer-watermarks-component chunk without errors

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no (backport of existing feature)
  • If yes, how is the feature documented? not applicable

…figurable (apache#27552)

* [FLINK-39042][ui] Make watermark timestamps timezone-aware and configurable

* [FLINK-39042][webui] Use Intl API for timezone handling and support DST

Address review feedback:
- Use native Intl.DateTimeFormat API instead of manual offset calculation
- Replace fixed UTC offsets with IANA timezone names (e.g., America/Los_Angeles)
- IANA timezones automatically handle daylight saving time transitions
- Remove redundant console.log statements and improve code quality
- Add documentation comments with reference to IANA timezone database

* [FLINK-39042][webui] Make watermark timestamps timezone-aware and configurable

* [FLINK-39042][webui] Address code review comments

- Add MDN reference for Intl.DateTimeFormat API
- Clarify DST handling in timezone abbreviations (e.g., PST vs PDT)
- Improve error messages to explicitly mention UTC fallback
- Update comments to better explain timezone resolution logic

* Address review comments

- Remove 'pure: false' from HumanizeWatermarkToDatetimePipe as template already passes timezone argument
- Use Intl.supportedValuesOf('timeZone') to get all supported timezones instead of hardcoded list
- Keep browser local timezone as default
- Revert unnecessary changes in job-status.component.less

* fix: improve timezone fallback handling and CSS property ordering

- Enhance timezone detection fallback logic in watermark component\n- Fix CSS property ordering in job status component for better maintainability

* style: improve code formatting for better readability

- Split long lines in timezone options initialization for improved code readability

* style: optimize CSS property ordering for better maintainability

- Reorder CSS properties in job status component for improved code organization

* fix: add type assertion for Intl.supportedValuesOf to fix TS compilation error

* [FLINK-39042][webui] Use browser locale instead of hardcoded en-US in watermark datetime pipe

Replace hardcoded 'en-US' locale with undefined in Intl.DateTimeFormat to
respect the user's browser locale settings. This ensures the date display
order follows the user's regional preferences rather than being fixed to
the en-US format.

Suggested by @davidradl in code review.

(cherry picked from commit 64d0316)
@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented May 3, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants