jfrog / terraform-provider-xray

Terraform provider to manage JFrog Xray
https://jfrog.com/xray/
Apache License 2.0
149 stars 12 forks source link

Patterns do not work with release bundles V2 indexing configuration #226

Closed Sam13 closed 1 month ago

Sam13 commented 1 month ago

Describe the bug Found while testing the feature https://github.com/jfrog/terraform-provider-xray/issues/220 https://github.com/jfrog/terraform-provider-xray/pull/222

Adding all release bundles (*/**) to the indexing configuration does not work. For builds (https://registry.terraform.io/providers/jfrog/xray/latest/docs/resources/binary_manager_builds) it does. Error:

   │ Error: Provider produced inconsistent result after apply
   │ 
   │ When applying changes to
   │ xray_binary_manager_release_bundles_v2.xray_myproj_indexed_resources_release_bundles_v2,
   │ provider "provider[\"registry.terraform.io/jfrog/xray\"]" produced an
   │ unexpected new value: .indexed_release_bundle_v2: planned set element
   │ cty.StringVal("*/**") does not correlate with any element in actual.
   │ 
   │ This is a bug in the provider, which should be reported in the provider's
   │ own issue tracker.

image

Requirements for and issue

cdktf --version 0.20.8


**Expected behavior**
Pattern support for release bundles V2 indexing configuration must be possible

**Additional context**
Import did not recognize patterns as well - it imported an existing release bundle which was not selected
alexhung commented 1 month ago

@Sam13 Thanks for the report. The REST API currently does not support the use of patterns. The POST and PUT APIs will accept */** happily but has no effect. If you set the patterns in the UI, the GET API returns the actual list of release bundles instead.

Until the API supports patterns, you will need to specify the release bundle names in the list.

I'll update the doc to make this clear.

Sam13 commented 1 month ago

@alexhung How does the web UI configure the system? According my knowledge from the JFrog academy the UI only uses the REST APIs to configure the system. Are there any plans to fix/add pattern support to the API?

alexhung commented 1 month ago

@Sam13 The web UI uses its own set of private/UI only APIs.

I'll open a feature request ticket with the Xray team.