Skip to content

Commit

Permalink
Merge branch 'jfrogGH-621-bulk-import' of github.com:chb0github/terra…
Browse files Browse the repository at this point in the history
…form-provider-artifactory into jfrogGH-621-bulk-import

* 'jfrogGH-621-bulk-import' of github.com:chb0github/terraform-provider-artifactory:
  fix store_artifacts_locally docs to reflect reality
  JFrog Pipelines - Add Artifactory version to CHANGELOG.md
  Update CHANGELOG
  Update module path from 'v8' to 'v9'
  Add planmodifier.RequiresReplace() to "key" attribute
  Update CHANGELOG
  Migrate 'artifactory_backup' resource to terraform-plugin-framework
  Update CHANGELOG
  Update validation for "project_environments" to allow empty list
  Update documentation
  JFrog Pipelines - Add Artifactory version to CHANGELOG.md
  Update CHANGELOG
  Add "force_conan_authentication" attribute to local, virtual, and federated repo resources and data sources
  • Loading branch information
chb0github committed Oct 4, 2023
2 parents 587b1f7 + 9628090 commit cbf1835
Show file tree
Hide file tree
Showing 175 changed files with 1,321 additions and 584 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 9.2.1 (Sep 29, 2023). Tested on Artifactory 7.68.11 with Terraform CLI v1.5.7

IMPROVEMENTS:

* Update module path to `/v9` PR: [#814](https://github.com/jfrog/terraform-provider-artifactory/pull/814)

## 9.2.0 (Sep 28, 2023). Tested on Artifactory 7.68.11 with Terraform CLI v1.5.7

IMPROVEMENTS:

* resource/artifactory_backup is migrated to Plugin Framework. PR: [#812](https://github.com/jfrog/terraform-provider-artifactory/pull/812)

## 9.1.0 (Sep 28, 2023). Tested on Artifactory 7.68.11 with Terraform CLI v1.5.7

IMPROVEMENTS:
* data/artifactory_local_conan_repository, data/artifactory_virtual_conan_repository, data/artifactory_federated_conan_repository, resource/artifactory_local_conan_repository, resource/artifactory_virtual_conan_repository, resource/artifactory_federated_conan_repository: add `force_conan_authentication` attribute PR: [#810](https://github.com/jfrog/terraform-provider-artifactory/pull/810) Issue: [#808](https://github.com/jfrog/terraform-provider-artifactory/issues/808)
* resource/artifactory_\*\_repository: update validation for `project_environments` attribute to allow empty list. PR: [#811](https://github.com/jfrog/terraform-provider-artifactory/pull/811)

## 9.0.0 (Sep 15, 2023). Tested on Artifactory 7.68.7 with Terraform CLI v1.5.7

IMPROVEMENTS:
Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/local_conan_repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ The following attributes are supported along with the [common list of attributes
* `key` - the identity key of the repo.
* `description`
* `notes`
* `force_conan_authentication` - Force basic authentication credentials in order to use this repository.
Default is `false`.
2 changes: 2 additions & 0 deletions docs/data-sources/virtual_conan_repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ The following argument is supported:
The following attributes are supported, along with the [common list of arguments for the virtual repositories](../resources/virtual.md):

* `retrieval_cache_period_seconds` - (Optional, Default: `7200`) This value refers to the number of seconds to cache metadata files before checking for newer versions on aggregated repositories. A value of 0 indicates no caching.
* `force_conan_authentication` - Force basic authentication credentials in order to use this repository.
Default is `false`.
6 changes: 2 additions & 4 deletions docs/resources/local.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ contain spaces or special characters.
* `description` - (Optional)
* `notes` - (Optional)
* `project_key` - (Optional) Project key for assigning this repository to. Must be 2 - 20 lowercase alphanumeric and hyphen characters. When assigning repository to a project, repository key must be prefixed with project key, separated by a dash. We don't recommend using this attribute to assign the repository to the project. Use the `repos` attribute in Project provider to manage the list of repositories.
* `project_environments` - (Optional) Project environment for assigning this repository to. Allow values: `DEV` or `PROD`.
* `project_environments` - (Optional) Project environment for assigning this repository to. Allow values: `DEV`, `PROD`, or one of custom environment.
Before Artifactory 7.53.1, up to 2 values (`DEV` and `PROD`) are allowed. From 7.53.1 onward, only one value is allowed.
The attribute should only be used if the repository is already assigned to the existing project.
If not, the attribute will be ignored by Artifactory, but will remain in the Terraform state, which will create state
drift during the update.
The attribute should only be used if the repository is already assigned to the existing project. If not, the attribute will be ignored by Artifactory, but will remain in the Terraform state, which will create state drift during the update.
* `includes_pattern` - (Optional) List of artifact patterns to include when evaluating artifact requests in the form
of x/y/**/z/\*. When used, only artifacts matching one of the include patterns are served. By default, all artifacts are included (\*\*/*).
* `excludes_pattern` - (Optional) List of artifact patterns to exclude when evaluating artifact requests, in the form
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/local_conan_repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The following arguments are supported, along with the [common list of arguments
* `key` - (Required) the identity key of the repo.
* `description` - (Optional)
* `notes` - (Optional)

* `force_conan_authentication` - (Optional) Force basic authentication credentials in order to use this repository. Default value is `false`.


## Import
Expand Down
8 changes: 3 additions & 5 deletions docs/resources/remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ All generic repo arguments are supported, in addition to:
* `description` - (Optional) Public description.
* `notes` - (Optional) Internal description.
* `project_key` - (Optional) Project key for assigning this repository to. Must be 2 - 20 lowercase alphanumeric and hyphen characters. When assigning repository to a project, repository key must be prefixed with project key, separated by a dash. We don't recommend using this attribute to assign the repository to the project. Use the `repos` attribute in Project provider to manage the list of repositories.
* `project_environments` - (Optional) Project environment for assigning this repository to. Allow values: `DEV` or `PROD`.
* `project_environments` - (Optional) Project environment for assigning this repository to. Allow values: `DEV`, `PROD`, or one of custom environment.
Before Artifactory 7.53.1, up to 2 values (`DEV` and `PROD`) are allowed. From 7.53.1 onward, only one value is allowed.
The attribute should only be used if the repository is already assigned to the existing project.
If not, the attribute will be ignored by Artifactory, but will remain in the Terraform state, which will create state
drift during the update.
The attribute should only be used if the repository is already assigned to the existing project. If not, the attribute will be ignored by Artifactory, but will remain in the Terraform state, which will create state drift during the update.
* `url` - (Required) The remote repo URL.
* `username` - (Optional)
* `password` - (Optional)
Expand All @@ -56,7 +54,7 @@ All generic repo arguments are supported, in addition to:
* `offline` - (Optional, Default: `false`) If set, Artifactory does not try to fetch remote artifacts. Only locally-cached artifacts are retrieved.
* `blacked_out` - (Optional) (A.K.A 'Ignore Repository' on the UI) When set, the repository or its local cache do not participate in artifact resolution. Default is `false`.
* `xray_index` - (Optional, Default: `false`) Enable Indexing In Xray. Repository will be indexed with the default retention period. You will be able to change it via Xray settings. Default is `false`.
* `store_artifacts_locally` - (Optional, Default: `false`) When set, the repository should store cached artifacts locally. When not set, artifacts are not stored locally, and direct repository-to-client streaming is used. This can be useful for multi-server setups over a high-speed LAN, with one Artifactory caching certain data on central storage, and streaming it directly to satellite pass-though Artifactory servers.
* `store_artifacts_locally` - (Optional, Default: `true`) When set, the repository should store cached artifacts locally. When not set, artifacts are not stored locally, and direct repository-to-client streaming is used. This can be useful for multi-server setups over a high-speed LAN, with one Artifactory caching certain data on central storage, and streaming it directly to satellite pass-though Artifactory servers.
* `socket_timeout_millis` - (Optional, Default: `15000`) Network timeout (in ms) to use when establishing a connection and for unanswered requests. Timing out on a network operation is considered a retrieval failure.
* `local_address` - (Optional) The local address to be used when creating connections. Useful for specifying the interface to use on systems with multiple network interfaces.
* `retrieval_cache_period_seconds` - (Optional, Default: `7200`) The metadataRetrievalTimeoutSecs field not allowed to be bigger then retrievalCachePeriodSecs field.
Expand Down
6 changes: 2 additions & 4 deletions docs/resources/virtual.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ The following arguments are supported:
contain spaces or special characters.
* `repositories` - (Optional) The effective list of actual repositories included in this virtual repository.
* `project_key` - (Optional) Project key for assigning this repository to. Must be 2 - 20 lowercase alphanumeric and hyphen characters. When assigning repository to a project, repository key must be prefixed with project key, separated by a dash. We don't recommend using this attribute to assign the repository to the project. Use the `repos` attribute in Project provider to manage the list of repositories.
* `project_environments` - (Optional) Project environment for assigning this repository to. Allow values: `DEV` or `PROD`.
* `project_environments` - (Optional) Project environment for assigning this repository to. Allow values: `DEV`, `PROD`, or one of custom environment.
Before Artifactory 7.53.1, up to 2 values (`DEV` and `PROD`) are allowed. From 7.53.1 onward, only one value is allowed.
The attribute should only be used if the repository is already assigned to the existing project.
If not, the attribute will be ignored by Artifactory, but will remain in the Terraform state, which will create state
drift during the update.
The attribute should only be used if the repository is already assigned to the existing project. If not, the attribute will be ignored by Artifactory, but will remain in the Terraform state, which will create state drift during the update.
* `description` - (Optional)
* `notes` - (Optional)
* `includes_pattern` - (Optional) List of artifact patterns to include when evaluating artifact requests in the form of x/y/\*\*/z/\*. When used, only artifacts matching one of the include patterns are served. By default, all artifacts are included (**/\*).
Expand Down
1 change: 1 addition & 0 deletions docs/resources/virtual_conan_repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The following arguments are supported, along with the [common list of arguments
* `description` - (Optional)
* `notes` - (Optional)
* `retrieval_cache_period_seconds` - (Optional, Default: `7200`) This value refers to the number of seconds to cache metadata files before checking for newer versions on aggregated repositories. A value of 0 indicates no caching.
* `force_conan_authentication` - (Optional) Force basic authentication credentials in order to use this repository. Default value is `false`.

## Import

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/jfrog/terraform-provider-artifactory/v8
module github.com/jfrog/terraform-provider-artifactory/v9

// if you need to do local dev, literally just uncomment the line below
// replace github.com/jfrog/terraform-provider-shared => ../terraform-provider-shared
Expand All @@ -16,7 +16,7 @@ require (
github.com/hashicorp/terraform-plugin-mux v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0
github.com/hashicorp/terraform-plugin-testing v1.5.1
github.com/jfrog/terraform-provider-shared v1.17.0
github.com/jfrog/terraform-provider-shared v1.19.0
github.com/sethvargo/go-password v0.2.0
github.com/stretchr/testify v1.7.2
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jfrog/terraform-provider-shared v1.17.0 h1:WrzsoilWGn1gvh1c83m4YhSdh7XH2Fkw9Q7P4tcWN20=
github.com/jfrog/terraform-provider-shared v1.17.0/go.mod h1:JvTKRAXMQyX6gQjESY+YK2lJLeW8uKTVHar5HDTnvp0=
github.com/jfrog/terraform-provider-shared v1.19.0 h1:4/CgvSTqhf00eHMo8q+xL2/N8Lng7T+Pw5GbNSUwxRs=
github.com/jfrog/terraform-provider-shared v1.19.0/go.mod h1:JvTKRAXMQyX6gQjESY+YK2lJLeW8uKTVHar5HDTnvp0=
github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/terraform-plugin-go/tfprotov5"
"github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server"
"github.com/hashicorp/terraform-plugin-mux/tf5muxserver"
provider "github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/provider"
provider "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/provider"
)

// Run the docs generation tool, check its repository for more information on how it works and how docs
Expand Down
8 changes: 4 additions & 4 deletions pkg/acctest/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"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/v8/pkg/artifactory/provider"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/configuration"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/user"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/provider"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/configuration"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/user"
"github.com/jfrog/terraform-provider-shared/client"
"github.com/jfrog/terraform-provider-shared/testutil"
utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/go-resty/resty/v2"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/terraform"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/acctest"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/datasource"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/acctest"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/datasource"
"github.com/jfrog/terraform-provider-shared/testutil"
"github.com/stretchr/testify/assert"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk"

"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository"
)

func ArtifactoryFileInfo() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package federated

import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/datasource/repository"
resource_repository "github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository/federated"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository/local"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/datasource/repository"
resource_repository "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository/federated"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository/local"
"github.com/jfrog/terraform-provider-shared/packer"
"github.com/jfrog/terraform-provider-shared/predicate"
utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package federated

import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/datasource/repository"
resource_repository "github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository/federated"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository/local"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/datasource/repository"
resource_repository "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository/federated"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository/local"
"github.com/jfrog/terraform-provider-shared/packer"
"github.com/jfrog/terraform-provider-shared/predicate"
utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package federated

import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/datasource/repository"
resource_repository "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository/federated"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository/local"
"github.com/jfrog/terraform-provider-shared/packer"
"github.com/jfrog/terraform-provider-shared/predicate"
utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk"
)

func DataSourceArtifactoryFederatedConanRepository() *schema.Resource {
conanSchema := utilsdk.MergeMaps(
local.ConanSchema,
memberSchema,
resource_repository.RepoLayoutRefSchema(rclass, resource_repository.ConanPackageType),
)

var packConanMembers = func(repo interface{}, d *schema.ResourceData) error {
members := repo.(*federated.ConanRepositoryParams).Members
return federated.PackMembers(members, d)
}

pkr := packer.Compose(
packer.Universal(
predicate.All(
predicate.NoClass,
predicate.Ignore("member", "terraform_type", "enable_conan_support"),
),
),
packConanMembers,
)

constructor := func() (interface{}, error) {
return &federated.ConanRepositoryParams{
ConanRepoParams: local.ConanRepoParams{
RepositoryBaseParams: local.RepositoryBaseParams{
PackageType: resource_repository.ConanPackageType,
Rclass: rclass,
},
},
}, nil
}

return &schema.Resource{
Schema: conanSchema,
ReadContext: repository.MkRepoReadDataSource(pkr, constructor),
Description: "Provides a data source for a federated Conan repository",
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package federated

import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/datasource/repository"
resource_repository "github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository/federated"
"github.com/jfrog/terraform-provider-artifactory/v8/pkg/artifactory/resource/repository/local"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/datasource/repository"
resource_repository "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository/federated"
"github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository/local"
"github.com/jfrog/terraform-provider-shared/packer"
"github.com/jfrog/terraform-provider-shared/predicate"
utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk"
Expand Down
Loading

0 comments on commit cbf1835

Please sign in to comment.