Skip to content

🐛 [scanner] fix: document catch-binding convention to prevent lint regressions#21360

Merged
clubanderson merged 1 commit into
mainfrom
scanner/fix-21352
Jul 21, 2026
Merged

🐛 [scanner] fix: document catch-binding convention to prevent lint regressions#21360
clubanderson merged 1 commit into
mainfrom
scanner/fix-21352

Conversation

@clubanderson

@clubanderson clubanderson commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Fixes #21352
Fixes #21353

Root cause

The nightly Release workflow failed at commit 2ea59dd25 (2026-07-21) because a new @typescript-eslint/no-unused-vars lint violation was introduced in EnterpriseLayout.tsx by #21342. The catch binding catch (error) was declared but never referenced, exceeding the lint baseline count and causing the Lint frontend step to fail.

The failing jobs in run #29805735617:

  • ✅ Run Go tests (passed)
  • ❌ Lint frontend (npm run lint:check) — actual failure step

Existing code fixes (already merged to main)

PR Fix
#21345 Drop unused error binding in EnterpriseLayout.tsx — core lint fix
#21344 CanIChecker test alignment (stale assertion)
#21346 EnterpriseComplianceCards semantic color token (stale assertion)
#21354 CreateNamespaceModal auto-select assertion (stale assertion)

This PR — regression guard

To prevent the same class of mistake (naming a catch binding you never use) from silently slipping through again:

  1. web/eslint.config.js — adds an inline comment on the no-unused-vars rule explaining the correct pattern: use catch { } (no binding) when the error value is not needed; prefix with _ only when a type annotation is required.

  2. web/scripts/lint-baseline-check.mjs — improves the CI failure message with a targeted tip for the most common offender (unused catch bindings), pointing developers directly to the fix.

No rule severity or baseline changes — documentation-only, zero new lint violations.

Copilot AI review requested due to automatic review settings July 21, 2026 08:28
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jul 21, 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 eeshaansa 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

@netlify

netlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit bc528e5
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a5f4e2bc87cde00089523bc
😎 Deploy Preview https://deploy-preview-21360.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — 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.

@github-actions

Copy link
Copy Markdown
Contributor

🐝 Hi @clubanderson! I'm kubestellar-hive[bot], an automation bot for this repo.

Trusted users — org members and contributors with write access — can mention @kubestellar-hive in a comment to trigger repo automation.
On issues, that mention queues an automated fix attempt. On pull requests, it records extra context for existing automation.
This is not an interactive Q&A bot, so mentions should be treated as requests for automation rather than a conversation.

Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies.

@kubestellar-prow kubestellar-prow Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Test Coverage Check

All new source files in this PR have corresponding test files.

Checked web/src/hooks/ and web/src/components/ against origin/main.

@github-actions

Copy link
Copy Markdown
Contributor

♿ Accessibility Audit (WCAG 2.1 AA)

✅ No WCAG 2.1 AA violations detected in audited routes.


Powered by axe-core. Target: WCAG 2.1 AA compliance.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the failing CreateNamespaceModal unit test by ensuring a cluster is auto-selected when cluster options become available, aligning the modal’s initialization behavior with established patterns elsewhere in the web UI.

Changes:

  • Add a useEffect to auto-select the first available cluster when none is selected.
  • Update React imports to include useEffect.

Comment on lines +24 to +28
useEffect(() => {
if (!cluster && clusters.length > 0) {
setCluster(clusters[0])
}
}, [clusters, cluster])
@github-actions

Copy link
Copy Markdown
Contributor

❌ Playwright Tests Failed

📊 View Full Report

Download the playwright-report artifact from the workflow run for screenshots and detailed traces.

To view the report locally:

# Download and extract playwright-report.zip
npx playwright show-report path/to/playwright-report

@clubanderson clubanderson left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🚨 BLOCK — title/branch/description don't match the diff (quality review, COMMENT-only, self-approve blocked)

The PR is misfiled:

  • Title: "auto-select first cluster in CreateNamespaceModal"
  • Branch: scanner/fix-21352
  • Fixes #21352 #21353
  • Actual diff: 4 lines in .github/workflows/release.yml — changes /tmp/go-test-output.txtgo-test-output.txt in the release Go-test step

The body actually describes the workflow change correctly, but the title, branch, and Fixes issues advertise a completely different fix. Please either:

  1. Retitle to [scanner] fix: use CWD instead of /tmp in release.yml go-test step and re-verify the Fixes # refs point at the right issues, or
  2. Close this PR and reopen the intended CreateNamespaceModal change.

If the intent really is the workflow change, one substantive concern:

The claim "/tmp is blocked in the runtime environment" is unusual on GitHub-hosted runners — /tmp is world-writable and consistently available. This is only an issue on self-hosted or hardened runners. Please state which runner label the failing release job uses (runs-on: value from release.yml line ~180) and whether the block is documented policy — if it's a one-off flake, moving to CWD is a workaround for the symptom, not the cause. If it IS policy, other workflows in the repo also write to /tmp and should be swept in the same PR (there are Playwright artifact paths, kind kubeconfig temp paths, etc.).

Minor: tee go-test-output.txt writes to $GITHUB_WORKSPACE and the file gets included in any subsequent actions/upload-artifact glob — verify it's not accidentally uploaded to a release asset.

Not blocking on scope, but…

If it's really the workflow change, the tier label reads tier/3-restricted (typical for release-workflow edits) — good, that gates a human review.


quality agent · ACMM L4/L6 full · bead filed

…gressions (#21352 #21353)

Root cause of nightly failure (run 29805735617): unused `catch (error)`
binding in EnterpriseLayout.tsx introduced by #21342 caused a new
`@typescript-eslint/no-unused-vars` violation beyond the baseline.

The code fix (drop the binding → `catch { }`) landed in #21345.
This follow-up:
- Adds an inline comment on the no-unused-vars rule in eslint.config.js
  explaining the correct pattern so future contributors avoid the trap.
- Improves the lint-baseline-check.mjs error message with a targeted tip
  for the most common offender (unused catch bindings).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Scanner Agent <scanner@agents.github.com>
@github-actions github-actions Bot added tier/2-standard ai-generated Pull request generated by AI and removed tier/3-restricted labels Jul 21, 2026
@clubanderson clubanderson changed the title [scanner] fix: auto-select first cluster in CreateNamespaceModal 🐛 [scanner] fix: document catch-binding convention to prevent lint regressions Jul 21, 2026
@clubanderson
clubanderson merged commit b0923de into main Jul 21, 2026
32 of 34 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-21352 branch July 21, 2026 11:31
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

Copy link
Copy Markdown
Contributor

⏹️ Post-Merge Verification: cancelled

Commit: b0923de3a6529622349206a47304c49b047833c2
Specs run: smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/29826427926

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit b0923de3a6529622349206a47304c49b047833c2.

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

Labels

ai-generated Pull request generated by AI 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflow failure: Release 🚨 nightly release failing

2 participants