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
check(messages, npm.name().equals(pl.pid()), "Package ID mismatch. This package is "+npm.name()+" but the website has "+pl.pid()+mkError());
215
-
check(messages, npm.canonical().equals(pl.canonical()), "Package canonical mismatch. This package canonical is "+npm.canonical()+" but the website has "+pl.canonical()+mkError());
216
-
check(messages, !hasVersion(pl, npm.version()), "Version "+npm.version()+" has already been published"+mkWarning());
225
+
if (pr.has("movedFrom")) {
226
+
check(messages, !npm.name().equals(pl.pid()), "Package ID matches, which is wrong. This package is " + npm.name() + " and the website is also " + pl.pid()+", but it must change" + mkError());
227
+
check(messages, !npm.canonical().equals(pl.canonical()), "Package canonical matches, which is wrong. This package canonical is " + npm.canonical() + " and the website has " + pl.canonical()+", but it must change" + mkError());
228
+
check(messages, !hasVersion(pl, npm.version()), "Version " + npm.version() + " has already been published" + mkWarning());
229
+
check(messages, pl.getNowPublishedAs() == null, "Package " + npm.name() + " has been superceded by " + pl.getNowPublishedAs() + " and no further publications are possible" + mkError());
230
+
} else {
231
+
check(messages, npm.name().equals(pl.pid()), "Package ID mismatch. This package is " + npm.name() + " but the website has " + pl.pid() + mkError());
232
+
check(messages, npm.canonical().equals(pl.canonical()), "Package canonical mismatch. This package canonical is " + npm.canonical() + " but the website has " + pl.canonical() + mkError());
233
+
check(messages, !hasVersion(pl, npm.version()), "Version " + npm.version() + " has already been published" + mkWarning());
234
+
check(messages, pl.getNowPublishedAs() == null, "Package " + npm.name() + " has been superceded by " + pl.getNowPublishedAs() + " and no further publications are possible" + mkError());
235
+
}
217
236
} else {
218
237
check(messages, npm.version().startsWith("0.1") || npm.version().contains("-"), "This IG has never been published, so the version should start with '0.' or include a patch version e.g. '-ballot'"+mkWarning());
check(messages, cv == null || VersionUtilities.isThisOrLater(cv, v, VersionUtilities.VersionPrecision.MINOR), "Proposed version v"+v+" is older than already published version v"+cv+mkError());
255
274
}
256
275
}
257
-
if (check(messages, pr.has("path"), "No publication request path found"+mkError())) {
258
-
if (check(messages, pr.asString("path").startsWith(npm.canonical()) && !pr.asString("path").equals(npm.canonical()), "Proposed path for this publication does not start with the canonical URL ("+pr.asString("path")+" vs "+npm.canonical() +")"+mkError())) {
check(messages, !pr.has("path"), "No publication request path allowed for withdrawals"+mkError());
279
+
pathok = true;
280
+
} else {
281
+
if (check(messages, pr.has("path"), "No publication request path found" + mkError())) {
282
+
if (check(messages, pr.asString("path").startsWith(npm.canonical()) && !pr.asString("path").equals(npm.canonical()), "Proposed path for this publication does not start with the canonical URL (" + pr.asString("path") + " vs " + npm.canonical() + ")" + mkError())) {
"Proposed path for this publication should usually be the canonical with the version or sequence appended and then some kind of label (typically '-snapshot')"+mkWarning());
290
318
}
291
319
}
292
320
PublicationProcessModemode = null;
293
-
if (check(messages, Utilities.existsInList(pr.asString("mode"), "working", "milestone", "technical-correction"), "The release must have a mode of working, milestone or technical-correction"+mkError())) {
321
+
if (check(messages, Utilities.existsInList(pr.asString("mode"), "working", "milestone", "technical-correction", "withdrawal"), "The release must have a mode of working, milestone, technical-correction or withdrawal"+mkError())) {
if (mode != PublicationProcessMode.WORKING && mode != PublicationProcessMode.WITHDRAWAL) {
297
325
check(messages, !npm.version().contains("-"), "This release is labelled as a "+mode.toCode()+", so should not have a patch version ("+npm.version() +")"+mkWarning());
298
326
} else {
299
327
check(messages, npm.version().contains("-"), "This release is not labelled as a milestone or technical correction, so should have a patch version ("+npm.version() +")"+(isHL7(npm) ? mkError() : mkWarning()));
300
328
}
301
329
}
302
330
303
331
if (check(messages, pr.has("status"), "No publication request status found"+mkError())) {
304
-
if (check(messages, isValidStatus(pr.asString("status")), "Proposed status for this publication is not valid (valid values: release|trial-use|update|preview|ballot|draft|normative+trial-use|normative|informative)"+mkError())) {
332
+
if (check(messages, isValidStatus(pr.asString("status")), "Proposed status for this publication is not valid (valid values: release|trial-use|update|preview|ballot|draft|normative+trial-use|normative|informative|withdrawn)"+mkError())) {
"This release is labelled as a working release in the sequence '"+seq+"'. This is an unexpected workflow - check that the sequence really is correct."+mkWarning());
322
-
} elseif (check(messages, mode != PublicationProcessMode.TECHNICAL_CORRECTION, "Technical Corrections must happen in the scope of the current sequence ('"+seq+"', not '"+pr.asString("sequence")+"'."+mkWarning())) {
350
+
} elseif (check(messages, mode != PublicationProcessMode.TECHNICAL_CORRECTION && mode != PublicationProcessMode.WITHDRAWAL, "Technical Corrections and withdrawals must happen in the scope of the current sequence ('"+seq+"', not '"+pr.asString("sequence")+"'."+mkWarning())) {
check(messages, ls == null || !ls.current(), "The sequence '"+seq+"' has already been closed with a current publication, and a new sequence '"+seq+"' started - is going back to '"+pr.asString("sequence")+"' really what's intended?"+mkWarning());
check(messages, pr.has("registry-reason"), "For withdrawals, a short succint reason for withdrawal must be provided in 'registry-reason'"+mkError());
370
+
}
340
371
if (check(messages, pr.has("desc") || pr.has("descmd") , "No publication request description found"+mkError())) {
341
-
check(messages, pr.has("desc"), "No publication request desc found (it is recommended to provide a shorter desc as well as descmd"+mkWarning());
372
+
check(messages, pr.has("desc"), "No publication request desc found (it is recommended to provide a shorter desc as well as descmd)"+mkWarning());
373
+
check(messages, mode != PublicationProcessMode.WITHDRAWAL || pr.has("descmd"), "No publication request descmd found (needed for a withdrawal)"+mkWarning());
check(messages, pl == null, "Has Already been published, so can't be replacing another publication"+mkError());
429
+
check(messages, !plOld.pid().equals(npm.id()), "Previously published package ID mismatch - has not changed: "+plOld.pid()+" vs "+npm.id()+mkError());
430
+
check(messages, !plOld.canonical().equals(npm.canonical()), "Previously published package canonical has not changed: "+plOld.canonical()+" vs "+npm.canonical()+mkError());
431
+
check(messages, plOld.getNowPublishedAs() == null, "Package "+npm.name()+" has already been been superceded by "+plOld.getNowPublishedAs()+" and can't be superceded again"+mkError());
432
+
check(messages, !pr.has("previouslyPublishedAs"), "Cannot have both previouslyPublishedAs and movedFrom"+mkError());
0 commit comments