Skip to content

[hotfix][runtime-web] Bring logs components under eslint enforcement#28086

Open
spuru9 wants to merge 2 commits intoapache:masterfrom
spuru9:prettier-ci-enforce
Open

[hotfix][runtime-web] Bring logs components under eslint enforcement#28086
spuru9 wants to merge 2 commits intoapache:masterfrom
spuru9:prettier-ci-enforce

Conversation

@spuru9
Copy link
Copy Markdown
Contributor

@spuru9 spuru9 commented May 2, 2026

What is the purpose of the change

.eslintignore has a bare logs pattern that uses gitignore semantics — it matches a directory of that name at any depth. It was meant for a top-level log-output directory but also captures src/app/pages/{job-manager,task-manager}/logs/, the source dirs holding the dashboard's log pages. Files under those paths were silently skipped by lint-staged, CI, and IDE eslint.

Brief change log

  • Anchor the pattern at the project root: logs -> /logs.
  • Run eslint --fix on both *-logs.component.ts files (prettier whitespace/quotes/brackets, import/order, import deduplication).
  • Add : void return types to ngOnInit and reload in both components (@typescript-eslint/explicit-function-return-type is not auto-fixable).

Verifying this change

cd flink-runtime-web/web-dashboard
rm -f .eslintcache
npm run lint   # exits 0; both files are now included by eslint

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
  • If yes, how is the feature documented? not applicable

Was generative AI tooling used to co-author this PR?
  • Yes (Claude Code / Claude Opus 4.7)

Generated-by: Claude Code (Claude Opus 4.7)

The bare `logs` pattern in
`flink-runtime-web/web-dashboard/.eslintignore` uses gitignore
semantics and matches a directory of that name at any depth. It was
intended for a top-level log-output directory (alongside `*.log` and
`npm-debug.log*`) but also captured the source directories
`src/app/pages/{job-manager,task-manager}/logs/`. Files under those
paths were silently skipped by every eslint invocation: the
`lint-staged` pre-commit hook, `npm run lint` in CI, and IDE eslint
integrations. Prettier-style drift (and other rule violations)
accumulated on those files unnoticed and eventually leaked into an
unrelated feature PR as reformat noise.

Anchors the pattern at the project root (`logs` -> `/logs`) so it
keeps its original intent without shadowing real source dirs, and
brings the now-visible files up to the project's lint rules:

- Adds `: void` to `ngOnInit` and `reload` in
  `JobManagerLogsComponent` and `TaskManagerLogsComponent` so they
  satisfy `@typescript-eslint/explicit-function-return-type` (sibling
  `ngOnDestroy(): void` was already annotated).
- Applies `eslint --fix` output: prettier whitespace, quote style,
  bracket spacing, `import/order` grouping, and import deduplication.

After this, `eslint src --ext .ts,.html` includes the two files and
exits 0; future edits go through the same gate as the rest of the
codebase.
@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented May 2, 2026

CI report:

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

@spuru9
Copy link
Copy Markdown
Contributor Author

spuru9 commented May 2, 2026

@featzhang Can you review this hotfix. Related to the one I commented about, have made the fix so it don't come up in future PRs.

@spuru9 spuru9 changed the title [hotfix][runtime-web] Bring *-logs components under eslint enforcement [hotfix][runtime-web] Bring logs components under eslint enforcement May 2, 2026
Copy link
Copy Markdown
Member

@featzhang featzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking this down — the root-cause analysis is spot on. The bare logs pattern has been there since 2021 (6f03f02), so two real source dirs (src/app/pages/{job-manager,task-manager}/logs/) have been silently excluded from lint for years, which is exactly how prettier drift accumulated on those two files and later leaked into an unrelated feature PR as reformat noise.

The fix is minimal and well-scoped: the logs/logs anchoring keeps the original intent (ignoring a top-level runtime log dir) without shadowing source paths, and the accompanying eslint --fix output plus the : void return types are consistent with how the rest of the codebase is written — ngOnDestroy(): void in the same files was already annotated, and every other public ngOnInit under src/app/pages uses : void, so these two files are simply being brought into line rather than introducing a new style.

Verified locally that the diff contains no behavioral changes — only import reordering/deduplication, quote/bracket normalization, indentation, and the four : void annotations. +1 from me.

One follow-up thought (non-blocking): the same bare-pattern issue also applies to tsc-out and dist on lines 4–5 of .eslintignore. There are no source dirs with those names today, but the pattern is the same footgun. Could be tightened in the same spirit (/tsc-out, /dist) either here or as a small separate hotfix.

Comment thread flink-runtime-web/web-dashboard/.eslintignore Outdated
Following review feedback on the parent commit: `tsc-out` and `dist`
in `flink-runtime-web/web-dashboard/.eslintignore` use the same
unanchored gitignore semantics that `logs` did, so they would also
match a directory of that name at any nesting depth. No source dirs
collide with them today, but anchoring at the project root keeps the
three top-level artifact dirs (`/logs`, `/tsc-out`, `/dist`)
consistent and closes the same footgun for the future.
@spuru9 spuru9 requested a review from featzhang May 2, 2026 19:25
@spuru9
Copy link
Copy Markdown
Contributor Author

spuru9 commented May 2, 2026

@featzhang Have addressed the comment. Can you review/approve.

@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants