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

fix: [M3-8538] - Incorrect Commands in Linode CLI Modal #11303

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

carrillo-erik
Copy link
Contributor

@carrillo-erik carrillo-erik commented Nov 21, 2024

Description 📝

This PR addresses the issue within the LinodeCLI modal which errornously displayed the create command when a user was going through the clone workflow. A subsequent issue was discovered impacting the cURL utility. In this case the incorrect url path was being used and a source Linode ID was not being provided.

Changes 🔄

List any change(s) relevant to the reviewer.

  • Updates to the generateCLICommand() utility function to generate the expected commands based on create or clone workflows.
  • Updates to the generateCurlCommand() utility function to generate the correct url path which will be used to send the payload.

Preview 📷

Before After
clone-cli-prod clone-cli-pr-branch
clone-curl-prod clone-curl-branch-pr

How to test 🧪

Prerequisites

(How to setup test environment)

  • Have the LinodeCLI tool configured locally.
  • Have at least one Linode instance on the account.

Reproduction steps

(How to reproduce the issue, if applicable)

  • In production, visit the page to create a new Linode instance.
    • Fill out the form fields to create a Linode.
    • Scroll to the bottom of the page and click on the View Code Snippets button.
    • Inspect the commands generated for the Linode CLI and cURL tabs.
  • Next, click on the Clone Linode tab
    • Select the Linode instance you'd like to clone.
    • Scroll to the bottom of the page and click on the View Code Snippets button.
    • Inspect the commands generated for the Linode CLI and cURL tabs.

Verification steps

(How to verify changes)

  • Check out this branch and go through the same steps as above.
  • Inspect the respective commands generated and presented to the user in the LinodeCLI modal for the create and clone workflows.
  • Verify that the changes match the images above.
  • Paste the commands onto your terminal running the LinodeCLI and verify that all workflows behave as expected.

As an Author, I have considered 🤔

  • 👀 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 Nov 21, 2024
@carrillo-erik carrillo-erik requested a review from a team as a code owner November 21, 2024 17:08
@carrillo-erik carrillo-erik requested review from mjac0bs and cpathipa and removed request for a team November 21, 2024 17:08
@carrillo-erik carrillo-erik requested a review from mjac0bs December 3, 2024 18:01
Copy link

github-actions bot commented Dec 3, 2024

Coverage Report:
Base Coverage: 86.85%
Current Coverage: 86.84%

@carrillo-erik carrillo-erik added Add'tl Approval Needed Waiting on another approval! Ready for Review and removed Missing Changeset Add'tl Approval Needed Waiting on another approval! labels Dec 5, 2024
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🎉 462 passing tests on test run #4 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing462 Passing2 Skipped101m 37s

Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

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

Confirming was able to clone linode using cURL

image

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.

Thanks for addressing feedback. I was able to confirm both clone commands work as long as a firewall isn't attached. @carrillo-erik and @cpathipa - did either of you run into the same issue with adding a firewall when cloning and using cURL? This may be something we need to bring up with the DX team as a CLI bug, since cURL supports it.

Assuming the issue is on the CLI's end, our commands seem correct here.

I couldn't replicate the issue I had when testing this PR previously where Linode create with firewall failed.

Header Header
Linode create w/ firewall ✅ linodecreatefirewall_cli_curl
Linode clone CLI w/ firewall ❌, Linode clone CLI w/o firewall ✅ linodeclone_nofirewall_cli
Linode clone cURL w/ firewall ✅ linodeclonefirewall

(All linodes deleted after testing since passwords are exposed.)

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Dec 6, 2024
@cpathipa
Copy link
Contributor

Thanks for addressing feedback. I was able to confirm both clone commands work as long as a firewall isn't attached. @carrillo-erik and @cpathipa - did either of you run into the same issue with adding a firewall when cloning and using cURL? This may be something we need to bring up with the DX team as a CLI bug, since cURL supports it.

Assuming the issue is on the CLI's end, our commands seem correct here.

I couldn't replicate the issue I had when testing this PR previously where Linode create with firewall failed.

Header Header
Linode create w/ firewall ✅ linodecreatefirewall_cli_curl
Linode clone CLI w/ firewall ❌, Linode clone CLI w/o firewall ✅ linodeclone_nofirewall_cli
Linode clone cURL w/ firewall ✅ linodeclonefirewall
(All linodes deleted after testing since passwords are exposed.)

@mjac0bs I haven't tried with firewall. We should syc with DX team on this. (Can be handled separately)
cc: @carrillo-erik

@carrillo-erik carrillo-erik merged commit 81e55d5 into linode:develop Dec 10, 2024
23 checks passed
Copy link

cypress bot commented Dec 10, 2024

Cloud Manager E2E    Run #6945

Run Properties:  status check failed Failed #6945  •  git commit 81e55d59fb: fix: [M3-8538] - Incorrect Commands in Linode CLI Modal (#11303)
Project Cloud Manager E2E
Branch Review develop
Run status status check failed Failed #6945
Run duration 31m 30s
Commit git commit 81e55d59fb: fix: [M3-8538] - Incorrect Commands in Linode CLI Modal (#11303)
Committer carrillo-erik
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 1
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 466
View all changes introduced in this branch ↗︎

Tests for review

Failed  cypress/e2e/core/linodes/clone-linode.spec.ts • 1 failed test

View Output Video

Test Artifacts
clone linode > can clone a Linode from Linode details page Screenshots Video
Flakiness  cypress/e2e/core/linodes/linode-config.spec.ts • 1 flaky test

View Output Video

Test Artifacts
Linode Config management > End-to-End > Clones a config Screenshots Video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants