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
Now the manager also handles issues after release (on-sync)
a) keeping the current queue fed (like before release).
b) holding new features and improvements (with special on-syn message)
I've ended refactoring / reorganizing everything, splitting into
bash functions for easier reuse and future expansion.
Also, add support for $dryrun env variable to allow the script to be
executed without performing any change in the tracker.
# Verify that $releasedata has a correct YYYY-MM-DD format
78
+
if [[ !${releasedate}=~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]];then
79
+
echo"ERROR: \$releasedate. Incorrect YYYY-MM-DD format detected: ${releasedate}"
80
+
exit 1
81
+
fi
65
82
66
-
# Verify that $datetoholdbugs has a correct YYYY-MM-DD format
67
-
if [[ !${datetoholdbugs}=~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]];then
68
-
echo"ERROR: Incorrect YYYY-MM-DD format detected: ${datetoholdbugs}"
83
+
# Verify that $lastweekdate has a correct YYYY-MM-DD format
84
+
if [[ !${lastweekdate}=~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]];then
85
+
echo"ERROR: \$lastweekdate. Incorrect YYYY-MM-DD format detected: ${lastweekdate}"
69
86
exit 1
70
87
fi
71
88
72
-
# Decide if we are going to perform the behavior 2a) move to current
73
-
# or 2b) hold bugs, based on current date.
74
-
behavior2=
75
-
holddate=$(date -d "${datetoholdbugs}" +%Y%m%d)
89
+
# Today
76
90
nowdate=$(date +%Y%m%d)
77
-
if [ $nowdate-lt$holddate ];then
78
-
behavior2="move"
91
+
92
+
# Decide if we are going to proceed with behaviour A (before release) or behaviour B (after release)
93
+
behaviorAB=
94
+
if [ $nowdate-lt$(date -d "${releasedate}" +%Y%m%d) ];then
95
+
behaviorAB="before"
79
96
else
80
-
behavior2="hold"
97
+
behaviorAB="after"
81
98
fi
82
99
83
-
# Note this could be done by one unique "runFromIssueList" action, but we are splitting
84
-
# the search and the update in order to log all the closed issues within jenkins ($logfile)
85
-
86
-
# 0) Add the "integration_held" (+ std. comment) to new features & improvements issue missing it @ candidates.
87
-
88
-
# Basically get all the issues in the candidates queue (filter=14000), that are not bug
89
-
# and that haven't received any comment with the standard unholding text (NOT filter = 22054)
90
-
91
-
# Get the list of issues.
92
-
${basereq} --action getIssueList \
93
-
--search "filter=14000 \
94
-
AND type IN ('New Feature', Improvement) \
95
-
AND NOT filter = 22054" \
96
-
--file "${resultfile}"
97
-
98
-
# Iterate over found issues and perform the actions with them.
99
-
forissuein$( sed -n 's/^"\(MDL-[0-9]*\)".*/\1/p'"${resultfile}");do
100
-
echo"Processing ${issue}"
101
-
# Add the integration_held label.
102
-
${basereq} --action addLabels \
103
-
--issue ${issue} \
104
-
--labels "integration_held"
105
-
# Add the standard comment for held issues.
106
-
comment='This issue has been sent to integration after the freeze.
107
-
108
-
If you want Moodle HQ to consider including it into the incoming major release please add the "{{unhold_requested}}" label, and post a comment here outlining good reasons why you think it should be considered for late integration into the next major release.'
--comment "Continuous queues manage: Moving to current given we are below the threshold ($currentmin)" \
203
-
--role "Integrators"
204
-
echo"$BUILD_NUMBER$BUILD_TIMESTAMP${issue} moved to current: threshold (before ${datetoholdbugs})">>"${logfile}"
205
-
done
115
+
# Behaviour A, before the release (normally the 6 weeks of continuous).
116
+
117
+
if [ $behaviorAB=="before" ];then
118
+
# A1, add the "integration_held" + standard comment to any new feature or improvement arriving to candidates.
119
+
run_A1
120
+
# A2, move "important" issues from candidates to current
121
+
run_A2
122
+
# A3, move all issues aways from candidates queue:
123
+
if [ $behaviorA3=="move" ];then
124
+
# A3a, keep the current queue fed with bug issues when it's under a threshold.
125
+
run_A3a
126
+
fi
127
+
if [ $behaviorA3=="hold" ];then
128
+
# A3b, add the "integration_held" + standard comment to any issue arriving to candidates.
129
+
run_A3b
206
130
fi
207
131
fi
208
132
209
-
# 2b) After a date (last week), add the "integration_held" (+ std.comment) to bug issues.
210
-
211
-
if [[ "${behavior2}"=="hold" ]];then
212
-
# Get the list of issues in the candidates queue. All them will be held with last week comment.
213
-
${basereq} --action getIssueList \
214
-
--search "filter=14000" \
215
-
--file "${resultfile}"
216
-
217
-
# Iterate over found issues, moving them to the current queue.
218
-
forissuein$( sed -n 's/^"\(MDL-[0-9]*\)".*/\1/p'"${resultfile}");do
219
-
echo"Processing ${issue}"
220
-
# Add the integration_held label.
221
-
${basereq} --action addLabels \
222
-
--issue ${issue} \
223
-
--labels "integration_held"
224
-
# Add the standard comment for held issues the last week.
225
-
comment='We are currently in the final week before release ( https://docs.moodle.org/dev/Integration_Review#During_continuous_integration.2FFreeze.2FQA_period ) so this issue is being held until after release. Thanks for your patience!'
0 commit comments