-
Notifications
You must be signed in to change notification settings - Fork 119
Description
The artifactory_remote_composer_repository resource generates an unnecessary terraform plan diff on every run
when vcs_git_provider is set to a non-CUSTOM value (e.g., "GITHUB") and vcs_git_download_url is not specified.
The diff shows vcs_git_download_url changing from "" to null, even though no actual change is being made.
Terraform Snippet
terraform {
required_providers {
artifactory = {
source = "jfrog/artifactory"
version = "~> 12.10.1"
}
}
}
provider "artifactory" {
# Configure with your Artifactory instance
}
resource "artifactory_remote_composer_repository" "packagist_org_composer_remote" {
key = "packagist_org_composer_remote"
url = "https://github.com/"
vcs_git_provider = "GITHUB"
composer_registry_url = "https://packagist.org"
list_remote_folder_items = true
}After initial apply, every subsequent terraform plan shows:
"unused_artifacts_cleanup_period_hours": 0,
"url": "https://github.com/",
- "vcs_git_download_url": "",
+ "vcs_git_download_url": null,
"vcs_git_provider": "GITHUB",
"xray_index": falseEnvironment Information
- Artifactory version: 7.124.1 (revision: 712401900)
- Terraform version: 1.13.2
- Terraform provider version: 12.10.1
- Product license: Enterprise (E)
- Artifactory type: Cloud (JFrog-hosted SaaS)
Expected behavior
When vcs_git_download_url is not specified and vcs_git_provider is set to a non-CUSTOM value like "GITHUB", the
provider should handle the null/empty string mismatch consistently so that no diff is generated on subsequent
plans. According to the https://jfrog.com/help/r/jfrog-rest-apis/remote-composer-repository, vcs_git_download_url
should only be set when vcs_git_provider is "CUSTOM".
Additional context
The issue appears to be that:
- The Terraform provider defaults vcs_git_download_url to null when not specified
- The Artifactory API stores/returns it as an empty string ""
- This causes Terraform to detect a diff on every plan, even though functionally nothing has changed