Skip to content

refactor: consolidate count and relative-time formatting utilities#5220

Open
xuang7 wants to merge 5 commits into
apache:mainfrom
xuang7:refactor/relative-time/count-utils
Open

refactor: consolidate count and relative-time formatting utilities#5220
xuang7 wants to merge 5 commits into
apache:mainfrom
xuang7:refactor/relative-time/count-utils

Conversation

@xuang7
Copy link
Copy Markdown
Contributor

@xuang7 xuang7 commented May 26, 2026

What changes were proposed in this PR?

This PR extracts duplicated formatCount and relative-time formatting logic into the shared format.util.ts utility file, and updates inline usages to use the shared utilities. No behavior change.

Any related issues, documentation, discussions?

Closes #5218

How was this PR tested?

Existing automated tests passed.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7

@github-actions github-actions Bot added refactor Refactor the code frontend Changes related to the frontend GUI labels May 26, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 26, 2026

Codecov Report

❌ Patch coverage is 90.32258% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.99%. Comparing base (d8c254c) to head (aa8e3bf).

Files with missing lines Patch % Lines
...-item/user-computing-unit-list-item.component.html 0.00% 1 Missing ⚠️
...st-item/user-computing-unit-list-item.component.ts 50.00% 1 Missing ⚠️
...t/workflow/detail/hub-workflow-detail.component.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5220      +/-   ##
============================================
- Coverage     48.95%   45.99%   -2.97%     
+ Complexity     2377     2218     -159     
============================================
  Files          1048     1050       +2     
  Lines         40270    40661     +391     
  Branches       4272     4332      +60     
============================================
- Hits          19714    18700    -1014     
- Misses        19402    20835    +1433     
+ Partials       1154     1126      -28     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from e7e5d4e
agent-service 33.74% <ø> (-0.03%) ⬇️ Carriedforward from e7e5d4e
amber 44.11% <ø> (-7.47%) ⬇️ Carriedforward from e7e5d4e
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from e7e5d4e
config-service 0.00% <ø> (ø) Carriedforward from e7e5d4e
file-service 32.09% <ø> (-5.90%) ⬇️ Carriedforward from e7e5d4e
frontend 40.88% <90.32%> (+0.23%) ⬆️
python 90.50% <ø> (-0.30%) ⬇️ Carriedforward from e7e5d4e
workflow-compiling-service 56.81% <ø> (ø) Carriedforward from e7e5d4e

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang left a comment

Choose a reason for hiding this comment

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

Good change! But I would kindly ask you to provide tests for all those format utils. The coverage is quite low currently.

@xuang7
Copy link
Copy Markdown
Contributor Author

xuang7 commented May 27, 2026

Good change! But I would kindly ask you to provide tests for all those format utils. The coverage is quite low currently.

I added tests for the format utils. For the component call sites, adding tests would require quite a bit of setup, so it felt beyond the scope of this PR and I didn't include those tests. Thanks!

@xuang7 xuang7 requested a review from Yicong-Huang May 27, 2026 01:15
@Yicong-Huang Yicong-Huang added this pull request to the merge queue May 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate relative time and count formatting utilities

3 participants