Skip to content

Make db_sync_updates_time optional in xray_settings resource - #426

Open
System-Arch wants to merge 2 commits into
jfrog:mainfrom
System-Arch:fix-xray-settings-optional-dbsync
Open

Make db_sync_updates_time optional in xray_settings resource#426
System-Arch wants to merge 2 commits into
jfrog:mainfrom
System-Arch:fix-xray-settings-optional-dbsync

Conversation

@System-Arch

Copy link
Copy Markdown

Summary

Changes db_sync_updates_time from Required to Optional + Computed so that xray_settings can be created without configuring the DB sync schedule. This change makes its behavior consistent with all of the other attributes, which are also 'Optional'.

Ref #421

Changes

  • Schema: db_sync_updates_time is now Optional + Computed instead of Required.
  • Create/Update: Added early-exit guards that skip the PUT to xray/api/v1/configuration/dbsync/time when db_sync_updates_time is null/unknown. In this path, the current server value is read via GET so the Computed attribute is populated in state. The resource ID is set to the static string "settings".
  • Read: No change — always fetches the current DB sync time from the server.
  • Test: Added TestAccSettings_noDbSyncTime acceptance test that creates xray_settings without db_sync_updates_time and verifies the attribute is populated from the server via TestCheckResourceAttrSet, plus import state verification.
  • CHANGELOG: Added entry for 3.1.12.

Testing

  • TestAccSettings_noDbSyncTime — new test covering the omitted db_sync_updates_time path (verified: fails without fix, passes with fix)
  • TestAccSettings_basic — existing test covering the explicit-value path
  • TestAccSettings_DbSyncTime — existing test covering sync time only
  • All three tests pass against a live JFrog Platform instance

Comment thread pkg/xray/resource/resource_xray_settings.go
Comment thread pkg/xray/resource/resource_xray_settings_test.go
Change db_sync_updates_time from Required to Optional+Computed. When omitted,
Create and Update skip the PUT to the DB sync endpoint and read the current
server value via GET so the Computed attribute is populated in state.

Add TestAccSettings_noDbSyncTime acceptance test.
Add CHANGELOG entry for 3.1.12.
@System-Arch
System-Arch force-pushed the fix-xray-settings-optional-dbsync branch from 371c352 to 03a5fc5 Compare July 31, 2026 12:12
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.

2 participants