From a90de1aa2ae25443b383877b55c890a077a45329 Mon Sep 17 00:00:00 2001 From: Edward Ezekiel Date: Wed, 14 May 2025 09:44:42 -0500 Subject: [PATCH 1/2] feat: add url for prod eol report card --- src/config/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/constants.ts b/src/config/constants.ts index e68ace84..c6cada0d 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -1,4 +1,4 @@ -export const EOL_REPORT_URL = ''; +export const EOL_REPORT_URL = 'https://eol-report-card.apps.herodevs.com'; export const GRAPHQL_HOST = 'https://api.nes.herodevs.com'; export const GRAPHQL_PATH = '/graphql'; From 54f14a657316f12d8099ec96ad4e98a03b1f79dc Mon Sep 17 00:00:00 2001 From: Edward Ezekiel Date: Wed, 14 May 2025 11:11:44 -0500 Subject: [PATCH 2/2] fix: ensure label is correct when days eol is zero --- e2e/scan/eol.test.ts | 12 +++--------- src/ui/eol.ui.ts | 6 +++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/e2e/scan/eol.test.ts b/e2e/scan/eol.test.ts index 5ba8733b..bfd0157f 100644 --- a/e2e/scan/eol.test.ts +++ b/e2e/scan/eol.test.ts @@ -245,21 +245,15 @@ describe('scan:eol e2e', () => { }); }); - it('correctly identifies Angular 17 EOL status', async () => { + it('correctly identifies Angular 17 as having a EOL date', async () => { const cmd = `scan:eol --purls=${angular17Purls}`; const { stdout } = await run(cmd); // Check for Angular package presence match(stdout, /pkg:npm\/%40angular\/core@17\.3\.12/, 'Should detect Angular core package'); - // Check for either SUPPORTED or EOL status - match(stdout, /⚡= Supported: End-of-Life \(EOL\) is scheduled/, 'Should show SUPPORTED status'); - - // Check for EOL date format with days remaining - match(stdout, /EOL Date: \d{4}-\d{2}-\d{2} \(\d+ days from now\)/, 'Should show EOL date with days remaining'); - - // Check for the status indicator in the package line - match(stdout, /⚡ pkg:npm\/%40angular\/core@17\.3\.12/, 'Should show supported status indicator'); + // Check for EOL date format + match(stdout, /EOL Date: \d{4}-\d{2}-\d{2}/, 'Should show EOL date'); // Check for the arrow format match(stdout, /⮑ {2}EOL Date: \d{4}-\d{2}-\d{2}/, 'Should show EOL date with arrow'); diff --git a/src/ui/eol.ui.ts b/src/ui/eol.ui.ts index 455fc538..e212283b 100644 --- a/src/ui/eol.ui.ts +++ b/src/ui/eol.ui.ts @@ -29,10 +29,10 @@ function getDaysEolString(daysEol: number | null): string { if (daysEol === null) { return ''; } - if (daysEol < 0) { - return `${Math.abs(daysEol)} days from now`; + if (daysEol <= 0) { + return `${Math.abs(daysEol) + 1} days from now`; } - if (daysEol === 0) { + if (daysEol > 0) { return 'today'; } return `${daysEol} days ago`;