Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: standardize undefined handling for categories #868

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

hanna-skryl
Copy link
Collaborator

Closes #518

This refactor standardizes the handling of categories as undefined throughout the CLI pipeline until conversion to the GQL report. Previously, an empty array was assigned by default in middlewares, leading to inconsistencies with CoreConfig where categories are optional.

By removing the default empty array, categories remain undefined unless explicitly provided. This update improves type consistency, ensuring that categories are only included in the final report if defined. When no categories are provided, the JSON report omits the categories field, and the Markdown report summary table indicates that there are 0 categories.

Copy link

github-actions bot commented Nov 7, 2024

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared target commit cc98195 with source commit 61d49ea.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🟡 54 🟡 52 ↓ −1.8
Code coverage 🟡 90 🟡 90 ↑ +0.1
Custom checks 🟡 67 🟡 67
Security 🟡 88 🟡 88
Updates 🟡 76 🟡 76
Accessibility 🟢 91 🟢 91
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Bug prevention 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 1 group improved, 👎 1 group regressed, 👍 5 audits improved, 👎 1 audit regressed, 14 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🟡 54 🟡 52 ↓ −1.8
Code coverage Code coverage metrics 🟡 90 🟡 90 ↑ +0.1

18 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Largest Contentful Paint 🟨 3.0 s 🟨 3.3 s ↑ +13 %
Lighthouse First Contentful Paint 🟨 3.0 s 🟨 2.7 s ↓ −7.4 %
Lighthouse Speed Index 🟥 6.6 s 🟥 6.4 s ↓ −2.2 %
Lighthouse Time to Interactive 🟥 17.7 s 🟥 16.2 s ↓ −8.7 %
Code coverage Function coverage 🟩 92.4 % 🟩 92.4 % ↑ +0.1 %
Code coverage Line coverage 🟩 90.4 % 🟩 90.4 % ↑ +0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,818 KiB 🟩 Total size was 1,813 KiB ↓ −0.2 %
Lighthouse JavaScript execution time 🟥 11.0 s 🟥 9.4 s ↓ −14.1 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −8.7 %
Lighthouse Minimizes main-thread work 🟥 18.7 s 🟥 19.2 s ↑ +2.9 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 1,140 ms 🟥 Potential savings of 720 ms ↓ −37 %
Lighthouse Initial server response time was short 🟩 Root document took 590 ms 🟩 Root document took 370 ms ↓ −37.1 %
Lighthouse Server Backend Latencies 🟩 230 ms 🟩 100 ms ↓ −55.4 %
Lighthouse Uses efficient cache policy on static assets 🟨 27 resources found 🟨 27 resources found ↓ −0.1 %
Lighthouse Total Blocking Time 🟥 6,850 ms 🟥 6,750 ms ↓ −1.4 %
Lighthouse Max Potential First Input Delay 🟥 2,850 ms 🟥 2,790 ms ↓ −2.1 %
Lighthouse Network Round Trip Times 🟩 70 ms 🟩 20 ms ↓ −74.1 %
Lighthouse Avoids an excessive DOM size 🟥 2,245 elements 🟥 2,241 elements ↓ −0.2 %
JS Packages Outdated NPM dev dependencies. 🟨 39 outdated package versions (26 major, 10 minor, 2 patch, 1 prerelease) 🟨 40 outdated package versions (26 major, 10 minor, 3 patch, 1 prerelease) ↑ +2.6 %
Code coverage Branch coverage 🟨 84.8 % 🟨 84.8 % ↑ +0.1 %

493 other audits are unchanged.

@hanna-skryl hanna-skryl marked this pull request as ready for review November 7, 2024 19:07
vmasek
vmasek previously approved these changes Nov 7, 2024
packages/ci/src/lib/issues.unit.test.ts Outdated Show resolved Hide resolved
packages/models/src/lib/implementation/utils.ts Outdated Show resolved Hide resolved
packages/utils/src/lib/reports/generate-md-report.ts Outdated Show resolved Hide resolved
@hanna-skryl hanna-skryl merged commit 7e6c29d into main Nov 8, 2024
16 checks passed
@hanna-skryl hanna-skryl deleted the refactor/make-categories-undefined branch November 8, 2024 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolve categories inconsistencies...again
3 participants