mirror of
https://github.com/warpdotdev/common-skills.git
synced 2026-09-14 19:03:05 +08:00
4b3668c60a
Review of the previous revision found that pruning by checking whether a copied path existed under the temp dir failed open: if skills add exited 0 without actually copying anything (e.g. a broken CLI run), every warpdotdev/common-skills entry looked stale and got deleted, while the one entry from another source survived. That result is worse than the original bug and would auto-merge into warp and warp-server. Restructure the fix: regenerate the warpdotdev/common-skills portion of the lock from scratch in a clean, unseeded temp directory instead of seeding it with the existing lock and pruning what didn't reappear. skills add can then only ever emit entries for skills it actually finds, so nothing stale can survive the merge in the first place. Entries from any other source are carried over from the existing lock unmodified. As a backstop, fail closed with a non-zero exit and leave the existing lock untouched if regenerating produces no warpdotdev/common-skills entries at all while the existing lock has some - that is a sign the run didn't discover or copy anything, not that every skill vanished upstream. Add scripts/tests/update_common_skills_lock_test.sh, a self-contained regression suite that runs the real script against a fake npx (scripts/tests/fake-bin/npx) modeling `skills add ... --copy` deterministically from a local fixture directory, with no network access. Covers a rename, a plain deletion, foreign-source preservation, idempotence, and the fail-closed guard. Wire it into a new CI workflow that runs on push to main and on every pull request. Co-Authored-By: Warp Agent <agent@warp.dev>
22 lines
465 B
YAML
22 lines
465 B
YAML
name: Test scripts
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-update-common-skills-lock:
|
|
name: Test update_common_skills_lock
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
|
|
- name: Run update_common_skills_lock regression tests
|
|
run: scripts/tests/update_common_skills_lock_test.sh
|