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

Core: Replace 'min' instead of 'm' in printDuration #30668

Merged

Conversation

wlewis-formative
Copy link
Contributor

@wlewis-formative wlewis-formative commented Feb 25, 2025

What I did

Changes the string to replace in printDuration from ' m' to ' min'. The prettyTime function from pretty-hrtime uses the suffix 'min' rather than 'm'; as a result, printDuration currently prints times like:

Completed in 2 minutesin.

rather than:

Completed in 2 minutes.

Testing

Manual testing

We could probably add some unit tests for this, but I'm not sure it's worth it. Testing it manually probably requires running on a project that takes somewhere on the order of minutes to load and checking that the message looks correct.

Greptile Summary

Fixed incorrect duration formatting in the printDuration utility function to properly display time units in build progress messages.

  • Changed string replacement in code/core/src/common/utils/print-duration.ts from ' m' to ' min' to match pretty-hrtime output format
  • Fixed build duration messages showing "minutesin" instead of "minutes"
  • Affects webpack builder progress reporting through the Storybook UI

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@storybook-pr-benchmarking
Copy link

storybook-pr-benchmarking bot commented Mar 3, 2025

Package Benchmarks

Commit: d442866, ran on 6 March 2025 at 07:08:07 UTC

No significant changes detected, all good. 👏

Copy link

nx-cloud bot commented Mar 6, 2025

View your CI Pipeline Execution ↗ for commit d442866.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 59s View ↗

☁️ Nx Cloud last updated this comment at 2025-03-06 08:21:19 UTC

@valentinpalkovic valentinpalkovic changed the title Replace 'min' instead of 'm' in printDuration Core: Replace 'min' instead of 'm' in printDuration Mar 6, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@valentinpalkovic valentinpalkovic merged commit 82b2951 into storybookjs:next Mar 6, 2025
51 of 52 checks passed
@github-actions github-actions bot mentioned this pull request Mar 6, 2025
18 tasks
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Mar 6, 2025
@github-actions github-actions bot mentioned this pull request Mar 6, 2025
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ci:normal core patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants