Skip to content

Commit c1401d1

Browse files
committed
Validate release date on continuous queues manager
Before performing the tasks on the job, we need to make sure that the release date is properly configured on the job. This can be simply done by making sure that the current date is not well past the end of the on-sync date which is calculated by adding 4 weeks to the configured release date. (Normally on-sync ends 2 weeks after the release but setting it to 4 weeks just in case we have an unusually longer on-sync period),
1 parent 8399dca commit c1401d1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tracker_automations/continuous_manage_queues/continuous_manage_queues.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ movemax=${movemax:-3}
7272
lastweekdate=${lastweekdate:-$(date -d "${releasedate} -7day" +%Y-%m-%d)}
7373
dryrun=${dryrun:-}
7474

75-
# Verify that $releasedata has a correct YYYY-MM-DD format
75+
# Verify that $releasedate has a correct YYYY-MM-DD format
7676
if [[ ! ${releasedate} =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then
7777
echo "ERROR: \$releasedate. Incorrect YYYY-MM-DD format detected: ${releasedate}"
7878
exit 1
@@ -87,6 +87,13 @@ fi
8787
# Today
8888
nowdate=$(date +%Y%m%d)
8989

90+
# Verify that the current date is not well past the on-sync period. (Normally 2 weeks but making it 4 weeks just in case).
91+
onsyncenddate=$(date -d "${releasedate} +28day" +%Y%m%d)
92+
if [ $nowdate -gt $onsyncenddate ]; then
93+
echo "ERROR: The current date is already past the on-sync period. Please make sure the Release date ($releasedate) is configured correctly."
94+
exit 1
95+
fi
96+
9097
# Decide if we are going to proceed with behaviour A (before release) or behaviour B (after release)
9198
behaviorAB=
9299
if [ $nowdate -lt $(date -d "${releasedate}" +%Y%m%d) ]; then

0 commit comments

Comments
 (0)