Change 33766

tom_tyler (C. Thomas Tyler)
C. Thomas Tyler committed this change into //j2j/dev
Request Review
Download .zip
Change watermark storage from a local file to a P4 server counter.

sync_jira_to_p4jobs.sh previously stored the JIRA sync watermark in
${StateDir}/last_sync_time, tying it to one host/checkout. Move it to a
P4 server counter (new WatermarkCounter config key, default
'jira-sync-watermark') so it's shared/atomic and survives loss of
StateDir. Setting/reading the counter requires only the admin/super P4
access this script's service account already needs for job upserts.

- get_watermark()/save_watermark() now use 'p4 counter' via the existing
  p4_cmd wrapper instead of file I/O.
- Added migrate_legacy_watermark_file(), called from init_state(), which
  seeds the counter from any pre-existing last_sync_time file on first
  run after upgrade, then renames the file to last_sync_time.migrated.
- Updated -man STATE FILES section, example config, and
  docs/sync_jira_to_p4jobs_README.md accordingly.
  • Files 2
  • Comments 0
2 edited 0 added 0 deleted
bin/sync_jira_to_p4jobs.sh#18
Loading...
docs/sync_jira_to_p4jobs_README.md#12
Loading...
Tip: Use n and p to cycle through the changes.