Skip to content

fix(lighthouse): use valid JSON placeholders in heredoc#93

Merged
tehw0lf merged 1 commit into
mainfrom
fix/lighthouse-heredoc-invalid-json
Jun 25, 2026
Merged

fix(lighthouse): use valid JSON placeholders in heredoc#93
tehw0lf merged 1 commit into
mainfrom
fix/lighthouse-heredoc-invalid-json

Conversation

@tehw0lf

@tehw0lf tehw0lf commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes a bug spotted by CodeRabbit on PR #92: the quoted heredoc (<< 'RCEOF') prevents shell variable expansion, leaving $MIN_PERF etc. as literal text in .lighthouserc.json. This produces invalid JSON and jq fails immediately.

Fix: use 0 as placeholder values in the heredoc — jq overwrites every minScore with the actual input values anyway.

Test plan

  • Merge and retrigger a lighthouse scan to confirm thresholds are correctly applied

Summary by CodeRabbit

  • Chores
    • Updated the Lighthouse scan setup to use valid default scoring values in its generated configuration.
    • This makes the workflow configuration cleaner and avoids placeholder values in the output, while still allowing the final scan thresholds to be applied dynamically.

Quoted heredoc leaves $MIN_PERF etc. as literal text, producing invalid
JSON that causes jq to fail. Use 0 as placeholder since jq overwrites
every minScore anyway.
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 00e5b2f5-b143-471a-9275-b6e06af03e5f

📥 Commits

Reviewing files that changed from the base of the PR and between 634895d and 8474bbb.

📒 Files selected for processing (1)
  • .github/workflows/lighthouse-scan.yml

📝 Walkthrough

Walkthrough

The Lighthouse CI workflow now seeds all category minScore values with 0 in the generated config before jq applies workflow input values.

Changes

Lighthouse scan workflow

Layer / File(s) Summary
Initial minScore values
.github/workflows/lighthouse-scan.yml
The generated Lighthouse config template changes the four category assertion minScore defaults from placeholder expressions to numeric 0 values.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • tehw0lf/workflows#89: Updates the same Lighthouse workflow config generation path and the category minScore handling.
  • tehw0lf/workflows#92: Changes the same .lighthouserc.json generation logic for Lighthouse thresholds in the workflow.

Poem

🐇 I hopped by the scan with a twitchy nose,
Set scores to zero where the lighthouse glows.
jq took the wheel and the config stood tall,
A neat little workflow, bright and not flawed at all.

🚥 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 clearly matches the Lighthouse workflow fix and the heredoc JSON placeholder change.
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
  • Commit unit tests in branch fix/lighthouse-heredoc-invalid-json

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

@tehw0lf tehw0lf merged commit 8d9e771 into main Jun 25, 2026
3 checks passed
@tehw0lf tehw0lf deleted the fix/lighthouse-heredoc-invalid-json branch June 25, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant