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

feat: [M3-7158] - Update NodeJS naming to Node.js for Marketplace #11086

Merged
merged 11 commits into from
Oct 16, 2024

Conversation

carrillo-erik
Copy link
Contributor

@carrillo-erik carrillo-erik commented Oct 10, 2024

Description 📝

Updates any reference to NodeJS in Marketplace to Node.js.

Changes 🔄

List any change relevant to the reviewer.

  • Text copy in updated to include punctuation and lower case for js.

Preview 📷

Before After
Screenshot 2024-10-10 at 9 53 25 AM Screenshot 2024-10-10 at 9 53 09 AM
Screenshot 2024-10-10 at 9 53 51 AM Screenshot 2024-10-10 at 9 53 46 AM

How to test 🧪

Verification steps

(How to verify changes)

  • Visit the Marketplace tab and inspect the text copy found by clicking the info icon (i) under the following Apps.
    • NodeJS
    • OpenLiteSpeed NodeJS
  • Verify that all text copy references of NodeJS have been replaced with Node.js within the AppDetailDrawer.

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@carrillo-erik carrillo-erik self-assigned this Oct 10, 2024
@carrillo-erik carrillo-erik requested a review from a team as a code owner October 10, 2024 16:56
@carrillo-erik carrillo-erik requested review from mjac0bs and bnussman-akamai and removed request for a team October 10, 2024 16:56
Copy link

github-actions bot commented Oct 10, 2024

Coverage Report:
Base Coverage: 87.06%
Current Coverage: 87.06%

@carrillo-erik
Copy link
Contributor Author

I believe the text for the headers found in the AppSelectionCard are configured via LaunchDarkly. If this is correct, than no further code changes will be required for this PR.

Screenshot 2024-10-10 at 10 11 47 AM

@bnussman-akamai
Copy link
Member

The titles in the AppSelectionCard.tsxs actually come directly from the StackScripts endpoint. The AppCard's title is just stackscript.label with some transformation done by getMarketplaceAppLabel.

I'm thinking that, rather than updating the hardcoded name on our end, we might want update the AppDetailsDrawer to show the StackScript label rather than the hardcoded title so that the marketplace team can update what the API returns and fix title issues without any code changes.

Let me know if you have any questions on that ⬆️

The changes in the description and guides still have to be done hard-coded so those changes look good to me.

@carrillo-erik
Copy link
Contributor Author

The titles in the AppSelectionCard.tsxs actually come directly from the StackScripts endpoint. The AppCard's title is just stackscript.label with some transformation done by getMarketplaceAppLabel.

I see now, adding an additional .replace('NodeJS', 'Node.js'); would fix the title in the Card.

I'm thinking that, rather than updating the hardcoded name on our end, we might want update the AppDetailsDrawer to show the StackScript label rather than the hardcoded title so that the marketplace team can update what the API returns and fix title issues without any code changes.
The changes in the description and guides still have to be done hard-coded so those changes look good to me.

I like this idea. To coordinate this update would I make my changes and wait for the marketplace team to make their changes before merging my PR?

@bnussman-akamai
Copy link
Member

I see now, adding an additional .replace('NodeJS', 'Node.js'); would fix the title in the Card.

Right. I'm suggesting we just show the stackscrpt label rather than Cloud Manager's hardcoded name and ask the Marketplace team to update the label so that we won't need to do any client side replacement

To coordinate this update would I make my changes and wait for the marketplace team to make their changes before merging my PR?

I don't think the changes need to be super coordinated. It seems like there is already some inconsistency with NodeJS vs Node.js so I don't think it's a huge deal to coordinate

Copy link
Contributor

@pmakode-akamai pmakode-akamai left a comment

Choose a reason for hiding this comment

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

Looks good!

I'm in favor of showing the StackScript label rather than the hardcoded name as well

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

I see now, adding an additional .replace('NodeJS', 'Node.js'); would fix the title in the Card.

Right. I'm suggesting we just show the stackscrpt label rather than Cloud Manager's hardcoded name and ask the Marketplace team to update the label so that we won't need to do any client side replacement

Sounds good to me too - I like the thought of consistency with label everywhere, in the Marketplace team's control.
@carrillo-erik Something like this would show all the necessary changes in AppDetailDrawer and I imagine there will be test changes required too.

  const selectedApp = apps.find((app) => app.stackscript.id === stackScriptId);
  const displayLabel = selectedApp
    ? getMarketplaceAppLabel(selectedApp?.stackscript.label)
    : ''; // Use everywhere name was

To coordinate this update would I make my changes and wait for the marketplace team to make their changes before merging my PR?

I don't think the changes need to be super coordinated. It seems like there is already some inconsistency with NodeJS vs Node.js so I don't think it's a huge deal to coordinate

Agreed. I would reach out to @hmorris3293 or @tbaka-akamai internally to make sure they're aware of this change and see no issue with it, then we can revert this PR's current changes to name and they can finish the label updates on their end. We could clean up of all oneClickAppsv2.ts names in a separate PR, but I don't think it would be too much scope creep to do it in this one.

@tbaka-akamai
Copy link
Contributor

howdy @mjac0bs updating the label is trivial on our end. We went ahead and made the change for Node.JS and Openlitespeed Node.JS on the backend. It appears to render correctly in the Cloud Manager.
Screenshot 2024-10-15 at 9 24 41 AM

@carrillo-erik
Copy link
Contributor Author

carrillo-erik commented Oct 15, 2024

howdy @mjac0bs updating the label is trivial on our end. We went ahead and made the change for Node.JS and Openlitespeed Node.JS on the backend. It appears to render correctly in the Cloud Manager. Screenshot 2024-10-15 at 9 24 41 AM

@tbaka-akamai Thanks for the quick turnaround on this, there's only one minor change is that the JS after the period should be lower-case. The cards should read Node.js and OpenLiteSpeed Node.js.

@tbaka-akamai
Copy link
Contributor

No problem @carrillo-erik. I have updated the casing on the labels.

@carrillo-erik
Copy link
Contributor Author

@bnussman-akamai @mjac0bs
I've reverted the changes to the hardcoded name property but kept the changes to the summary, description, and related_guides. Additionally, @tbaka-akamai did some updates which fix the title for Node.js and OpenLiteSpeed Node.js in the AppSelectionCard component.

Next, I will complete the following steps.

  1. Update the utility function getMarketplaceAppLabel() so that we won't need to do any client side replacement
    as requested by @bnussman-akamai.
    export const getMarketplaceAppLabel = (label: string) => decode(label);
  2. Implement the changes and updates to tests in AppDetailDrawer as requested by @mjac0bs.
const selectedApp = apps.find((app) => app.stackscript.id === stackScriptId);
const displayLabel = selectedApp
? getMarketplaceAppLabel(selectedApp?.stackscript.label)
: ''; // Use everywhere name was
  1. Clean up of all names in oneClickAppsv2.ts as requested by @mjac0bs.

However, I'd like some further clarification with this statement to better understand how to effectively close this PR:

then we can revert this PR's current changes to name and they can finish the label updates on their end.

@mjac0bs
Copy link
Contributor

mjac0bs commented Oct 15, 2024

However, I'd like some further clarification with this statement to better understand how to effectively close this PR:

then we can revert this PR's current changes to name and they can finish the label updates on their end.

@carrillo-erik - you reverted the changes to the hardcoded name property and Travis has updated the labels, as per his comments above, so this part is done. 👍🏼

@carrillo-erik carrillo-erik requested a review from a team as a code owner October 15, 2024 23:30
@carrillo-erik carrillo-erik requested review from cliu-akamai and removed request for a team October 15, 2024 23:30
Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

✅ Node.js is capitalized correctly everywhere it is used.
✅ We are consistently using the stackscript label (with our standard manipulation via the util) rather than the hardcoded name. We still use the util because all OCA stackscripts contain some extra information in the label that we don't want to display to the user.
✅ We removed the hardcoded name from oneClickAppsv2.ts without regressions.
✅ Tests pass - CI failures were unrelated, though the support ticket one could have been resolved by merging in the latest develop

Comment on lines 41 to 43
const displayLabel = stackscript
? getMarketplaceAppLabel(stackscript.label)
: '';
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this below the if statement? No need to fallback to an empty string

Suggested change
const displayLabel = stackscript
? getMarketplaceAppLabel(stackscript.label)
: '';
const displayLabel = getMarketplaceAppLabel(stackscript.label);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moving this line above the if statement would lead to a scope error for displayLabel as it is used in the error message that we throw on Lines 46-47.

You have to scroll far into the right to see it:
We expected that StackScript to be in the response for the Marketplace app named "${displayLabel}".

Copy link
Member

@bnussman-akamai bnussman-akamai Oct 16, 2024

Choose a reason for hiding this comment

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

Right, but wouldn't displayLabel be an empty string if that error was thrown? If that's the case, we might aswell just remove that sentence from the error message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could change the error message to:
Cloud Manager's fetch to GET /v4/linode/stackscripts did not receive a StackScript with ID ${stackscriptId}. We expected a StackScript to be in the response.
This would allow us to make the change you suggested, resolve the empty string, and the deal with the variable scope error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wrote the last comment before noticing you had edited your comment above. I removed the stackscript.label reference from the error message.

Copy link
Member

Choose a reason for hiding this comment

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

Nice. Looks great now!

@@ -11,7 +11,6 @@ export interface OCA {
*/
isNew?: boolean;
logo_url: string;
name: string;
Copy link
Member

Choose a reason for hiding this comment

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

This is great 👏 🎉

Less hardcoded stuff === 😄

Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

Looks good pending the clean up in one-click-apps.spec.ts

Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

Thanks @carrillo-erik! +1 to @bnussman-akamai's suggestion to move the const declaration but otherwise tests look (and run) great!

@carrillo-erik carrillo-erik merged commit dda6bf9 into linode:develop Oct 16, 2024
21 of 23 checks passed
Copy link

cypress bot commented Oct 16, 2024

Cloud Manager E2E    Run #6688

Run Properties:  status check passed Passed #6688  •  git commit dda6bf987b: feat: [M3-7158] - Update NodeJS naming to Node.js for Marketplace (#11086)
Project Cloud Manager E2E
Run status status check passed Passed #6688
Run duration 26m 48s
Commit git commit dda6bf987b: feat: [M3-7158] - Update NodeJS naming to Node.js for Marketplace (#11086)
Committer carrillo-erik
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 4
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 437

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.

6 participants