Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions acceptance/testdata/skills/skills-install-namespaced.txtar
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Two namespaced skills with the same base name in the same repo should
# Two namespaced skills with different base names in the same repo should
# be independently installable using path-based disambiguation.
# Skills are installed flat (by base name) so each must have a unique name.

# Use gh as a credential helper
exec gh auth setup-git

# Create a repo with two namespaced skills that share the name "deploy"
# Create a repo with two namespaced skills that have unique base names
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --public --add-readme
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING

exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING
cd $SCRIPT_NAME-$RANDOM_STRING

mkdir -p skills/alice/deploy
mkdir -p skills/bob/deploy
cp $WORK/alice-skill.md skills/alice/deploy/SKILL.md
cp $WORK/bob-skill.md skills/bob/deploy/SKILL.md
mkdir -p skills/alice/alice-deploy
mkdir -p skills/bob/bob-deploy
cp $WORK/alice-skill.md skills/alice/alice-deploy/SKILL.md
cp $WORK/bob-skill.md skills/bob/bob-deploy/SKILL.md

exec git add -A
exec git commit -m 'Add namespaced skills'
Expand All @@ -23,25 +24,25 @@ exec git push origin main
# Publish so the skills are discoverable
exec gh skill publish --tag v1.0.0

# Install alice's deploy skill using the full path to disambiguate
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/alice/deploy --scope user --force
stdout 'Installed alice/deploy'
# Install alice's skill using the full path to disambiguate
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/alice/alice-deploy --scope user --force
stdout 'Installed alice/alice-deploy'

# Install bob's deploy skill using the full path
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/bob/deploy --scope user --force
stdout 'Installed bob/deploy'
# Install bob's skill using the full path
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/bob/bob-deploy --scope user --force
stdout 'Installed bob/bob-deploy'

# Verify both were installed to separate directories
exists $HOME/.copilot/skills/alice/deploy/SKILL.md
exists $HOME/.copilot/skills/bob/deploy/SKILL.md
# Verify both were installed to flat directories (by base name)
exists $HOME/.copilot/skills/alice-deploy/SKILL.md
exists $HOME/.copilot/skills/bob-deploy/SKILL.md

# Verify each has the correct content
grep 'Alice' $HOME/.copilot/skills/alice/deploy/SKILL.md
grep 'Bob' $HOME/.copilot/skills/bob/deploy/SKILL.md
grep 'Alice' $HOME/.copilot/skills/alice-deploy/SKILL.md
grep 'Bob' $HOME/.copilot/skills/bob-deploy/SKILL.md

-- alice-skill.md --
---
name: deploy
name: alice-deploy
description: Alice's deployment skill
---

Expand All @@ -51,7 +52,7 @@ Deploys infrastructure using Alice's conventions.

-- bob-skill.md --
---
name: deploy
name: bob-deploy
description: Bob's deployment skill
---

Expand Down
7 changes: 2 additions & 5 deletions acceptance/testdata/skills/skills-publish-dry-run.txtar
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Publish dry-run from a directory with no skills/ should fail gracefully
! exec gh skill publish --dry-run $WORK
mkdir $WORK/empty-dir
! exec gh skill publish --dry-run $WORK/empty-dir
stderr 'no skills found in'

# Publish dry-run against a valid skill directory should succeed
Expand All @@ -10,10 +11,6 @@ stdout 'hello-world'
exec gh skill publish --dry-run --tag v1.0.0 $WORK/test-repo
stdout 'hello-world'

# Publish dry-run with --fix
exec gh skill publish --dry-run --fix $WORK/test-repo
stdout 'hello-world'

-- test-repo/skills/hello-world/SKILL.md --
---
name: hello-world
Expand Down
Loading