Skip to content

Fix cache schema tests and smoke fixture left stale by 2025 event removal - #66

Open
zx000097 wants to merge 2 commits into
mainfrom
zanebong-microsoft-fix-stale-cache-schema-tests
Open

zx000097 wants to merge 2 commits into
mainfrom
zanebong-microsoft-fix-stale-cache-schema-tests

Conversation

@zx000097

@zx000097 zx000097 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

main at 768c8c8 has two related breaks left by combining #43 and #64. The first broke our internal npm test pipeline when it built @microsoft/events-cli@0.3.3:

  1. Two tests in cli/test/cache.test.ts (automatic cache revalidation) fail:
    • forces a full GET when cache schema is outdated: readMeta('build-2025').schemaVersion stays 1 (expected CACHE_SCHEMA_VERSION).
    • skips fetch when cache schema version is current: fetch is called once for https://aka.ms/ignite2026-session-info.
  2. The CI step npm run smoke:fixture fails with Expected one session for BRK212. This was hidden on main because the test step fails first.

Root cause

  • Add cache schema versioning to invalidate stale caches #43 added cache schema versioning and these tests. The tests seed build-2025, ignite-2025, and build-2026, and test 1 asserts on build-2025.
  • Remove retired 2025 events and bump CLI to 0.3.3 #64 merged afterwards and removed the retired 2025 events. cli/src/config.ts now configures only build-2026 and ignite-2026, and the smoke script now seeds the fixture as build-2026.
  • Each PR passed CI separately, but together on main:
    • ensureCache() no longer revalidates build-2025, so its schema version stays at 1.
    • ignite-2026 isn't seeded, so ensureCache() fetches it.
    • The smoke script writes fixture meta without schemaVersion, so the CLI treats it as outdated and does a full live GET. Before Remove retired 2025 events and bump CLI to 0.3.3 #64 the build-2025 endpoint returned 404 and the CLI fell back to the fixture cache. Now the live build-2026 catalog replaces the fixture sessions, so the fixture session code BRK212 is no longer found.

Changes (tests and smoke script only)

  • Outdated-schema test: seeds build-2026 at schema v1 and ignite-2026 at the current schema. It now asserts:
    • exactly one fetch, to the build-2026 endpoint
    • no conditional headers on that request
    • build-2026 meta is updated to CACHE_SCHEMA_VERSION with lastCheckStatus updated
    • The mock session title and comment now refer to 2026.
  • Current-schema test: seeds build-2026 and ignite-2026 at CACHE_SCHEMA_VERSION and asserts that nothing is fetched.
  • cli/scripts/smoke-fixture.mjs: writes schemaVersion: CACHE_SCHEMA_VERSION (imported from dist/data/cache.js) into the fixture meta, so the smoke test uses the fixture cache instead of live data.

No CLI source, SKILL.md, or plugin manifest changes, so no version bump is needed. Other build-2025 references in cli/test/ (normalize.test.ts, search.test.ts) only label the static fixture in pure-function tests. They don't depend on the configured events, so I left them unchanged. smoke:m365 runs offline (cache read-only), so it doesn't need schemaVersion.

Validation (from cli/)

Command Result
npx vitest run test\cache.test.ts (before fix) ❌ 2 failed, 22 passed (reproduced both failures)
npm run smoke:fixture (before fix) ❌ Expected one session for BRK212 (reproduced)
npm run build ✅ passed
npx vitest run test\cache.test.ts ✅ 24 passed
npm test ✅ 7 files, 77 tests passed
npm run smoke:fixture ✅ passed
npm run smoke:m365 ✅ passed (plugin folder; 10 commands match the CLI)

npm run smoke:m365 -- --package (needs atk) and npm run smoke:live were not run locally; CI covers them.

The schema-version tests from #43 seeded and asserted on build-2025/ignite-2025,
which #64 removed from config. ensureCache() no longer revalidates build-2025 and
fetches the unseeded ignite-2026. Seed only the configured 2026 events instead.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 02:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the test-only update aligning cache schema fixtures with supported 2026 events.

No open issues 🎉

What changed in this PR

Updates cache schema tests to match the supported 2026 events, resolving stale assumptions left by the removal of the 2025 catalogs. Changes are test-only; no CLI behavior or plugin versions change.

Changes:

  • Seeds Build 2026 and Ignite 2026 caches in both schema tests.
  • Strengthens the outdated-schema test by checking the exact Build 2026 endpoint while retaining full-GET and metadata assertions.
File Description
cli/​test/​cache.test.ts Aligns schema-test fixtures with supported events and verifies the expected fetch endpoint.

Review effort: Balanced

Without schemaVersion the CLI treats the fixture cache as outdated and does a full live GET, replacing the 2025 fixture sessions with live build-2026 data so the fixture session code lookup fails. This was hidden on main because the cache tests failed first.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 02:47
@zx000097 zx000097 changed the title Fix cache schema tests left stale by 2025 event removal Fix cache schema tests and smoke fixture left stale by 2025 event removal Nov 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the cache-validation test and smoke-fixture metadata updates.

No open issues 🎉

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants