Skip to content

Commit

Permalink
Merge pull request #1072 from jfrog/fix-remote-repo-attribute-default…
Browse files Browse the repository at this point in the history
…-value

Fix incorrect default value for list_remote_folder_items attribute
  • Loading branch information
alexhung authored Sep 13, 2024
2 parents 81392ae + b1d07e3 commit 40f6de7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 12.0.0 (September 16, 2024). Tested on Artifactory 7.90.10 with Terraform 1.9.5 and OpenTofu 1.8.2

BREAKING CHANGES:

* resource/artifactory_remote_\*\_repository: Fix mismatch between documentation and actual default vaule for `list_remote_folder_items` attribute. This will also match the change (default to `false`) introduced to the REST API in Artifactory v7.94.0. **Note:** Due to limitation of the Terraform SDKv2 framework, it is not possible to detect the attribute was not set and the state has the (previous) default value of `true`, then automaticaly upgrades it to `false`. Therefore this update will introduce state drift if this attribute is not set in your configuration. Use `terraform apply -refresh-only` to update your Terraform states to match. PR: [#1072](https://github.com/jfrog/terraform-provider-artifactory/pull/1072)

## 11.9.2 (September 12, 2024). Tested on Artifactory 7.90.10 with Terraform 1.9.5 and OpenTofu 1.8.2

IMPROVEMENTS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/plancheck"
"github.com/hashicorp/terraform-plugin-testing/terraform"
"github.com/jfrog/terraform-provider-artifactory/v11/pkg/acctest"
"github.com/jfrog/terraform-provider-shared/testutil"
Expand All @@ -24,6 +23,7 @@ func TestAccRemoteRepositoryReplication_UpgradeFromSDKv2(t *testing.T) {
resource "artifactory_remote_maven_repository" "{{ .repo_name }}" {
key = "{{ .repo_name }}"
url = "https://repo1.maven.org/maven2/"
list_remote_folder_items = true
}
resource "artifactory_remote_repository_replication" "{{ .repo_name }}" {
Expand Down Expand Up @@ -60,11 +60,8 @@ func TestAccRemoteRepositoryReplication_UpgradeFromSDKv2(t *testing.T) {
{
ProtoV6ProviderFactories: acctest.ProtoV6MuxProviderFactories,
Config: config,
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectEmptyPlan(),
},
},
PlanOnly: true,
ConfigPlanChecks: testutil.ConfigPlanChecks(fqrn),
},
},
})
Expand Down
4 changes: 2 additions & 2 deletions pkg/artifactory/resource/repository/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,9 @@ var BaseRemoteRepoSchema = func(isResource bool) map[string]*schema.Schema {
"list_remote_folder_items": {
Type: schema.TypeBool,
Optional: true,
Default: true,
Default: false,
Description: "Lists the items of remote folders in simple and list browsing. The remote content is cached " +
"according to the value of the 'Retrieval Cache Period'. Default value is 'true'.",
"according to the value of the 'Retrieval Cache Period'. Default value is 'false'. This field exists in the API but not in the UI.",
},
"mismatching_mime_types_override_list": {
Type: schema.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestAccRemoteUpgradeFromVersionWithNoDisableProxyAttr(t *testing.T) {
key = "{{ .name }}"
repo_layout_ref = "go-default"
url = "https://gocenter.io"
list_remote_folder_items = true
}
`, params)
Expand Down

0 comments on commit 40f6de7

Please sign in to comment.