diff --git a/cli/README.md b/cli/README.md index d80fb2a..486cef7 100644 --- a/cli/README.md +++ b/cli/README.md @@ -35,7 +35,7 @@ msevents sessions --tech "Microsoft Foundry" msevents sessions --tech "Azure Cosmos DB" --type lab msevents sessions --speaker "Scott Hanselman" msevents sessions --tech "Microsoft Foundry" --speaker "Yina Arenas" -msevents sessions --event build-2025 --query "Foundry" +msevents sessions --event build-2026 --query "Foundry" msevents session BRK155 msevents refresh msevents refresh --event build-2026 @@ -49,7 +49,7 @@ Available commands: - `--tech ` search by technology (matches product, tags, topic, languages) - `--speaker ` search by speaker name - `--type ` filter by session type (breakout, lab, demo, keynote) - - `--event ` filter to a specific event (e.g., `build-2026`, `ignite-2025`) + - `--event ` filter to a specific event (e.g., `ignite-2026`, `build-2026`) - `--limit ` max results (default: 10) - `session ` looks up a specific session by code. Searches all cached events; disambiguates if the code appears in multiple events. - `--event ` scope to a specific event @@ -71,8 +71,6 @@ msevents session BRK155 --json |-------|----------|--------| | Ignite 2026 | `ignite-2026` | Live | | Build 2026 | `build-2026` | Live | -| Ignite 2025 | `ignite-2025` | Live | -| Build 2025 | `build-2025` | Live | Use `--event ` to filter to a single event. Without it, commands search across everything cached. diff --git a/cli/package-lock.json b/cli/package-lock.json index 29fe58d..4f46aa6 100644 --- a/cli/package-lock.json +++ b/cli/package-lock.json @@ -1,12 +1,12 @@ { "name": "@microsoft/events-cli", - "version": "0.3.2", + "version": "0.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@microsoft/events-cli", - "version": "0.3.2", + "version": "0.3.3", "license": "MIT", "dependencies": { "commander": "^14.0.0", diff --git a/cli/package.json b/cli/package.json index b9864d4..f97b909 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/events-cli", - "version": "0.3.2", + "version": "0.3.3", "description": "CLI for searching Microsoft flagship event sessions (Build, Ignite).", "type": "module", "bin": { diff --git a/cli/scripts/smoke-fixture.mjs b/cli/scripts/smoke-fixture.mjs index a52d30d..8acc5bf 100644 --- a/cli/scripts/smoke-fixture.mjs +++ b/cli/scripts/smoke-fixture.mjs @@ -9,7 +9,7 @@ import { normalizeCatalog } from '../dist/data/normalize.js'; const execFileAsync = promisify(execFile); const cliRoot = fileURLToPath(new URL('..', import.meta.url)); const commandTimeoutMs = 60_000; -const eventId = 'build-2025'; +const eventId = 'build-2026'; function assert(condition, message) { if (!condition) throw new Error(message); diff --git a/cli/scripts/smoke-m365-plugin.mjs b/cli/scripts/smoke-m365-plugin.mjs index b35d96c..15334fd 100644 --- a/cli/scripts/smoke-m365-plugin.mjs +++ b/cli/scripts/smoke-m365-plugin.mjs @@ -13,7 +13,7 @@ import { normalizeCatalog } from '../dist/data/normalize.js'; const execFileAsync = promisify(execFile); const cliRoot = fileURLToPath(new URL('..', import.meta.url)); const commandTimeoutMs = 60_000; -const eventId = 'build-2025'; +const eventId = 'build-2026'; const isWindows = process.platform === 'win32'; const { values: options } = parseArgs({ options: { package: { type: 'boolean' } } }); const sourceSkillsDir = join(cliRoot, '..', 'skills'); @@ -207,9 +207,9 @@ try { assert(statusText.stdout.startsWith('Offline (MSEVENTS_OFFLINE)'), `Expected an offline line in status:\n${statusText.stdout}`); assert(!statusText.stdout.includes('last check failed'), 'Expected the frozen meta to drop the failed-check state'); - const missing = await snapshot('sessions', '--query', 'agents', '--event', 'ignite-2025', '--json'); + const missing = await snapshot('sessions', '--query', 'agents', '--event', 'ignite-2026', '--json'); assert(missing.code === 0 && JSON.parse(missing.stdout).length === 0, 'Expected no results for an event outside the snapshot'); - assert(missing.stderr.includes('no cached sessions for Microsoft Ignite 2025'), `Expected a missing-event notice:\n${missing.stderr}`); + assert(missing.stderr.includes('no cached sessions for Microsoft Ignite 2026'), `Expected a missing-event notice:\n${missing.stderr}`); const all = await snapshot('sessions', '--query', 'Foundry', '--json'); assert(all.code === 0 && JSON.parse(all.stdout).length > 0, 'Expected a search across all events to use the bundled event'); diff --git a/cli/src/config.ts b/cli/src/config.ts index dfb8230..65640d7 100644 --- a/cli/src/config.ts +++ b/cli/src/config.ts @@ -1,16 +1,6 @@ import type { EventConfig } from './contracts.js'; export const KNOWN_EVENTS: EventConfig[] = [ - { - id: 'build-2025', - name: 'Microsoft Build 2025', - endpoint: 'https://aka.ms/build2025-session-info', - }, - { - id: 'ignite-2025', - name: 'Microsoft Ignite 2025', - endpoint: 'https://aka.ms/ignite2025-session-info', - }, { id: 'build-2026', name: 'Microsoft Build 2026', diff --git a/cli/test/cache.test.ts b/cli/test/cache.test.ts index 23809a0..a47478b 100644 --- a/cli/test/cache.test.ts +++ b/cli/test/cache.test.ts @@ -117,8 +117,6 @@ describe('automatic cache revalidation', () => { }); it('skips remote checks when all caches were checked recently', async () => { - await writeCachedEvent('build-2025'); - await writeCachedEvent('ignite-2025'); await writeCachedEvent('build-2026'); const originalMeta = await readMeta('build-2026'); await writeCachedEvent('ignite-2026'); @@ -129,20 +127,18 @@ describe('automatic cache revalidation', () => { expect(fetchMock).not.toHaveBeenCalled(); expect(await readMeta('build-2026')).toEqual(originalMeta); - expect(sessions.map((s) => s.event).sort()).toEqual(['build-2025', 'build-2026', 'ignite-2025', 'ignite-2026']); + expect(sessions.map((s) => s.event).sort()).toEqual(['build-2026', 'ignite-2026']); }); it('uses conditional GET when a cached event is due for revalidation', async () => { const fetchedAt = '2026-05-07T01:00:00.000Z'; - await writeCachedEvent('build-2025', { + await writeCachedEvent('build-2026', { fetchedAt, checkedAt: '2026-05-07T01:00:00.000Z', nextCheckAt: '2026-05-07T02:00:00.000Z', etag: '"abc"', lastModified: 'Thu, 07 May 2026 01:00:00 GMT', }); - await writeCachedEvent('ignite-2025'); - await writeCachedEvent('build-2026'); await writeCachedEvent('ignite-2026'); const fetchMock = vi.fn().mockResolvedValue(new Response(null, { status: 304 })); vi.stubGlobal('fetch', fetchMock); @@ -156,7 +152,7 @@ describe('automatic cache revalidation', () => { 'If-Modified-Since': 'Thu, 07 May 2026 01:00:00 GMT', }); - const updatedMeta = await readMeta('build-2025'); + const updatedMeta = await readMeta('build-2026'); expect(updatedMeta?.fetchedAt).toBe(fetchedAt); expect(updatedMeta?.checkedAt).toBe(NOW); expect(updatedMeta?.lastCheckStatus).toBe('not-modified'); @@ -165,22 +161,21 @@ describe('automatic cache revalidation', () => { }); it('keeps stale cache usable and backs off when revalidation fails', async () => { - await writeCachedEvent('build-2025', { + await writeCachedEvent('build-2026', { checkedAt: '2026-05-07T01:00:00.000Z', nextCheckAt: '2026-05-07T02:00:00.000Z', consecutiveFailures: 1, }); - await writeCachedEvent('ignite-2025'); - await writeCachedEvent('build-2026'); + await writeCachedEvent('ignite-2026'); const fetchMock = vi.fn().mockRejectedValue(new TypeError('network down')); vi.stubGlobal('fetch', fetchMock); await ensureCache(); const sessions = await getAllCachedSessions(); - expect(sessions.some((s) => s.event === 'build-2025')).toBe(true); + expect(sessions.some((s) => s.event === 'build-2026')).toBe(true); - const updatedMeta = await readMeta('build-2025'); + const updatedMeta = await readMeta('build-2026'); expect(updatedMeta?.lastCheckStatus).toBe('failed'); expect(updatedMeta?.consecutiveFailures).toBe(2); expect(updatedMeta?.checkedAt).toBe(NOW); @@ -188,9 +183,7 @@ describe('automatic cache revalidation', () => { }); it('repairs missing metadata after failed revalidation so backoff still applies', async () => { - await writeSessionsOnly('build-2025'); - await writeCachedEvent('ignite-2025'); - await writeCachedEvent('build-2026'); + await writeSessionsOnly('build-2026'); await writeCachedEvent('ignite-2026'); const fetchMock = vi.fn().mockRejectedValue(new TypeError('network down')); vi.stubGlobal('fetch', fetchMock); @@ -198,9 +191,9 @@ describe('automatic cache revalidation', () => { await ensureCache(); expect(fetchMock).toHaveBeenCalledTimes(1); - const repairedMeta = await readMeta('build-2025'); + const repairedMeta = await readMeta('build-2026'); expect(repairedMeta).toMatchObject({ - eventId: 'build-2025', + eventId: 'build-2026', sessionCount: 1, lastCheckStatus: 'failed', consecutiveFailures: 1, @@ -216,14 +209,6 @@ describe('automatic cache revalidation', () => { it('fetches and caches missing events automatically', async () => { const fetchMock = vi.fn() - .mockResolvedValueOnce(jsonResponse( - [{ sessionCode: 'BRK101', title: 'Build 2025 session' }], - { etag: '"2025"', 'last-modified': 'Thu, 07 May 2026 02:55:00 GMT' }, - )) - .mockResolvedValueOnce(jsonResponse( - [{ sessionCode: 'IGN301', title: 'Ignite 2025 session' }], - { etag: '"ign2025"', 'last-modified': 'Thu, 07 May 2026 02:55:30 GMT' }, - )) .mockResolvedValueOnce(jsonResponse( [{ sessionCode: 'BRK202', title: 'Build 2026 session' }], { etag: '"2026"', 'last-modified': 'Thu, 07 May 2026 02:56:00 GMT' }, @@ -237,7 +222,7 @@ describe('automatic cache revalidation', () => { await ensureCache(); const sessions = await getAllCachedSessions(); - expect(sessions.map((s) => s.sessionCode).sort()).toEqual(['BRK101', 'BRK202', 'IGN301', 'IGN401']); + expect(sessions.map((s) => s.sessionCode).sort()).toEqual(['BRK202', 'IGN401']); const build2026Meta = await readMeta('build-2026'); expect(build2026Meta?.lastCheckStatus).toBe('updated'); @@ -261,40 +246,30 @@ describe('automatic cache revalidation', () => { expect(fetchMock).not.toHaveBeenCalled(); expect(sessions.map((s) => s.sessionCode)).toEqual(['BRK202']); expect(await readMeta('build-2026')).toEqual(originalMeta); - expect(existsSync(join(cacheDir, 'build-2025-sessions.json'))).toBe(false); - expect(existsSync(join(cacheDir, 'ignite-2025-sessions.json'))).toBe(false); + expect(existsSync(join(cacheDir, 'ignite-2026-sessions.json'))).toBe(false); }); it('fetches a different scoped event without refreshing an existing scoped cache', async () => { await writeCachedEvent('build-2026', {}, 'BRK202'); const originalBuild2026Meta = await readMeta('build-2026'); const fetchMock = vi.fn().mockResolvedValue(jsonResponse( - [{ sessionCode: 'BRK101', title: 'Build 2025 session' }], - { etag: '"2025"', 'last-modified': 'Thu, 07 May 2026 02:55:00 GMT' }, + [{ sessionCode: 'IGN401', title: 'Ignite 2026 session' }], + { etag: '"ign2026"', 'last-modified': 'Thu, 07 May 2026 02:56:30 GMT' }, )); vi.stubGlobal('fetch', fetchMock); - const sessions = await ensureCache('build-2025'); + const sessions = await ensureCache('ignite-2026'); expect(fetchMock).toHaveBeenCalledTimes(1); - expect(fetchMock.mock.calls[0]?.[0]).toBe('https://aka.ms/build2025-session-info'); - expect(sessions.map((s) => s.sessionCode)).toEqual(['BRK101']); + expect(fetchMock.mock.calls[0]?.[0]).toBe('https://aka.ms/ignite2026-session-info'); + expect(sessions.map((s) => s.sessionCode)).toEqual(['IGN401']); expect(await readMeta('build-2026')).toEqual(originalBuild2026Meta); - expect(existsSync(join(cacheDir, 'ignite-2025-sessions.json'))).toBe(false); }); it('reuses existing caches and fetches missing caches when loading all events', async () => { await writeCachedEvent('build-2026', {}, 'BRK202'); const originalBuild2026Meta = await readMeta('build-2026'); const fetchMock = vi.fn() - .mockResolvedValueOnce(jsonResponse( - [{ sessionCode: 'BRK101', title: 'Build 2025 session' }], - { etag: '"2025"', 'last-modified': 'Thu, 07 May 2026 02:55:00 GMT' }, - )) - .mockResolvedValueOnce(jsonResponse( - [{ sessionCode: 'IGN301', title: 'Ignite 2025 session' }], - { etag: '"ign2025"', 'last-modified': 'Thu, 07 May 2026 02:55:30 GMT' }, - )) .mockResolvedValueOnce(jsonResponse( [{ sessionCode: 'IGN401', title: 'Ignite 2026 session' }], { etag: '"ign2026"', 'last-modified': 'Thu, 07 May 2026 02:56:30 GMT' }, @@ -303,13 +278,11 @@ describe('automatic cache revalidation', () => { const sessions = await ensureCache(); - expect(fetchMock).toHaveBeenCalledTimes(3); + expect(fetchMock).toHaveBeenCalledTimes(1); expect(fetchMock.mock.calls.map(([url]) => url)).toEqual([ - 'https://aka.ms/build2025-session-info', - 'https://aka.ms/ignite2025-session-info', 'https://aka.ms/ignite2026-session-info', ]); - expect(sessions.map((s) => s.sessionCode).sort()).toEqual(['BRK101', 'BRK202', 'IGN301', 'IGN401']); + expect(sessions.map((s) => s.sessionCode).sort()).toEqual(['BRK202', 'IGN401']); expect(await readMeta('build-2026')).toEqual(originalBuild2026Meta); }); @@ -326,12 +299,11 @@ describe('automatic cache revalidation', () => { expect(fetchMock.mock.calls[0]?.[0]).toBe('https://aka.ms/build2026-session-info'); expect(sessions.map((s) => s.event)).toEqual(['build-2026']); expect(existsSync(join(cacheDir, 'build-2026-sessions.json'))).toBe(true); - expect(existsSync(join(cacheDir, 'build-2025-sessions.json'))).toBe(false); - expect(existsSync(join(cacheDir, 'ignite-2025-sessions.json'))).toBe(false); + expect(existsSync(join(cacheDir, 'ignite-2026-sessions.json'))).toBe(false); }); it('does not fall back to unrelated cached events when scoped cache loading fails', async () => { - await writeCachedEvent('build-2025'); + await writeCachedEvent('ignite-2026'); const fetchMock = vi.fn().mockRejectedValue(new TypeError('network down')); vi.stubGlobal('fetch', fetchMock); diff --git a/cli/test/offline.test.ts b/cli/test/offline.test.ts index 8e5b63d..8cb72df 100644 --- a/cli/test/offline.test.ts +++ b/cli/test/offline.test.ts @@ -37,7 +37,7 @@ function session(event: string, sessionCode: string): Session { } const dueMeta: CacheMeta = { - eventId: 'build-2025', + eventId: 'build-2026', fetchedAt: '2020-01-01T00:00:00.000Z', checkedAt: '2020-01-01T00:00:00.000Z', nextCheckAt: '2020-01-01T00:20:00.000Z', @@ -77,8 +77,8 @@ describe('offline mode (MSEVENTS_OFFLINE)', () => { vi.stubGlobal('fetch', fetchMock); vi.spyOn(process.stderr, 'write').mockImplementation(() => true); vi.spyOn(console, 'error').mockImplementation(() => {}); - await writeFile(join(cacheDir, 'build-2025-sessions.json'), JSON.stringify([session('build-2025', 'BRK100')])); - await writeFile(join(cacheDir, 'build-2025-meta.json'), JSON.stringify(dueMeta)); + await writeFile(join(cacheDir, 'build-2026-sessions.json'), JSON.stringify([session('build-2026', 'BRK100')])); + await writeFile(join(cacheDir, 'build-2026-meta.json'), JSON.stringify(dueMeta)); }); afterEach(async () => { @@ -91,12 +91,12 @@ describe('offline mode (MSEVENTS_OFFLINE)', () => { }); it('reads cached sessions without revalidating a cache that is due', async () => { - const sessions = await ensureCache('build-2025'); + const sessions = await ensureCache('build-2026'); expect(sessions.map((s) => s.sessionCode)).toEqual(['BRK100']); expect(fetchMock).not.toHaveBeenCalled(); expect(stderrOutput()).toBe(''); - expect(JSON.parse(await readFile(join(cacheDir, 'build-2025-meta.json'), 'utf-8'))).toEqual(dueMeta); + expect(JSON.parse(await readFile(join(cacheDir, 'build-2026-meta.json'), 'utf-8'))).toEqual(dueMeta); }); it('skips events with no cache, notes them once, and writes nothing', async () => { @@ -104,20 +104,20 @@ describe('offline mode (MSEVENTS_OFFLINE)', () => { expect(sessions.map((s) => s.sessionCode)).toEqual(['BRK100']); expect(fetchMock).not.toHaveBeenCalled(); - const uncached = KNOWN_EVENTS.filter((e) => e.id !== 'build-2025').map((e) => e.name); + const uncached = KNOWN_EVENTS.filter((e) => e.id !== 'build-2026').map((e) => e.name); expect(uncached.length).toBeGreaterThan(0); expect(stderrOutput()).toBe(`Offline (MSEVENTS_OFFLINE): no cached sessions for ${uncached.join(', ')}.\n`); - expect((await readdir(cacheDir)).sort()).toEqual(['build-2025-meta.json', 'build-2025-sessions.json']); + expect((await readdir(cacheDir)).sort()).toEqual(['build-2026-meta.json', 'build-2026-sessions.json']); }); it('returns no sessions for an uncached event', async () => { - expect(await ensureCache('ignite-2025')).toEqual([]); + expect(await ensureCache('ignite-2026')).toEqual([]); expect(fetchMock).not.toHaveBeenCalled(); - expect(stderrOutput()).toContain('no cached sessions for Microsoft Ignite 2025'); + expect(stderrOutput()).toContain('no cached sessions for Microsoft Ignite 2026'); }); it('makes refresh fail without fetching', async () => { - await refresh('build-2025', true); + await refresh('build-2026', true); expect(process.exitCode).toBe(1); expect(fetchMock).not.toHaveBeenCalled(); @@ -127,8 +127,8 @@ describe('offline mode (MSEVENTS_OFFLINE)', () => { describe('formatStatus in offline mode', () => { const statuses = [ - { eventId: 'build-2025', meta: { ...dueMeta, lastCheckStatus: 'updated' as const } }, - { eventId: 'ignite-2025', meta: null }, + { eventId: 'build-2026', meta: { ...dueMeta, lastCheckStatus: 'updated' as const } }, + { eventId: 'ignite-2026', meta: null }, ]; it('adds an offline line to text output', () => { diff --git a/cli/test/validate-event.test.ts b/cli/test/validate-event.test.ts index bbe7d8b..554b28d 100644 --- a/cli/test/validate-event.test.ts +++ b/cli/test/validate-event.test.ts @@ -13,7 +13,7 @@ describe('validateEventId', () => { }); it('returns true for a known event ID', () => { - expect(validateEventId('build-2025')).toBe(true); + expect(validateEventId('build-2026')).toBe(true); expect(process.exitCode).toBeUndefined(); expect(console.error).not.toHaveBeenCalled(); }); @@ -25,7 +25,7 @@ describe('validateEventId', () => { expect.stringContaining('Unknown event: unknown-event'), ); expect(console.error).toHaveBeenCalledWith( - expect.stringContaining('build-2025'), + expect.stringContaining('build-2026'), ); }); });