Describe the bug
The xray_ignore_rule resource does not detect soft-deleted ignore rules. When a rule is deleted (via UI, API, or another Terraform workspace), the Xray API returns HTTP 200 with deleted_at and deleted_by fields populated — it does NOT return 404.
The provider's Read function only checks for HTTP 404 to detect deletion, so soft-deleted rules are never removed from state. This causes permanent Terraform state drift: subsequent plan and apply operations silently skip the stale resource.
Requirements for an issue
Expected behavior
When an ignore rule is soft-deleted, terraform plan should detect the deletion and propose re-creating the rule.
Additional context
Proposed fix
Add deleted_by and deleted_at fields to IgnoreRuleAPIModel. In Read(), after the existing HTTP 404 check, add:
if ignoreRule.DeletedAt != nil {
resp.State.RemoveResource(ctx)
return
}
Environment
- Artifactory: Version 7.146.15
- Xray: Version 3.143.19
- Terraform CLI: 1.12
- Provider version: 3.1.10
- JFrog Platform: 11.x E+ (self-hosted)
Affected files
pkg/xray/resource/resource_xray_ignore_rule.go
Describe the bug
The
xray_ignore_ruleresource does not detect soft-deleted ignore rules. When a rule is deleted (via UI, API, or another Terraform workspace), the Xray API returns HTTP 200 withdeleted_atanddeleted_byfields populated — it does NOT return 404.The provider's
Readfunction only checks for HTTP 404 to detect deletion, so soft-deleted rules are never removed from state. This causes permanent Terraform state drift: subsequentplanandapplyoperations silently skip the stale resource.Requirements for an issue
curlArtifactory version at$host/artifactory/api/system/versionand Xray version at$host/xray/api/v1/system/versionExpected behavior
When an ignore rule is soft-deleted,
terraform planshould detect the deletion and propose re-creating the rule.Additional context
Proposed fix
Add
deleted_byanddeleted_atfields toIgnoreRuleAPIModel. InRead(), after the existing HTTP 404 check, add:Environment
Affected files
pkg/xray/resource/resource_xray_ignore_rule.go