You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discovered while building live acceptance-test coverage for repository_firewall against a real, connected Sonatype IQ Server (#285) - TestAccRepositoryGenericProxyFirewallToggle/COMPOSER.
Enabling repository_firewall on a sonatyperepo_repository_composer_proxy resource applies successfully (no error on apply), but a subsequent refresh (e.g. a second terraform plan, or terraform-plugin-testing's built-in post-apply refresh check) shows Terraform wanting to add repository_firewall again - i.e. NXRM's GET response for the Composer proxy repository does not reflect the firewall mode that was just written.
An initial fix was applied in internal/provider/model/repository_composer.go (MapMissingApiFieldsFromPlan), mirroring the existing pattern used for Raw (#461): mirror repository_firewall from the plan when it's missing from the API response. This resolved the immediate Provider produced inconsistent result after apply error on the apply itself, but the residual drift on refresh remains - meaning this may go deeper than a read-side gap like Raw's:
It could be that NXRM's GET response for Composer proxy repositories genuinely never includes a firewall field (same class as Raw/[BUG]: Unable to update sonatyperepo_repository_*_proxy on nexus 3.94.0+ #461), in which case the existing mirror-from-plan approach is the right permanent fix and just needs to also apply consistently across refreshes, not just the immediate post-apply state.
Or the PUT/update request for Composer might not actually be applying the firewall mode server-side at all (a write-side bug, not just a read-side gap), in which case mirroring from the plan is masking real drift rather than working around a known API limitation.
These need to be distinguished (e.g. by inspecting NXRM's actual stored repository configuration for a Composer proxy repo directly, independent of this provider) before landing a complete fix.
Repro
Against a real, connected Sonatype IQ Server (TF_ACC_IQ_SERVER=1) and NXRM 3.94+:
terraform plan again (or refresh) - shows a non-empty plan wanting to add repository_firewall back, meaning NXRM's GET no longer reports it.
Evidence
Test: internal/provider/repository/repository_common_proxy_test.go - TestAccRepositoryGenericProxyFirewallToggle (Composer intentionally excluded from that table pending this fix, see the comment referencing this issue).
Describe the Issue or Bug
Discovered while building live acceptance-test coverage for
repository_firewallagainst a real, connected Sonatype IQ Server (#285) -TestAccRepositoryGenericProxyFirewallToggle/COMPOSER.Enabling
repository_firewallon asonatyperepo_repository_composer_proxyresource applies successfully (no error onapply), but a subsequent refresh (e.g. a secondterraform plan, orterraform-plugin-testing's built-in post-apply refresh check) shows Terraform wanting to addrepository_firewallagain - i.e. NXRM's GET response for the Composer proxy repository does not reflect the firewall mode that was just written.An initial fix was applied in
internal/provider/model/repository_composer.go(MapMissingApiFieldsFromPlan), mirroring the existing pattern used for Raw (#461): mirrorrepository_firewallfrom the plan when it's missing from the API response. This resolved the immediateProvider produced inconsistent result after applyerror on theapplyitself, but the residual drift on refresh remains - meaning this may go deeper than a read-side gap like Raw's:firewallfield (same class as Raw/[BUG]: Unable to updatesonatyperepo_repository_*_proxyon nexus 3.94.0+ #461), in which case the existing mirror-from-plan approach is the right permanent fix and just needs to also apply consistently across refreshes, not just the immediate post-apply state.PUT/update request for Composer might not actually be applying the firewall mode server-side at all (a write-side bug, not just a read-side gap), in which case mirroring from the plan is masking real drift rather than working around a known API limitation.These need to be distinguished (e.g. by inspecting NXRM's actual stored repository configuration for a Composer proxy repo directly, independent of this provider) before landing a complete fix.
Repro
Against a real, connected Sonatype IQ Server (
TF_ACC_IQ_SERVER=1) and NXRM 3.94+:terraform apply- succeeds.terraform planagain (or refresh) - shows a non-empty plan wanting to addrepository_firewallback, meaning NXRM's GET no longer reports it.Evidence
internal/provider/repository/repository_common_proxy_test.go-TestAccRepositoryGenericProxyFirewallToggle(Composer intentionally excluded from that table pending this fix, see the comment referencing this issue).internal/provider/model/repository_composer.go.ci/include-iq-server, PR ci: Introduce Sonatype IQ Server into Acceptance Test / HA Acc Test workflows #470).