@@ -113,3 +113,45 @@ unittest
113
113
114
114
postGitHubHook(" dlang_phobos_merged_4963.json" );
115
115
}
116
+
117
+ // critical bug fix (not in stable) -> show warning to target stable
118
+ unittest
119
+ {
120
+ setAPIExpectations(
121
+ " /github/repos/dlang/phobos/pulls/4921/commits" ,
122
+ " /github/repos/dlang/phobos/issues/4921/labels" ,
123
+ " /github/repos/dlang/phobos/issues/4921/comments" , (ref Json j) {
124
+ j = Json.emptyArray;
125
+ },
126
+ " /bugzilla/buglist.cgi?bug_id=8573&ctype=csv&columnlist=short_desc,bug_status,resolution,bug_severity,priority" ,
127
+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
128
+ res.writeBody(
129
+ ` bug_id,"short_desc","bug_status","resolution","bug_severity","priority"
130
+ 8573,"A simpler Phobos function that returns the index of the mix or max item","NEW","---","regression","P2"` );
131
+ },
132
+ // no bug fix label, since Issues are only referenced but not fixed according to commit messages
133
+ " /github/repos/dlang/phobos/issues/4921/comments" ,
134
+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
135
+ import std.stdio ;
136
+ assert (req.method == HTTPMethod.POST );
137
+ writeln(req.json[" body" ]);
138
+ auto expectedComment =
139
+ ` ### Bugzilla references
140
+
141
+ Fix | Bugzilla | Description
142
+ --- | --- | ---
143
+ ✗ | [8573](%s/show_bug.cgi?id=8573) | A simpler Phobos function that returns the index of the mix or max item
144
+
145
+ ### Warnings
146
+
147
+ - Regression fixes should always target stable
148
+ ` .format(bugzillaURL);
149
+ writeln(expectedComment);
150
+ assert (req.json[" body" ].get ! string == expectedComment);
151
+ res.writeVoidBody;
152
+ },
153
+ " /trello/1/search?query=name:%22Issue%208573%22&" ~ trelloAuth,
154
+ );
155
+
156
+ postGitHubHook(" dlang_phobos_synchronize_4921.json" );
157
+ }
0 commit comments