Skip to content

Add enable_normalized_version to NuGet repository resources#1425

Open
mawl wants to merge 1 commit into
jfrog:masterfrom
mawl:feature/1418-nuget-enable-normalized-version
Open

Add enable_normalized_version to NuGet repository resources#1425
mawl wants to merge 1 commit into
jfrog:masterfrom
mawl:feature/1418-nuget-enable-normalized-version

Conversation

@mawl

@mawl mawl commented Jun 30, 2026

Copy link
Copy Markdown

Summary

Artifactory 7.146.7 introduced a "NuGet Enforced Layout" feature via the enableNormalizedVersion field on NuGet repositories. This field was not surfaced in the Terraform provider, forcing teams to manage the setting outside Terraform (e.g. via null_resource + curl), losing drift detection and plan visibility.

Closes #1418

Changes

  • artifactory_local_nuget_repository — Framework resource; field added to model, API model, ToAPIModel, FromAPIModel, and schema with RequiresReplace
  • artifactory_remote_nuget_repository — Same Framework-based pattern
  • artifactory_virtual_nuget_repository — SDKv2 resource; field added to schema (ForceNew: true) and inline struct
  • artifactory_federated_nuget_repository — Inherits schema/struct from local; unpackLocalNugetRepository updated to read the field
  • data.artifactory_remote_nuget_repository — Field added to NugetRemoteRepo struct and NugetSchema

Immutability

The Artifactory API does not allow updating enableNormalizedVersion after repository creation. Accordingly:

  • Framework resources use boolplanmodifier.RequiresReplace()
  • SDKv2 resources use ForceNew: true

Warning

Changing this attribute on an existing repository triggers a destroy-and-recreate. Destroying a local repository deletes all of its artifacts.

Usage

resource "artifactory_local_nuget_repository" "example" {
  key                       = "my-nuget-local"
  enable_normalized_version = true
}

@mawl mawl requested a review from vasukinjfrog as a code owner June 30, 2026 13:02
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@mawl mawl force-pushed the feature/1418-nuget-enable-normalized-version branch 2 times, most recently from faaaed9 to 1599bb2 Compare June 30, 2026 13:12
@mawl

mawl commented Jun 30, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@mawl mawl marked this pull request as draft June 30, 2026 13:20
Exposes the `enableNormalizedVersion` API field introduced in Artifactory
7.146.7 for all four NuGet repository types (local, remote, virtual,
federated) and the remote NuGet datasource.

The attribute is immutable after repository creation and is marked with
RequiresReplace (Framework resources) / ForceNew (SDKv2 resources) so
Terraform forces a destroy-and-recreate when the value changes.

Closes jfrog#1418
@mawl mawl force-pushed the feature/1418-nuget-enable-normalized-version branch from 1599bb2 to 11148ad Compare June 30, 2026 13:21
@mawl mawl marked this pull request as ready for review July 1, 2026 09:25
@mawl

mawl commented Jul 1, 2026

Copy link
Copy Markdown
Author

Verified against a test Artifactory instance: enable_normalized_version now works on the NuGet repository resources.

  • terraform apply completed cleanly, with enable_normalized_version = true applied to all NuGet repos (local dev/release, virtual, shared remote/virtual) and no unrelated changes.
  • Follow-up terraform plan shows no changes — state fully converged with config.
image

@mawl

mawl commented Jul 1, 2026

Copy link
Copy Markdown
Author

Acceptance test results — enable_normalized_version (NuGet)

Run against a live Artifactory instance.

Test Package Result Time
TestAccLocalNugetRepository_EnableNormalizedVersion local ✅ PASS 2.38s
TestAccLocalNugetRepository_EnableNormalizedVersion_RequiresReplace local ✅ PASS 2.60s
TestAccRemoteNugetRepository_EnableNormalizedVersion remote ✅ PASS 2.73s
TestAccVirtualNugetRepository_PackageCreationFull virtual ✅ PASS 2.30s

4 passed, 0 failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

artifactory_local_nuget_repository missing enable_normalized_version attribute

1 participant