Merge pull request #3661 from Tibsfox/fix/verification-not-provided-default
fix(gsd): recognize 'Not provided.' default in isVerificationNotApplicable
This commit is contained in:
commit
45604bbc16
3 changed files with 25 additions and 10 deletions
|
|
@ -174,9 +174,9 @@ export function incrementUatCount(basePath: string, mid: string, sid: string): n
|
|||
* @see https://github.com/gsd-build/gsd-2/issues/2931
|
||||
*/
|
||||
export function isVerificationNotApplicable(value: string): boolean {
|
||||
const v = (value ?? "").toLowerCase().trim();
|
||||
const v = (value ?? "").toLowerCase().trim().replace(/[.\s]+$/, "");
|
||||
if (!v || v === "none") return true;
|
||||
return /^(?:none[\s._-]*(?:required|needed|planned)?|n\/?a|not[\s._-]+(?:applicable|required|needed)|no[\s._-]+operational[\s\S]*)$/i.test(v);
|
||||
return /^(?:none[\s._-]*(?:required|needed|planned)?|n\/?a|not[\s._-]+(?:applicable|required|needed|provided)|no[\s._-]+operational[\s\S]*)$/i.test(v);
|
||||
}
|
||||
|
||||
// ─── Rules ────────────────────────────────────────────────────────────────
|
||||
|
|
|
|||
|
|
@ -80,3 +80,18 @@ test("isVerificationNotApplicable: 'Verify API response times under load' requir
|
|||
test("isVerificationNotApplicable: 'Monitor error rates for 24h' requires verification", () => {
|
||||
assert.equal(isVerificationNotApplicable("Monitor error rates for 24h"), false);
|
||||
});
|
||||
|
||||
// Regression: #3634 — "Not provided." default from plan-milestone
|
||||
test("isVerificationNotApplicable: 'Not provided.' is not applicable (#3634)", () => {
|
||||
assert.equal(isVerificationNotApplicable("Not provided."), true);
|
||||
});
|
||||
|
||||
test("isVerificationNotApplicable: 'Not provided' (no period) is not applicable (#3634)", () => {
|
||||
assert.equal(isVerificationNotApplicable("Not provided"), true);
|
||||
});
|
||||
|
||||
test("isVerificationNotApplicable: trailing period does not defeat match (#3634)", () => {
|
||||
assert.equal(isVerificationNotApplicable("None required."), true);
|
||||
assert.equal(isVerificationNotApplicable("N/A."), true);
|
||||
assert.equal(isVerificationNotApplicable("Not applicable."), true);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -48,13 +48,13 @@ export interface PlanMilestoneParams {
|
|||
keyRisks?: Array<{ risk: string; whyItMatters: string }>;
|
||||
/** @optional — defaults to [] when omitted */
|
||||
proofStrategy?: Array<{ riskOrUnknown: string; retireIn: string; whatWillBeProven: string }>;
|
||||
/** @optional — defaults to "Not provided." when omitted */
|
||||
/** @optional — defaults to "" when omitted */
|
||||
verificationContract?: string;
|
||||
/** @optional — defaults to "Not provided." when omitted */
|
||||
/** @optional — defaults to "" when omitted */
|
||||
verificationIntegration?: string;
|
||||
/** @optional — defaults to "Not provided." when omitted */
|
||||
/** @optional — defaults to "" when omitted */
|
||||
verificationOperational?: string;
|
||||
/** @optional — defaults to "Not provided." when omitted */
|
||||
/** @optional — defaults to "" when omitted */
|
||||
verificationUat?: string;
|
||||
/** @optional — defaults to [] when omitted */
|
||||
definitionOfDone?: string[];
|
||||
|
|
@ -168,10 +168,10 @@ function validateParams(params: PlanMilestoneParams): PlanMilestoneParams {
|
|||
successCriteria: params.successCriteria ? validateStringArray(params.successCriteria, "successCriteria") : [],
|
||||
keyRisks: params.keyRisks ? validateRiskEntries(params.keyRisks) : [],
|
||||
proofStrategy: params.proofStrategy ? validateProofStrategy(params.proofStrategy) : [],
|
||||
verificationContract: params.verificationContract ?? "Not provided.",
|
||||
verificationIntegration: params.verificationIntegration ?? "Not provided.",
|
||||
verificationOperational: params.verificationOperational ?? "Not provided.",
|
||||
verificationUat: params.verificationUat ?? "Not provided.",
|
||||
verificationContract: params.verificationContract ?? "",
|
||||
verificationIntegration: params.verificationIntegration ?? "",
|
||||
verificationOperational: params.verificationOperational ?? "",
|
||||
verificationUat: params.verificationUat ?? "",
|
||||
definitionOfDone: params.definitionOfDone ? validateStringArray(params.definitionOfDone, "definitionOfDone") : [],
|
||||
requirementCoverage: params.requirementCoverage ?? "Not provided.",
|
||||
boundaryMapMarkdown: params.boundaryMapMarkdown ?? "Not provided.",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue