10BC0 PCF-562 Consider adding the OS version to the name of the platform in the "Platform" column by esanuandra · Pull Request #816 · mozilla/perfcompare · GitHub
[go: up one dir, main page]

Skip to content

Conversation

esanuandra
Copy link
Contributor
@esanuandra esanuandra commented Dec 9, 2024

Copy link
netlify bot commented Dec 9, 2024

Deploy Preview for mozilla-perfcompare ready!

Name Link
🔨 Latest commit a6f71cb
🔍 Latest deploy log https://app.netlify.com/sites/mozilla-perfcompare/deploys/677e8317a3d1e70008bf0f0b
😎 Deploy Preview https://deploy-preview-816--mozilla-perfcompare.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@esanuandra esanuandra added the 🚧 WIP 🚧 Work in progress: do not merge label Dec 9, 2024
Copy link
codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.64%. Comparing base (0fcfaf9) to head (0ddc433).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #816      +/-   ##
==========================================
+ Coverage   92.62%   92.64%   +0.01%     
==========================================
  Files          93       93              
  Lines        2577     2582       +5     
  Branches      515      516       +1     
==========================================
+ Hits         2387     2392       +5     
  Misses        168      168              
  Partials       22       22              

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

Comment on lines 19 to 35

if (platform.startsWith('windows'))
return `${platformShortName}\u00a0${platform
.split('-')[0]
.replace('windows', '')}`;
if (platform.startsWith('win'))
return `${platformShortName}\u00a0${platform
.split('-')[0]
.replace('win', '')}`;
if (platform.startsWith('macosx'))
return `${platformShortName}\u00a0${platform
.split('-')[0]
.replace('macosx', '')}`;
if (platform.startsWith('linux'))
return `${platformShortName}\u00a0${platform
.split('-')[0]
.replace('linux', '')}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to add comments with example

@esanuandra esanuandra force-pushed the add-OS-version-to-platform-column branch 2 times, most recently from e56ebb9 to f53c368 Compare December 18, 2024 13:58
@esanuandra esanuandra added Ready For Review and removed 🚧 WIP 🚧 Work in progress: do not merge labels Dec 18, 2024
@esanuandra esanuandra requested a review from julienw December 18, 2024 14:05
Copy link
Contributor
@julienw julienw left a comment

Choose a reason for hiding this comment

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

Thanks, this looks pretty good to me!
I only have some nits for maintenance and readability, but feel free to merge without a new review after you fix them. As long as the tests don't change that's good :-)

return 'Unspecified';
};

const osMapping = {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: please add a comment with a link to your source (is that https://github.com/mozilla/treeherder/blob/master/ui/helpers/constants.js#L29 ?)

};

const extractPlatformWithOs = (platform: string) => {
const name = osMapping[platform.split('-')[0] as PlatformOS];
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rewrite it this way as a slightly more readable alternative:

const system = platform.split('-')[0];
if (system in osMapping) {
  return osMapping[system as PlatformOS];
}
return getPlatformShortName(platform);

(optional)

isFiltered: boolean;
};

export type PlatformOS =
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd remove the type from here, as it's used only once there's no reason to have an exported type. It's used only as a tool in platform.ts. So instead I'd do this in platform.ts:

type PlatformOS = keyof typeof osMapping;

So that we don't have to maintain the data in both places.

};

export const getPlatformAndVersion = (platform: string): string => {
const platformShortName = getPlatformShortName(platform);
Copy link
Contributor

Choose a reason for hiding this comment

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

you can move the call to getPlatformShortName inside the if block now, as it's used only there.
(be careful to add the brackets :D)

@esanuandra esanuandra force-pushed the add-OS-version-to-platform-column branch from f53c368 to 0ddc433 Compare January 8, 2025 13:01
@esanuandra esanuandra merged commit dc284e4 into mozilla:main Jan 8, 2025
8 checks passed
julienw added a commit that referenced this pull request Jan 15, 2025
Updates:

[Julien Wajsberg] Small adjustments on the sort functionality (#837)
[esanuandra] PCF-562 Consider adding the OS version to the name of the platform in the "Platform" column (#816)
[Carla Severe] Removed repetitive style references (#836)
[Julien Wajsberg] Rename OSX to macOS to better reflect the newest naming for this platform (#840)
[Julien Wajsberg] Extract the table filtering code to a common file (#839)
[Julien Wajsberg] Implement sorting on the main results page (#838)
[Chineta Adinnu] Add tooltips to revision column headers (#832)
[Chineta Adinnu] Add aria expanded to revision row expand button (#826)
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.

2 participants
0