Skip to content

Commit d3ab5d4

Browse files
dhensbyclaude
andcommitted
docs: document the tool-cache wrapper in agent instructions
Record that all tool-cache access must go through src/tool-cache.ts because find() only matches explicit semver versions, and that cached cumulative updates are intentionally reused per SQL Server version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2de5cde commit d3ab5d4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎.github/copilot-instructions.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ The build step (`npm run build`) also runs `npm run docs`, which regenerates the
5454

5555
**Version registry:** `src/versions.ts` defines a `Map<string, VersionConfig>` with download URLs (exe/box or SSEI), optional update URLs, and OS compatibility constraints for each supported SQL Server version (2008–2025). SQL Server 2025+ uses the SSEI bootstrapper model (`sseiUrl`) instead of direct exe/box downloads. For SSEI versions, `downloadSseiInstaller()` first downloads the media into its own temporary directory. Box and SSEI media are then extracted into a fresh temporary directory by `extractAndCacheInstaller()`, which checks that `setup.exe` was produced before adding it to the tool cache.
5656

57+
**Tool cache:** Cache and look up downloads only through `src/tool-cache.ts` (`findCachedTool`, `cacheToolDir`, `cacheToolFile`), never `@actions/tool-cache` directly. Its `find()` only does an exact lookup for explicit semver versions, so the wrapper pads versions like `'2022'` to `'2022.0.0'`; a direct `tc.find('sqlserver', '2022')` silently never hits. `test/tool-cache.ts` exercises the real library — keep it unmocked. Cumulative updates are intentionally cached per SQL Server version rather than per CU, so a runner with a persistent tool cache keeps reusing the first CU it downloaded (documented in the README "Caching" section).
58+
5759
**Build output:** Rollup (config in `rollup.config.mjs`) bundles everything into `lib/main/index.js` as a minified ESM module, which is what `action.yml` references. The `lib/` directory is committed to the repository. **Every commit must include up-to-date build output** — CI checks this by rebuilding and running `git diff-files --quiet`. Always run `npm run build` and commit the resulting changes to `lib/` and `README.md` before pushing.
5860

5961
**ESM module format:** The package is published as ESM (`"type": "module"` in `package.json`). Consequences for contributors:

0 commit comments

Comments
 (0)