Skip to content

PF5: Enable TypeScript noImplicitAny option & fix types as necessary#1982

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:pattern-fly-5from
kyoto:pf5-noImplicitAny
May 26, 2026
Merged

PF5: Enable TypeScript noImplicitAny option & fix types as necessary#1982
openshift-merge-bot[bot] merged 1 commit into
openshift:pattern-fly-5from
kyoto:pf5-noImplicitAny

Conversation

@kyoto
Copy link
Copy Markdown
Member

@kyoto kyoto commented May 26, 2026

Manual cherry pick of #1971

Summary by CodeRabbit

  • Chores

    • Added missing TypeScript type definitions and tightened compiler settings to enforce stricter typing.
    • Improved type annotations across UI components and hooks for more robust behavior.
  • Bug Fixes

    • Adjusted alerting rule ID generation, which changes produced IDs for the same inputs (may affect existing references).

@kyoto kyoto added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 26, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a2e83cf7-9bbe-4e02-b97b-cbdd83556c34

📥 Commits

Reviewing files that changed from the base of the PR and between e17d1bd and a195f70.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • package.json
  • src/components/AttachLogModal.tsx
  • src/components/AttachmentModal.tsx
  • src/components/AttachmentsSizeAlert.tsx
  • src/components/Prompt.tsx
  • src/hooks/usePopover.ts
  • src/redux-reducers.ts
  • src/validation.ts
  • tsconfig.json
💤 Files with no reviewable changes (1)
  • tsconfig.json
✅ Files skipped from review due to trivial changes (1)
  • src/redux-reducers.ts

📝 Walkthrough

Walkthrough

Tightens TypeScript typing across components, hooks, and reducers, adds @types dependencies, removes the explicit noImplicitAny override in tsconfig, and changes alertingRuleID to hash only the key string (removing the previous salt argument).

Changes

TypeScript Strict Mode & Type Annotations

Layer / File(s) Summary
Dependencies and tsconfig
package.json, tsconfig.json
Adds @types entries for js-yaml, lodash, murmurhash-js, react-modal, react-redux. Removes explicit noImplicitAny: false so strict: true governs implicit-any behavior.
AttachLogModal selector & container typing
src/components/AttachLogModal.tsx
Imports Selector, switches Job and VM label selectors to matchLabels (job-name, vm.kubevirt.io/name), and types container name extraction before sorting.
Editor mount workaround & attachments sizing
src/components/AttachmentModal.tsx, src/components/AttachmentsSizeAlert.tsx
Adds EditorDidMount typing and casts monaco.editor assignment for the onDidChangeMarkers workaround; types Attachment in the total-chars reduce callback.
Prompt: Prometheus/Alertmanager typing and YAML validation
src/components/Prompt.tsx
Adds typed Prometheus shapes (PrometheusAlert, PrometheusRule, PrometheusRulesResponse, Silence), tightens YAML upload parsing by treating loadYAML possibly null, and types attachments when pushing chat history.
usePopover return type & reducer entry typing
src/hooks/usePopover.ts, src/redux-reducers.ts
Changes usePopover to explicitly return null; adds ImmutableMap<string, unknown> typing to findIndex predicates in two reducer cases.
Validation hash computation change
src/validation.ts
alertingRuleID now calls murmur3 with only the constructed key (removes 'monitoring-salt' second argument), altering produced IDs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • syedriko
  • xrajesh

"🐰 I tightened types with a careful hop,
Each selector now matches without a stop,
The editor listens, attachments counted true,
One hash lost its salt — the output is new,
Hooray! — a tidy patch from this rabbit to you."

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the PR: enabling TypeScript's noImplicitAny option and fixing types throughout the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from syedriko and xrajesh May 26, 2026 06:30
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kyoto
Copy link
Copy Markdown
Member Author

kyoto commented May 26, 2026

/retest

@kyoto kyoto force-pushed the pf5-noImplicitAny branch from e17d1bd to a195f70 Compare May 26, 2026 09:03
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label May 26, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 26, 2026

New changes are detected. LGTM label has been removed.

@kyoto kyoto added the lgtm Indicates that a PR is ready to be merged. label May 26, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 439900c into openshift:pattern-fly-5 May 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant