@@ -3,7 +3,7 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|||||||
import { dirname, join, resolve } from 'node:path';
|
import { dirname, join, resolve } from 'node:path';
|
||||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||||
import { collectIssueFiles } from './update-products-from-issues.mjs';
|
import { collectIssueFiles } from './update-products-from-issues.mjs';
|
||||||
import { extractIssueIds } from '../web/js/issue-id.js';
|
import { BLANK_ISSUE_ID, extractIssueIds } from '../web/js/issue-id.js';
|
||||||
|
|
||||||
const REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
const REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
||||||
const VERSION_RE = /^(?<major>\d+)(?:\.(?<minor>\d+))?(?:\.(?<patch>\d+))?(?<rest>.*)$/;
|
const VERSION_RE = /^(?<major>\d+)(?:\.(?<minor>\d+))?(?:\.(?<patch>\d+))?(?<rest>.*)$/;
|
||||||
@@ -43,6 +43,7 @@ export function buildIssuePlotProduct(product, releases) {
|
|||||||
const points = [];
|
const points = [];
|
||||||
versions.forEach((version, releaseIndex) => {
|
versions.forEach((version, releaseIndex) => {
|
||||||
for (const id of releases.get(version)) {
|
for (const id of releases.get(version)) {
|
||||||
|
if (id === BLANK_ISSUE_ID) continue;
|
||||||
const issueNumber = Number(id.match(/-(\d+)$/)?.[1]);
|
const issueNumber = Number(id.match(/-(\d+)$/)?.[1]);
|
||||||
if (Number.isSafeInteger(issueNumber)) points.push([releaseIndex, issueNumber, id]);
|
if (Number.isSafeInteger(issueNumber)) points.push([releaseIndex, issueNumber, id]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Mentions PAN-999999 in the description.
|
|||||||
test('builds compact plot points in semantic release order', () => {
|
test('builds compact plot points in semantic release order', () => {
|
||||||
const plot = buildIssuePlotProduct('PAN-OS', new Map([
|
const plot = buildIssuePlotProduct('PAN-OS', new Map([
|
||||||
['10.2.10-h1', ['PAN-130000']],
|
['10.2.10-h1', ['PAN-130000']],
|
||||||
['10.2.9', ['PAN-100000', 'WF500-120000']]
|
['10.2.9', ['PAN-100000', 'WF500-120000', 'BLANK-000000']]
|
||||||
]));
|
]));
|
||||||
assert.deepEqual(plot.releases, ['10.2.9', '10.2.10-h1']);
|
assert.deepEqual(plot.releases, ['10.2.9', '10.2.10-h1']);
|
||||||
assert.deepEqual(plot.points, [
|
assert.deepEqual(plot.points, [
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -120,7 +120,7 @@ function drawPlot() {
|
|||||||
const minimum = Math.min(...values);
|
const minimum = Math.min(...values);
|
||||||
const maximum = Math.max(...values);
|
const maximum = Math.max(...values);
|
||||||
const range = Math.max(1, maximum - minimum);
|
const range = Math.max(1, maximum - minimum);
|
||||||
const yMin = Math.max(0, minimum - range * 0.04);
|
const yMin = minimum - range * 0.04;
|
||||||
const yMax = maximum + range * 0.04;
|
const yMax = maximum + range * 0.04;
|
||||||
const xFor = position => margin.left + (
|
const xFor = position => margin.left + (
|
||||||
releaseIndexes.length === 1 ? plotWidth / 2 : position * plotWidth / (releaseIndexes.length - 1)
|
releaseIndexes.length === 1 ? plotWidth / 2 : position * plotWidth / (releaseIndexes.length - 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user