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

hotfix: [M3-7085] Edit VLAN config validation bug #9644

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

abailly-akamai
Copy link
Contributor

Description 📝

Latest API release was responsible for exposing an issue with our validation schema when editing a linode config.

NOTE: I will write an e2e test to cover this issue in a subsequent PR

Our config interfaces properly types interface.label and interface.ipam_address as string | null, however our yup schema validation (which apparently never encountered a null value before) was throwing an error.

Screenshot 2023-09-06 at 08 58 36

This is due to the fact that the API now seems to return a default public record (brand new Linode created with VLAN) in the interface array which has null ipam_address & label.

⚠️ I am wondering if this is the desired behavior (because of this it is impossible to add a new public interface when editing - you will get an "Only one public interface per config is allowed." error). CC @jaalah @jcallahan-akamai @bnussman

ex payload for config interfaces with a newly created linode with VLAN

"interfaces": [
        {
          "id": 659956,
          "purpose": "public",
          "ipam_address": null,
          "label": null
        },
        {
          "id": 659957,
          "purpose": "vlan",
          "ipam_address": "",
          "label": "testvlan"
        }
      ]

Wether or not this is intended, our validation schema should still be able to handle null values as defined by our types so this PR should be relevant nonetheless.

Major Changes 🔄

  • Allow null interface record label & ipam_address to go through YUP validation

How to test 🧪

  1. Pull code locally
  2. Create a new Linode with an attached VLAN
  3. Navigate to /linodes/49433992/configurations and edit config
    Screenshot 2023-09-07 at 09 53 40
  4. Try saving the form and confirm no errors in the console and PUT config API request succeeds

@abailly-akamai abailly-akamai self-assigned this Sep 7, 2023
@abailly-akamai abailly-akamai marked this pull request as ready for review September 7, 2023 16:41
@jaalah-akamai jaalah-akamai added the Hotfix Hotfix: This is going to staging label Sep 7, 2023
@jaalah-akamai jaalah-akamai changed the title fix: [M3-7085] Edit VLAN config validation bug hotfix: [M3-7085] Edit VLAN config validation bug Sep 7, 2023
@abailly-akamai abailly-akamai merged commit d74fb32 into staging Sep 7, 2023
13 checks passed
@bnussman-akamai bnussman-akamai deleted the fix-M3-7085-staging branch September 8, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hotfix Hotfix: This is going to staging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants