fix: use correct GitLab collapsible sections group log format#27
fix: use correct GitLab collapsible sections group log format#27281742759-smi wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR updates GitLab CI log grouping escape sequences in ChangesGitLab log grouping
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
log/group/group.spec.ts (1)
45-48: 💤 Low valueHardcoded
:1section id couples this test to module-load order.The
idcounter ingroup.tsis module-scoped and increments on every GitLabgroupStartcall across the lifetime of the module. Today:1works because this is the only GitLab test, but adding a second GitLab test case (or reordering) will silently flipidto2+and break these assertions. Consider resetting the module (jest.isolateModules/jest.resetModules) before this test, or extractingidinto something injectable/testable, so the assertion does not depend on global call ordering.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@log/group/group.spec.ts` around lines 45 - 48, The test hardcodes a GitLab section id `:1` which relies on the module-scoped counter in group.ts and breaks when module load/order changes; update the test to avoid coupling to that global counter by either isolating/resetting the module before the spec (use jest.isolateModules or jest.resetModules around the test) so the counter starts from 1, or refactor group.ts to expose/inject the id generator (e.g., accept an idFactory or resetId function) and in the spec inject or reset it so assertions on process.stdout.write (around groupStart/groupEnd) do not rely on a global incrementing value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@log/group/group.spec.ts`:
- Around line 45-48: The test hardcodes a GitLab section id `:1` which relies on
the module-scoped counter in group.ts and breaks when module load/order changes;
update the test to avoid coupling to that global counter by either
isolating/resetting the module before the spec (use jest.isolateModules or
jest.resetModules around the test) so the counter starts from 1, or refactor
group.ts to expose/inject the id generator (e.g., accept an idFactory or resetId
function) and in the spec inject or reset it so assertions on
process.stdout.write (around groupStart/groupEnd) do not rely on a global
incrementing value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8f150e90-66e5-4b5c-9373-9592e4c85b8d
📒 Files selected for processing (2)
log/group/group.spec.tslog/group/group.ts
📜 Review details
🔇 Additional comments (1)
log/group/group.ts (1)
26-27: LGTM!
Group logs for GitLab are broken. Node.js doesn't support
\e. The updated format follows GitLab's documentation on creating collapsible sections.Summary by CodeRabbit