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

Addition of new generated resource and data source for pkiTP #1145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shrsr
Copy link
Collaborator

@shrsr shrsr commented Jan 23, 2024

No description provided.

docs/data-sources/certificate_authority.md Outdated Show resolved Hide resolved
docs/data-sources/certificate_authority.md Outdated Show resolved Hide resolved
docs/resources/annotation.md Outdated Show resolved Hide resolved
docs/resources/annotation.md Outdated Show resolved Hide resolved
docs/resources/certificate_authority.md Outdated Show resolved Hide resolved
internal/provider/resource_aci_certificate_authority.go Outdated Show resolved Hide resolved
internal/provider/resource_aci_certificate_authority.go Outdated Show resolved Hide resolved
internal/provider/resource_aci_certificate_authority.go Outdated Show resolved Hide resolved
internal/provider/resource_aci_certificate_authority.go Outdated Show resolved Hide resolved
internal/provider/resource_aci_certificate_authority.go Outdated Show resolved Hide resolved
docs/data-sources/certificate_authority.md Outdated Show resolved Hide resolved
docs/data-sources/certificate_authority.md Outdated Show resolved Hide resolved
docs/data-sources/certificate_authority.md Outdated Show resolved Hide resolved
docs/data-sources/key_ring.md Outdated Show resolved Hide resolved
docs/data-sources/key_ring.md Outdated Show resolved Hide resolved
internal/provider/provider.go Outdated Show resolved Hide resolved
internal/provider/resource_aci_annotation.go Show resolved Hide resolved
internal/provider/resource_aci_rest_managed_test.go Outdated Show resolved Hide resolved
gen/definitions/classes.yaml Show resolved Hide resolved
gen/templates/testvars.yaml.tmpl Outdated Show resolved Hide resolved
examples/data-sources/aci_key_ring/data-source.tf Outdated Show resolved Hide resolved
gen/templates/resource_example.tf.tmpl Outdated Show resolved Hide resolved
gen/templates/resource_example_all_attributes.tf.tmpl Outdated Show resolved Hide resolved
gen/templates/resource_example_all_attributes.tf.tmpl Outdated Show resolved Hide resolved
gen/templates/resource_example_all_attributes.tf.tmpl Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
Copy link
Collaborator

@samiib samiib left a comment

Choose a reason for hiding this comment

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

When you get a chance can you please also rebase before regenerating again.

gen/definitions/properties.yaml Outdated Show resolved Hide resolved
gen/generator.go Outdated Show resolved Hide resolved
gen/generator.go Outdated Show resolved Hide resolved
gen/generator.go Show resolved Hide resolved
gen/generator.go Show resolved Hide resolved
gen/generator.go Outdated Show resolved Hide resolved
gen/generator.go Outdated Show resolved Hide resolved
gen/templates/datasource.md.tmpl Outdated Show resolved Hide resolved
gen/templates/testvars.yaml.tmpl Show resolved Hide resolved
@shrsr shrsr requested a review from lhercot March 28, 2024 13:31
gen/generator.go Show resolved Hide resolved
@shrsr shrsr requested review from sajagana and samiib March 29, 2024 15:19
anvitha-jain
anvitha-jain previously approved these changes Mar 29, 2024
Copy link
Collaborator

@anvitha-jain anvitha-jain left a comment

Choose a reason for hiding this comment

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

LGTM

gmicol
gmicol previously approved these changes Mar 29, 2024
Copy link
Collaborator

@gmicol gmicol left a comment

Choose a reason for hiding this comment

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

LGTM

sajagana
sajagana previously approved these changes Apr 1, 2024
Copy link
Collaborator

@sajagana sajagana left a comment

Choose a reason for hiding this comment

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

LGMT!

@shrsr shrsr dismissed stale reviews from sajagana, gmicol, and anvitha-jain via fbb66bb April 2, 2024 16:21
@shrsr shrsr dismissed stale reviews from sajagana and gmicol via cfdeeaa April 23, 2024 10:56
@shrsr shrsr force-pushed the key branch 2 times, most recently from bae14c2 to d66746d Compare April 24, 2024 15:50
@shrsr shrsr requested review from akinross and sajagana April 25, 2024 15:31
Copy link
Collaborator

@gmicol gmicol left a comment

Choose a reason for hiding this comment

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

Can you comment your new functions in the generator? Would be very helpful for future reference.

gen/definitions/classes.yaml Outdated Show resolved Hide resolved
gen/definitions/classes.yaml Outdated Show resolved Hide resolved
gen/templates/datasource_test.go.tmpl Outdated Show resolved Hide resolved
gen/templates/datasource_test.go.tmpl Outdated Show resolved Hide resolved
gen/templates/datasource_test.go.tmpl Outdated Show resolved Hide resolved
gen/templates/resource_test.go.tmpl Show resolved Hide resolved
gen/templates/resource_test.go.tmpl Show resolved Hide resolved
gen/templates/resource_test.go.tmpl Outdated Show resolved Hide resolved
gen/templates/resource_test.go.tmpl Outdated Show resolved Hide resolved
gen/templates/resource_test.go.tmpl Outdated Show resolved Hide resolved
@shrsr shrsr requested a review from sajagana June 7, 2024 12:52
sajagana
sajagana previously approved these changes Jun 7, 2024
Copy link
Collaborator

@sajagana sajagana left a comment

Choose a reason for hiding this comment

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

LGTM!

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 75.77497% with 422 lines in your changes missing coverage. Please review.

Project coverage is 85.52%. Comparing base (6f45104) to head (936e2a3).

Files Patch % Lines
internal/provider/resource_aci_key_ring.go 81.23% 70 Missing and 45 partials ⚠️
...nal/provider/resource_aci_certificate_authority.go 80.94% 60 Missing and 33 partials ⚠️
...rnal/provider/resource_aci_out_of_band_contract.go 41.17% 10 Missing and 10 partials ⚠️
...ernal/provider/resource_aci_pim_route_map_entry.go 41.93% 9 Missing and 9 partials ⚠️
...rnal/provider/resource_aci_l3out_consumer_label.go 42.85% 8 Missing and 8 partials ⚠️
...rnal/provider/resource_aci_l3out_provider_label.go 44.00% 7 Missing and 7 partials ⚠️
internal/provider/resource_aci_endpoint_tag_ip.go 45.45% 6 Missing and 6 partials ⚠️
internal/provider/resource_aci_endpoint_tag_mac.go 45.45% 6 Missing and 6 partials ⚠️
...al/provider/resource_aci_l3out_node_sid_profile.go 45.45% 6 Missing and 6 partials ⚠️
...al/provider/resource_aci_netflow_monitor_policy.go 53.84% 6 Missing and 6 partials ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1145      +/-   ##
==========================================
- Coverage   87.03%   85.52%   -1.52%     
==========================================
  Files          43       47       +4     
  Lines       11223    12965    +1742     
==========================================
+ Hits         9768    11088    +1320     
- Misses        991     1233     +242     
- Partials      464      644     +180     

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

Copy link
Collaborator

@samiib samiib left a comment

Choose a reason for hiding this comment

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

I fixed up the user config re-ran the CI tests and noticed that some are failing in APIC v5.2.
TestAccDataSourcePkiKeyRingWithDefault & TestAccResourcePkiKeyRingWithDefault
I suspect because the properties the error is referring to are only in v6.0+

If so, is it possible to add a new option to check version in testAccPreCheck and skip if the APIC version is not supported? Similar to cloud/apic. I think that would be okay for now instead of having multiple tests with a subset of properties in older versions which would be complicated to generate.

If this PR is already too big we can do the simple version check in a separate PR.

Also, do we have a cloud APIC that I can add to this CI that is in a good state? Just so we can run the cloud tests instead of always skipping in the CI.

@shrsr
Copy link
Collaborator Author

shrsr commented Jun 10, 2024

@samiib Thanks for running the CI test for this PR. It's a big relief that the test is passing on v6.0

Yeah, I am aware of this issue. When I introduced the test_type functionality we still didn't have a CI in place for TF resource testing that could run tests on multiple versions of APIC.

I agree. At this juncture the easy and practical solution is to skip the entire test for a resource on an older version of APIC where the test contains at least one property that is only supported on the latest version of APIC.
We need to make a few changes in the generator and the test template for this.

Yes, we have a cloud APIC but I'm not sure if we should test resources against the cAPIC since it has reached its EoL.

sajagana
sajagana previously approved these changes Jun 12, 2024
Copy link
Collaborator

@sajagana sajagana left a comment

Choose a reason for hiding this comment

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

LGTM!

samiib
samiib previously approved these changes Jun 12, 2024
Copy link
Collaborator

@samiib samiib left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for adding the version check.

anvitha-jain
anvitha-jain previously approved these changes Jun 12, 2024
docs/data-sources/netflow_monitor_policy.md Outdated Show resolved Hide resolved
// This example is only applicable to Cisco Cloud Network Controller
resource "aci_certificate_authority" "example_tenant" {
parent_dn = aci_tenant.example.id
certificate_chain = <<EOT
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you consider doing the second example with a file input example? https://developer.hashicorp.com/terraform/language/functions/file

docs/resources/certificate_authority.md Show resolved Hide resolved
docs/resources/certificate_authority.md Show resolved Hide resolved
gen/generator.go Outdated Show resolved Hide resolved
internal/provider/test_constants.go Outdated Show resolved Hide resolved

const testConfigDefaultMin = ``

const testConfigFvTenantMinDependencyWithPkiTP = testConfigFvTenantMin + `
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are these defined as constants? and not generated?

@akinross
Copy link
Collaborator

please also rebase once #1236 is merged

@shrsr shrsr dismissed stale reviews from anvitha-jain, samiib, and sajagana via f540fe4 June 14, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
8 participants