[hotfix][runtime-web] Bring logs components under eslint enforcement#28086
[hotfix][runtime-web] Bring logs components under eslint enforcement#28086spuru9 wants to merge 2 commits intoapache:masterfrom
Conversation
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.
|
@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. |
featzhang
left a comment
There was a problem hiding this comment.
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.
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.
|
@featzhang Have addressed the comment. Can you review/approve. |
What is the purpose of the change
.eslintignorehas a barelogspattern 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 capturessrc/app/pages/{job-manager,task-manager}/logs/, the source dirs holding the dashboard's log pages. Files under those paths were silently skipped bylint-staged, CI, and IDE eslint.Brief change log
logs->/logs.eslint --fixon both*-logs.component.tsfiles (prettier whitespace/quotes/brackets,import/order, import deduplication).: voidreturn types tongOnInitandreloadin both components (@typescript-eslint/explicit-function-return-typeis not auto-fixable).Verifying this change
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Opus 4.7)