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: (CXF 90011) Updating Metal & Fabric Provider with NIMF functionality #626

Merged
merged 11 commits into from
Apr 1, 2024

Conversation

srushti-patl
Copy link
Contributor

@srushti-patl srushti-patl commented Mar 22, 2024

  • Added authorization_code to metal_interconnection schema.
  • Added buildSharedPortVCVLANCreateRequest() function for the connection type shared_port_vlan request.
  • Added DataSource and Resource Acc Tests for Vlan Port Share functionality.
  • Added "METAL_NETWORK" to Fabric connection Access Point Type schema
  • Updated Fabric Go SDK Version to 0.9.0

@srushti-patl srushti-patl requested a review from a team as a code owner March 22, 2024 22:35
@srushti-patl srushti-patl changed the title CXF 90011: Updating Metal Provider with NIMF functionality fix: (CXF 90011) Updating Metal Provider with NIMF functionality Mar 22, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 79.24528% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 60.96%. Comparing base (4d0b305) to head (b225209).

Files Patch % Lines
internal/resources/metal/connection/resource.go 71.79% 9 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #626       +/-   ##
===========================================
+ Coverage   38.00%   60.96%   +22.95%     
===========================================
  Files         120      120               
  Lines       19428    19476       +48     
===========================================
+ Hits         7384    11873     +4489     
+ Misses      11836     7034     -4802     
- Partials      208      569      +361     

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

@ctreatma
Copy link
Contributor

IMO this should have the feat tag instead of fix, since it's adding a previously unsupported feature, not fixing a feature that was already supported in the provider.

@srushti-patl srushti-patl requested a review from 0xch4z March 26, 2024 16:55
@srushti-patl srushti-patl changed the title fix: (CXF 90011) Updating Metal Provider with NIMF functionality feat: (CXF 90011) Updating Metal Provider with NIMF functionality Mar 26, 2024
@srushti-patl srushti-patl requested review from a team as code owners March 26, 2024 21:08
@srushti-patl srushti-patl changed the title feat: (CXF 90011) Updating Metal Provider with NIMF functionality feat: (CXF 90011) Updating Metal & Fabric Provider with NIMF functionality Mar 26, 2024
resource.TestCheckResourceAttr(
"equinix_metal_connection.test", "metro", "sv"),
resource.TestCheckResourceAttr(
"equinix_metal_connection.test", "contact_email", "tfacc@example.com"),

Choose a reason for hiding this comment

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

Should we test that the authorization_code is populated here?

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 have added authorization_code parameter check in acc tests

Copy link

@adammohammed adammohammed left a comment

Choose a reason for hiding this comment

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

Will there be a related PR for the Metal2SpAws create body on the Fabric /connections API?

@srushti-patl
Copy link
Contributor Author

Will there be a related PR for the Metal2SpAws create body on the Fabric /connections API?

We have included the required Fabric Provider changes in this PR only. There is only one change required in the Fabric Provider to support NIMF functionality.
This is the PR for Metal 2 AWS example: https://github.com/equinix/terraform-equinix-fabric/pull/34/files

Copy link
Contributor

@thogarty thogarty left a comment

Choose a reason for hiding this comment

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

LGTM for Fabric changes. Metal side looks good as well but leaving that for those who have more familiarity with the product side of things.

@0xch4z
Copy link
Member

0xch4z commented Mar 29, 2024

might need a rebase, but LGTM

go.mod Outdated Show resolved Hide resolved
Copy link
Contributor

@ctreatma ctreatma left a comment

Choose a reason for hiding this comment

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

I had one question about the fabric-go upgrade, and I don't see the changes Adam suggested for testing that the authorization_code attribute has a value.

@srushti-patl
Copy link
Contributor Author

I had one question about the fabric-go upgrade, and I don't see the changes Adam suggested for testing that the authorization_code attribute has a value.

I had one question about the fabric-go upgrade, and I don't see the changes Adam suggested for testing that the authorization_code attribute has a value.

I have upgraded fabric-go-sdk version to 0.9.0 and I have already added authorization_code parameter check in metal connection resource and data source acc tests with TestCheckResourceAttrSet() function as authorization_code's value is dynamic.

@srushti-patl srushti-patl requested review from ctreatma and 0xch4z March 29, 2024 22:09
@adammohammed
Copy link

@ctreatma I see it now, the addition of METAL_NETWORK is all that was required on the Fabric side, since it already had the authentication_key field from other request bodies.

Copy link

@adammohammed adammohammed left a comment

Choose a reason for hiding this comment

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

LGTM, though there are some failing acceptance tests

@srushti-patl
Copy link
Contributor Author

Screenshots of resource and data source Acceptance tests passing locally.
The Metal Acceptance test case workflow failing for these two test cases because the user is not whitelisted for NIMF functionality.

Screenshot 2024-04-01 at 10 50 04 AM Screenshot 2024-04-01 at 10 54 30 AM

@ctreatma
Copy link
Contributor

ctreatma commented Apr 1, 2024

@adammohammed how can we add the CI user to the allow list for NIMF?

@adammohammed
Copy link

adammohammed commented Apr 1, 2024

@ctreatma on it. @srushti-patl the CI organization should have this feature available to it now. We should be able to re-run the tests.

@srushti-patl srushti-patl requested a deployment to internal April 1, 2024 19:44 — with GitHub Actions Abandoned
Copy link
Contributor

@ctreatma ctreatma 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 the new tests passing in run #2 of the Metal acceptance tests. Test failures are all in unrelated tests due to platform capacity ("no available servers in metro"), or tests using recently-disabled features ("facility is not supported"), or tests that are known to flake (spot market tests).

@srushti-patl srushti-patl merged commit d63009a into main Apr 1, 2024
7 of 10 checks passed
@srushti-patl srushti-patl deleted the CXF-90011-Metal-NIMF-Update branch April 1, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants