Skip to content

Conversation

@hanna-skryl
Copy link
Collaborator

@hanna-skryl hanna-skryl commented Aug 21, 2025

Part of #721 (CLI preparation)

This PR implements the CLI preparation phase for the scoreTargets feature for audits.

  • Extend the plugin configuration with the scoreTargets property (single number or per-audit mapping)
  • Create a generic scoreAuditsWithTarget utility function in the utils package
  • Apply the scoreTargets transformation in executePlugin after the plugin execution
  • Add unit tests for the new functionality

The following items from the ticket are intentionally deferred:

  1. "extend auditSchema with targetScore" - After careful consideration, it's been concluded that scoreTarget belongs at the plugin configuration level rather than individual audit definitions. This approach provides greater flexibility, allowing for either a single value applicable to all audits or a per-audit mapping.
  2. "rename applyMaxScoreAboveThreshold" - This function remains in the coverage plugin unchanged. Migration to the new generic system is planned for PR4 to maintain backward compatibility.
  3. Portal integration - Changes toauditToGQL are not needed until PR3, after the portal model adoption (PR2) is complete.

@hanna-skryl hanna-skryl self-assigned this Aug 21, 2025
@github-actions github-actions bot added 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🧩 core 🧩 models 🧩 utils labels Aug 21, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 21, 2025

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1076

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1076

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1076

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1076

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1076

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1076

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1076

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1076

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1076

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1076

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1076

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1076

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1076

commit: b17bdcc

@github-actions
Copy link
Contributor

github-actions bot commented Aug 21, 2025

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit ccf38d8 with previous commit a419aec.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🔴 31 🔴 30 ↓ −1.1
Code coverage 🟢 90 🟢 91 ↑ +0.1
Documentation 🔴 23 🔴 23 ↑ +0.1
Security 🔴 0 🔴 0
Updates 🟡 77 🟡 77
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Type Safety 🟢 100 🟢 100
Bug prevention 🟢 100 🟢 100
Miscellaneous 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 2 groups improved, 👎 1 group regressed, 👍 6 audits improved, 👎 2 audits regressed, 17 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🔴 31 🔴 30 ↓ −1.1
Code coverage Code coverage metrics 🟢 90 🟢 91 ↑ +0.1
JSDoc coverage Documentation coverage 🔴 23 🔴 23 ↑ +0.1

18 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟥 Root document took 620 ms 🟩 Root document took 380 ms ↓ −38.7 %
Lighthouse First Contentful Paint 🟥 3.1 s 🟥 3.4 s ↑ +12.3 %
Lighthouse Speed Index 🟥 8.8 s 🟥 8.7 s ↓ −1.7 %
JSDoc coverage Functions coverage 🟥 516 undocumented functions 🟥 516 undocumented functions  +0 %
Code coverage Line coverage 🟨 87.4 % 🟨 87.6 % ↑ +0.3 %
Code coverage Branch coverage 🟨 86.1 % 🟨 86.3 % ↑ +0.2 %
JSDoc coverage Types coverage 🟥 235 undocumented types 🟥 236 undocumented types ↑ +0.4 %
Code coverage Function coverage 🟩 93.2 % 🟩 93.2 % ↑ +0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,665 KiB 🟩 Total size was 2,657 KiB ↓ −0.3 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↓ −0.6 %
Lighthouse Largest Contentful Paint 🟥 11.9 s 🟥 13.3 s ↑ +11.8 %
Lighthouse Total Blocking Time 🟥 6,810 ms 🟥 8,050 ms ↑ +18.2 %
Lighthouse JavaScript execution time 🟥 9.5 s 🟥 10.5 s ↑ +10 %
Lighthouse Max Potential First Input Delay 🟥 1,800 ms 🟥 2,400 ms ↑ +33 %
Lighthouse Minimizes main-thread work 🟥 21.1 s 🟥 21.5 s ↑ +2.1 %
Lighthouse Time to Interactive 🟥 19.5 s 🟥 19.3 s ↓ −0.9 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −0.9 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 116 KiB 🟥 Potential savings of 116 KiB ↑ +37 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 91 KiB 🟥 Potential savings of 100 KiB ↑ +56.7 %
Lighthouse Network Round Trip Times 🟩 10 ms 🟩 90 ms ↑ +549.4 %
Lighthouse Server Backend Latencies 🟩 170 ms 🟩 230 ms ↑ +40.7 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 614 KiB 🟥 Potential savings of 613 KiB ↑ +3.3 %
Lighthouse Avoids an excessive DOM size 🟥 2,285 elements 🟥 2,289 elements ↑ +0.2 %
JS Packages Outdated NPM dev dependencies. 🟨 56 outdated package versions (30 major, 21 minor, 5 patch) 🟨 57 outdated package versions (30 major, 21 minor, 6 patch) ↑ +1.8 %
JSDoc coverage Variables coverage 🟥 224 undocumented variables 🟥 225 undocumented variables ↑ +0.4 %

585 other audits are unchanged.

@hanna-skryl hanna-skryl marked this pull request as ready for review August 21, 2025 19:26
Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

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

Left a small naming change

BioPhoton
BioPhoton previously approved these changes Aug 22, 2025
Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

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

LGTM

matejchalk
matejchalk previously approved these changes Aug 22, 2025
@hanna-skryl hanna-skryl dismissed stale reviews from matejchalk and BioPhoton via b17bdcc August 22, 2025 13:16
@nx-cloud
Copy link

nx-cloud bot commented Aug 22, 2025

View your CI Pipeline Execution ↗ for commit 5d86e2b

Command Status Duration Result
nx affected -t e2e-test --parallel=1 ❌ Failed 12m 14s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-22 14:02:08 UTC

@hanna-skryl hanna-skryl changed the title feat: implement scoreTarget for audits feat: implement scoreTargets for audits Aug 22, 2025
@hanna-skryl hanna-skryl merged commit 5db68e2 into main Aug 22, 2025
40 of 43 checks passed
@hanna-skryl hanna-skryl deleted the audits-score-target branch August 22, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧩 core 🧩 models 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🧩 utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants