Skip to content

fix: replace as any cast with defaultValue in Intoto error key#13101

Merged
kubestellar-hive[bot] merged 1 commit into
kubestellar:mainfrom
AdeshDeshmukh:fix/intoto-dynamic-i18n-types
May 11, 2026
Merged

fix: replace as any cast with defaultValue in Intoto error key#13101
kubestellar-hive[bot] merged 1 commit into
kubestellar:mainfrom
AdeshDeshmukh:fix/intoto-dynamic-i18n-types

Conversation

@AdeshDeshmukh
Copy link
Copy Markdown
Contributor

The fetch error handler used t(errorMsg as any) to translate server-structured error messages containing a dot. Replaced with defaultValue so dynamic keys are accepted without bypassing type checking, and the raw message serves as fallback when no translation exists. Removes the eslint-disable comment and as any cast.

The fetch error handler used t(errorMsg as any) to translate
server-structured error messages containing a dot (e.g.
intoto_supply_chain.serverTimeout). Replaced with defaultValue
so dynamic keys are accepted without bypassing type checking,
and the raw message serves as fallback when no translation exists.

Signed-off-by: AdeshDeshmukh <adeshkd123@gmail.com>
Copilot AI review requested due to automatic review settings May 11, 2026 13:34
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label May 11, 2026
@kubestellar-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mikespreitzer for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@github-actions
Copy link
Copy Markdown
Contributor

👋 Hey @AdeshDeshmukh — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@kubestellar-prow kubestellar-prow Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Intoto Supply Chain card’s fetch error rendering to avoid bypassing TypeScript checks when translating server-provided, dot-delimited error keys. It replaces an as any cast (and an eslint-disable) with defaultValue so unknown/dynamic keys fall back to the raw server message when no translation exists.

Changes:

  • Replace t(errorMsg as any) with t(errorMsg, { defaultValue: errorMsg }) for dot-delimited server error strings.
  • Remove the inline eslint-disable that previously allowed the any cast.
Copy link
Copy Markdown
Contributor

@kubestellar-hive kubestellar-hive Bot left a comment

Choose a reason for hiding this comment

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

Good fix — using defaultValue: errorMsg here is better than the as any cast. It correctly falls back to the raw server error message when no matching translation key exists, which is the right behavior for dynamic server-provided error strings. Removes the lint suppression cleanly. LGTM.

@kubestellar-prow
Copy link
Copy Markdown
Contributor

@kubestellar-hive[bot]: changing LGTM is restricted to collaborators

Details

In response to this:

Good fix — using defaultValue: errorMsg here is better than the as any cast. It correctly falls back to the raw server error message when no matching translation key exists, which is the right behavior for dynamic server-provided error strings. Removes the lint suppression cleanly. LGTM.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 11, 2026

Deploy Preview for kubestellarconsole failed. Why did it fail? →

Built without sensitive environment variables

Name Link
🔨 Latest commit 35c8894
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a01daf2c3967f0008b05375
@kubestellar-hive kubestellar-hive Bot merged commit 9dc0abe into kubestellar:main May 11, 2026
35 of 41 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: 9dc0abe927889a8f3017fb773e947de7831ebd32
Specs run: Dashboard.spec.ts smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/25675237978

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

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. tier/2-standard

2 participants