Skip to content

fix(utils): pass revparse args as array#1271

Merged
hanna-skryl merged 1 commit intomainfrom
git-default-branch-revparse
Mar 18, 2026
Merged

fix(utils): pass revparse args as array#1271
hanna-skryl merged 1 commit intomainfrom
git-default-branch-revparse

Conversation

@hanna-skryl
Copy link
Collaborator

getGitDefaultBranch returns the literal string --abbrev-ref origin/HEAD instead of the resolved branch name. When revparse receives a single string, simple-git passes it as one argument to git, which silently returns it unchanged. Passing an array splits the arguments correctly.

Added an integration test with a simulated remote origin. Reverting the fix causes it to fail with expected '--abbrev-ref origin/HEAD' to be 'master'.

@hanna-skryl hanna-skryl self-assigned this Mar 17, 2026
@nx-cloud
Copy link

nx-cloud bot commented Mar 17, 2026

View your CI Pipeline Execution ↗ for commit ac24da3

Command Status Duration Result
nx run ci:code-pushup -- merge-diffs --files=/h... ✅ Succeeded 5s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 1m 31s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 13m 31s View ↗
nx run-many -t unit-test,int-test ✅ Succeeded 10s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-17 22:34:21 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 17, 2026

Open in StackBlitz

@code-pushup/ci

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

@code-pushup/cli

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

@code-pushup/core

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

@code-pushup/models

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

@code-pushup/create-cli

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

@code-pushup/nx-plugin

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

@code-pushup/axe-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/axe-plugin@1271

@code-pushup/coverage-plugin

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

@code-pushup/eslint-plugin

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

@code-pushup/js-packages-plugin

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

@code-pushup/jsdocs-plugin

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

@code-pushup/lighthouse-plugin

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

@code-pushup/typescript-plugin

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

@code-pushup/utils

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

commit: ac24da3

@github-actions
Copy link
Contributor

Code PushUp

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

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🔴 36 🔴 34 ↓ −1.7
Code coverage 🟢 92 🟢 92 ↓ −0.1
Bug prevention 🟡 75 🟡 75 ↓ −0.1
Axe Accessibility 🟡 88 🟡 88 ↓ −0.1
Code style 🟢 100 🟢 100
Security 🔴 0 🔴 0
Updates 🟡 72 🟡 72
Type Safety 🟡 67 🟡 67
Miscellaneous 🟡 67 🟡 67
Documentation 🟡 52 🟡 52
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟢 92 🟢 92
👎 2 groups regressed, 👍 2 audits improved, 👎 6 audits regressed, 12 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🔴 36 🔴 34 ↓ −1.7
Code coverage Code coverage metrics 🟢 92 🟢 92 ↓ −0.1

32 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟩 Root document took 430 ms 🟥 Root document took 650 ms ↑ +51.1 %
Lighthouse Speed Index 🟨 5.7 s 🟥 6.8 s ↑ +18.5 %
Lighthouse First Contentful Paint 🟥 3.1 s 🟥 3.3 s ↑ +3.4 %
Lighthouse Max Potential First Input Delay 🟥 850 ms 🟥 630 ms ↓ −26.2 %
Lighthouse Total Blocking Time 🟥 2,880 ms 🟥 2,550 ms ↓ −11.4 %
Code coverage Line coverage 🟩 92.2 % 🟩 92.1 % ↓ −0.1 %
Code coverage Function coverage 🟩 94 % 🟩 94 % ↓ −0.1 %
Code coverage Branch coverage 🟨 89.1 % 🟨 89.1 % ↓ −0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,410 KiB 🟩 Total size was 2,401 KiB ↓ −0.4 %
Lighthouse Minimizes main-thread work 🟥 12.3 s 🟥 11.3 s ↓ −8.4 %
Lighthouse Server Backend Latencies 🟩 1,240 ms 🟩 320 ms ↓ −73.9 %
Lighthouse Largest Contentful Paint 🟥 13.4 s 🟥 12.6 s ↓ −5.8 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +1.8 %
Lighthouse Time to Interactive 🟥 14.2 s 🟥 14.5 s ↑ +1.8 %
Lighthouse JavaScript execution time 🟥 4.2 s 🟥 4.0 s ↓ −5.7 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↑ +0.1 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 80 KiB 🟥 Potential savings of 111 KiB ↑ +33.3 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 277 KiB 🟥 Potential savings of 277 KiB ↑ +10.2 %
Lighthouse Network Round Trip Times 🟩 30 ms 🟩 70 ms ↑ +162.6 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 108 KiB 🟥 Potential savings of 89 KiB ↓ −6.2 %

658 other audits are unchanged.

@github-actions
Copy link
Contributor

Code PushUp

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

💼 Project utils

🤨 Code PushUp report has both improvements and regressions.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage 🟢 94 🟢 95 ↑ +0.1

5 other categories are unchanged.

👍 1 group improved, 👍 2 audits improved, 👎 1 audit regressed

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage Code coverage metrics 🟢 94 🟢 95 ↑ +0.1

14 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Code coverage Function coverage 🟩 95.4 % 🟩 95.7 % ↑ +0.2 %
Code coverage Line coverage 🟩 97.6 % 🟩 97.7 % ↑ +0.1 %
Code coverage Branch coverage 🟩 91.4 % 🟩 91.4 % ↓ −0.1 %

441 other audits are unchanged.


13 other projects are unchanged.

@hanna-skryl hanna-skryl marked this pull request as ready for review March 17, 2026 22:35
@hanna-skryl hanna-skryl requested a review from matejchalk March 17, 2026 22:35
@hanna-skryl hanna-skryl merged commit f912a1f into main Mar 18, 2026
25 checks passed
@hanna-skryl hanna-skryl deleted the git-default-branch-revparse branch March 18, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants