Commit graph

5458 commits

Author SHA1 Message Date
Kynan Ware
628325920d Reject cross-host issue refs in ResolveIssueRef
Relationship mutations (parent, sub-issue, blocked-by, blocking) run
against baseRepo's host with node IDs that must come from that same
host. Catch a different-host ref up front with a clear error instead
of letting the mutation fail with a confusing node-ID error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 18:04:48 -06:00
Kynan Ware
eff9d48f6e Replace em-dashes with hyphens in code comments
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:33:29 -06:00
Kynan Ware
0c48bd0981 Cache issue-type name->ID map and use it in issue edit
prShared.FetchOptions already fetches RepoIssueTypes when IssueType is
edited, but only kept the names. editRun then called RepoIssueTypes a
second time via ResolveIssueTypeName.

Have FetchOptions store the name->ID map on Editable, and look the ID
up directly in editRun. The lookup now also lives inside the per-issue
loop, which fixes a bug where the interactive type prompt's chosen
value was set after the upfront resolve, sending an empty issueTypeId
on the mutation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:12:29 -06:00
Kynan Ware
e9f102e8be Test interactive issue-type prompt in createRun
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 16:42:36 -06:00
Kynan Ware
85ee04d0fd Exercise loop in blocked-by/blocking createRun test
Two values per relationship verifies each ref is resolved and applied
independently rather than masking a single-iteration bug.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 16:31:02 -06:00
Kynan Ware
a04438c22c Merge createRun_issuesV2 cases into Test_createRun
Same code path, same scope. Test_createRun's httpStubs signature picks
up *testing.T to match the V2 cases that need it for input assertions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 16:27:22 -06:00
Kynan Ware
201eb7ec5e Merge issuesV2Flags cases into TestNewCmdCreate
The five Issues 2.0 cases (type, parent by number, parent by URL,
blocked-by, blocking) live as a separate parallel test today. They
exercise the same NewCmdCreate code path as the existing cases, so
fold them into TestNewCmdCreate and extend the assertions to cover
IssueType, Parent, BlockedBy, and Blocking.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 16:22:45 -06:00
Kynan Ware
a78bedb772 Wrap relationship JSON output in {nodes, totalCount}, fetch full pages
The subIssues, blockedBy, and blocking JSON output is currently shaped
as a flat array, which silently truncates when there are more entries
than the GraphQL fragment fetches. That's misleading once a user
crosses the page size, so this switches each connection to a
{nodes, totalCount} object so consumers can see when there's more.

While confirming page sizes, the GitHub limits turn out to be:

- sub-issues: up to 100 per parent
  https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/adding-sub-issues
- blocked-by / blocking: up to 50 per relationship type
  https://github.blog/changelog/2025-08-21-dependencies-on-issues/

So subIssues moves to first:100 to fetch the full set; blockedBy and
blocking stay at first:50, which already covers their cap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 16:05:07 -06:00
Kynan Ware
6e76f11dec fix: correct GraphQL field name in AddBlockedBy/RemoveBlockedBy mutations
The AddBlockedByPayload and RemoveBlockedByPayload types expose
the result as 'issue', not 'blockedIssue'. Found during live spec
testing against github.com — the mutations returned empty responses.

Updated mutation queries and corresponding test fixtures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
e3b0d9dec3 fix: restore displaced TODO comment, add GHES edit relationship test
- Restore // TODO projectsV1Deprecation comment above
  TestProjectsV1Deprecation (was displaced when new tests were
  inserted at that location)
- Add 'relationships unsupported on GHES' test case to edit command
  using DisabledDetectorMock (parity with create's GHES tests)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
4a196ddf1d test: add regression test for issue-only fields in FieldsToEditSurvey
Verifies Type and Parent only appear in the interactive picker when
Allowed is explicitly set. Prevents regression where issue-only
fields leak into gh pr edit's interactive mode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
2a72a59f76 fix: address round 2 code review findings
- Fix PR edit regression: gate Type and Parent behind Allowed bool
  in FieldsToEditSurvey, matching the Reviewers.Allowed pattern.
  Only issue edit sets Allowed=true; PR edit won't show these fields.
- Add missing RemoveBlocking assertion in flag parsing tests
- Quote issue type names containing spaces in search queries
  (type:"Bug Report" instead of type:Bug Report)
- Remove duplicate TODO comment in view.go
- Avoid double RepoIssueTypes API call in interactive create:
  cache the resolved ID from the picker, skip re-resolution
- Rename applyIssueTypes → applyIssueType (singular)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
b6f29b0376 feat: add --remove-blocking flag to issue edit
Completes the symmetry of relationship flags:
- --add-blocked-by / --remove-blocked-by
- --add-blocking / --remove-blocking

The --remove-blocking flag swaps API args (same as --add-blocking):
calls RemoveBlockedBy(issueId=OTHER, blockingIssueId=THIS).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
3f1df513c5 test: add missing --type flag tests for issue list
Add flag parsing and behavior tests for gh issue list --type:
- TestNewCmdList/type_flag: verifies opts.IssueType is set
- Test_issueList/with_issue_type: verifies search path is forced
  and query includes type:Bug qualifier

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
c00bc6a9b4 fix: address code review findings from multi-model review
Critical fixes:
- GHES data-flow regression: blockedBy/blocking fields now
  conditionally added to view lookupFields only when
  IssueRelationshipsSupported is true (GHES 3.19+). Previously
  would break gh issue view on GHES 3.17-3.18.
- State line separator: restore original bullet (•) to avoid
  breaking downstream parsers. Issue type prefix uses middle dot (·).

Optimizations:
- Batch edit --type: resolve issueTypeID once before the loop
  instead of per-goroutine (eliminates N-1 redundant API calls)
- Parent removal: include id in parent GraphQL fragment, use
  issue.Parent.ID directly instead of extra IssueNodeID lookup

Nit fixes:
- Fix formatLinkedIssueRef godoc to match actual behavior

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
ddb2fce07b refactor: extract shared helpers for issue ref resolution and type lookup
Address code review findings:

- Extract resolveIssueRef into shared.ResolveIssueRef (was duplicated
  between create.go and edit.go)
- Extract issue type name→ID resolution into shared.ResolveIssueTypeName
  (was duplicated between create applyIssueTypes and edit applyEditIssueType)
- Fix double import of issue/shared in view.go

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
4c12393b88 test: add comprehensive tests for Issues 2.0 features
Create tests (11 new):
- Flag parsing: --type, --parent (number/URL), --blocked-by, --blocking
- Behavior: type resolution + mutation, type not found error,
  parent resolution + addSubIssue, blocked-by/blocking with
  swapped args verification, GHES unsupported error

Edit tests (18 new):
- Flag parsing: --type, --set-parent, --remove-parent, mutual
  exclusivity, --add-sub-issue, --remove-sub-issue,
  --add-blocked-by, --remove-blocked-by, --add-blocking
- Behavior: type edit, set/remove parent, add/remove sub-issues,
  add/remove blocked-by, add-blocking with swapped args,
  batch edit type across multiple issues
- Bug fix: copy SetParent value into Editable.Parent.Value

View tests (5 new):
- TTY: full view with all Issues 2.0 fields, regression test
  with no new fields
- JSON: issueType export, parent/subIssues/subIssuesSummary
  export, blockedBy/blocking export

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
67f63a1096 feat: add --type filter flag to issue list
Filter issues by type using the search API path. The --type flag
appends a type: qualifier to the search query, forcing the search
path (same as --label and --milestone).

Updated FilterOptions with IssueType field, IsDefault(), and
SearchQueryBuild() to include the type qualifier.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
b7ee31d791 feat: add Issues 2.0 flags to issue edit
New flags for issue edit:
- --type: set issue type by name
- --set-parent / --remove-parent: set or remove parent issue
  (mutually exclusive via cmdutil.MutuallyExclusive)
- --add-sub-issue / --remove-sub-issue: manage sub-issues
- --add-blocked-by / --remove-blocked-by: manage blocked-by relationships
- --add-blocking: add blocking relationships (swaps API args)

Interactive mode: Type and Parent added to the field picker survey.
FetchOptions loads issue types when Type is selected.

Editable struct: added IssueType and Parent fields with Dirty(),
Clone(), FieldsToEditSurvey, and EditFieldsSurvey support.

GHES: relationships gated behind IssueRelationshipsSupported.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
44e9f4bd50 feat: add --type, --parent, --blocked-by, --blocking to issue create
Post-creation mutations for Issues 2.0 fields:
- --type: resolve type name to ID via RepoIssueTypes, then
  updateIssueIssueType mutation
- --parent: resolve issue ref (number or URL), then addSubIssue
  mutation (supports cross-repo URLs)
- --blocked-by: resolve refs, then addBlockedBy mutations
- --blocking: resolve refs, then addBlockedBy with swapped args

Interactive mode: type picker when repo has issue types configured.

GHES: relationships gated behind IssueRelationshipsSupported feature
detection (3.19+). Types and sub-issues need no detection (GA 3.17+).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
7dae882c9d feat: add Issues 2.0 fields to issue view
Display new issue metadata in TTY view:
- Issue type on state line (gray, before Open/Closed)
- Type, Parent, Blocked by, Blocking metadata rows
- Sub-issues section with completion progress (X/Y, Z%)
- Cross-repo references show full owner/repo#N format

All new fields included in defaultFields and JSON export.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Pavel Dostál
20e4d25147 Add missing //go:build integration tag to verify_integration_test.go
The four tests in this file (TestVerifyIntegration,
TestVerifyIntegrationCustomIssuer, TestVerifyIntegrationReusableWorkflow,
TestVerifyIntegrationReusableWorkflowSignerWorkflow) call
NewLiveSigstoreVerifier which requires network access to Sigstore and
GitHub TUF servers. Unlike the other integration test files in this
package (attestation_integration_test.go, sigstore_integration_test.go,
inspect_integration_test.go), this file was missing the //go:build
integration tag, causing these tests to run during a regular
'go test ./...' and fail in network-isolated build environments.
2026-04-28 18:20:23 +02:00
travellertales
e40c592e42
Update command.go 2026-04-27 10:19:56 -04:00
Sam Morrow
2c1f5b2f72
Merge pull request #13264 from SamMorrowDrums/sammorrowdrums/skill-ghec-data-residency
feat(skills): support GHEC with data residency hosts
2026-04-24 11:45:28 +02:00
Sam Morrow
96b9af3443
Merge pull request #13266 from cli/sammorrowdrums/fix-skill-install-flat-path
Install skills flat by Name, not namespaced InstallName
2026-04-24 11:41:03 +02:00
Sam Morrow
5a121bf331
Merge pull request #13265 from SamMorrowDrums/sammorrowdrums/preview-allow-hidden-dirs-flag
feat(skills): add --allow-hidden-dirs flag to preview command
2026-04-24 11:39:24 +02:00
William Martin
9a3dc9fce7 Fix log terminal injection 2026-04-23 13:56:33 +02:00
sammorrowdrums
d961de44d7 fix(skills): include --allow-hidden-dirs in preview hint from install
The review hint printed after `gh skill install --allow-hidden-dirs`
suggests `gh skill preview` commands. Those commands would fail for
hidden-dir skills because preview would filter them out. Pass the
flag through so the suggested commands work as-is.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 10:23:26 +02:00
Copilot
2e93afc272 Install skills flat by Name, not namespaced InstallName
Most agent clients (Claude Code, Copilot, etc.) only discover immediate
subdirectories of their skills folder. When a skill repository used
namespaced paths like skills/author/my-skill/, the installer created
nested directories (e.g. .claude/skills/author/my-skill/) that clients
could not find.

This separates the skill's identity (InstallName, used for lockfile keys,
search, filtering, display) from the filesystem path (Name, used for the
install directory). Skills are now always installed flat:

  .claude/skills/my-skill/SKILL.md  (not .claude/skills/author/my-skill/)

Changes:
- installer: use skill.Name for directory paths instead of InstallName
- install.go: use skill.Name for overwrite checks and prompts
- collisions: detect conflicts by Name since flat install means two
  skills with the same Name but different Namespace values will collide
- update: clean up old namespaced directories when migrating to flat

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 01:26:31 +02:00
Copilot
8498bdf435 feat(skills): add --allow-hidden-dirs flag to preview command
Add support for the --allow-hidden-dirs flag in `gh skill preview`,
matching the existing pattern in `gh skill install`. This allows users
to preview skills located in hidden directories (e.g. .claude/skills/,
.agents/skills/).

Changes:
- Add AllowHiddenDirs field to PreviewOptions
- Register --allow-hidden-dirs flag on the preview command
- Switch from DiscoverSkills to DiscoverSkillsWithOptions to get all
  skills including hidden-dir ones
- Add filterHiddenDirSkills to exclude hidden-dir skills by default,
  showing a hint when they are found but excluded
- Print a warning when --allow-hidden-dirs is used and hidden skills
  are present
- Return an error when only hidden-dir skills exist without the flag

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 23:41:25 +02:00
sammorrowdrums
63262dce8b feat(skills): support GHEC with data residency hosts
Widen ValidateSupportedHost to accept tenancy hosts (*.ghe.com) alongside
github.com. GHEC with data residency uses these domains, and all skill
subcommands (search, install, preview, publish, update) now allow them.

GitHub Enterprise Server remains unsupported and is explicitly rejected
with a clear error message.

Also fix the lockfile writer to use the actual host when constructing
SourceURL instead of hardcoding github.com.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 23:27:38 +02:00
Sam Morrow
92e812b749
Merge pull request #13236 from cli/sammorrowdrums/skill-install-upstream-provenance 2026-04-21 19:29:31 +02:00
Sam Morrow
50f0f8fc68
feat(skills): detect re-published skills and offer upstream install
When installing a skill whose SKILL.md contains github-repo metadata
pointing to a different repository, the CLI detects it as a re-published
skill and offers to redirect the install to the upstream source.

In interactive mode, the user is prompted to choose between the
re-publisher (default) and the upstream. In non-interactive mode,
the install proceeds from the re-publisher with a notice.

The --upstream flag skips the prompt and redirects to upstream directly,
enabling non-interactive upstream installs in CI/scripts.

If the user chooses upstream, the install restarts from that repo,
resolving the latest version and discovering skills fresh. A
skill_upstream_redirect telemetry event is emitted to track redirects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-21 18:39:35 +02:00
William Martin
6b811db467 Add telemetry command 2026-04-21 17:13:27 +02:00
William Martin
e52070e07e
Merge pull request #13205 from cli/wm/record-official-extension-telemetry
Record official extension telemetry
2026-04-21 11:57:11 +02:00
William Martin
c50fb793ea Record official extension telemetry 2026-04-21 11:48:32 +02:00
Sam Morrow
1b236f23c5
Merge pull request #13249 from cli/sammorrowdrums/fix-skill-install-preview-sha
fix(skills): match skills by install name in preview command
2026-04-21 11:30:11 +02:00
Sam Morrow
6fcc9c24df
fix(skills): prioritize DisplayName/Name over InstallName match
Use a two-pass search so exact DisplayName and Name matches are
preferred over InstallName. This avoids incorrectly selecting a
plugins-convention skill via InstallName when a standard namespaced
skill with a matching DisplayName exists later in the sorted slice.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-21 10:09:20 +02:00
Sam Morrow
a67f4f7303
Merge pull request #13235 from cli/sammorrowdrums/fix-skill-install-discovery
Make skill discovery less strict: support nested `skills/` directories
2026-04-21 10:01:53 +02:00
Sam Morrow
1160943af3
fix(skills): match skills by install name in preview command
The preview command's selectSkill function only matched skills by
DisplayName() and Name. For plugins-convention skills, the install
hint outputs InstallName() (namespace/name), which matched neither -
DisplayName() includes a [plugins] prefix and Name is just the base
name. This caused 'skill not found' errors when users ran the
suggested preview command after install.

Add InstallName() as an additional match criterion so that namespaced
skill identifiers produced by the install hint are accepted.

Closes #13248

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-21 09:56:27 +02:00
Sam Morrow
9a368f45e9
feat(skills): support nested skills/ directories in discovery
Relax skill discovery to recognize skills/ directories at any depth
in the repository tree, not just at the root. This enables repos like
hashicorp/agent-skills that organize skills under prefixes such as
terraform/code-generation/skills/*/SKILL.md.

Changes:
- matchSkillConventions: add checks for <prefix>/skills/<name>/SKILL.md
  and <prefix>/skills/<ns>/<name>/SKILL.md at any depth
- isSkillPath: also match paths containing /skills/ for direct
  path-based install
- DiscoverSkillByPath: fix namespace detection to find the skills
  segment anywhere in the path
- Update error messages and help text to mention nested conventions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 21:07:15 +02:00
Sam Morrow
49d4747a81
Merge pull request #13237 from cli/sammorrowdrums/fix-skill-publish-fix-flag 2026-04-20 19:23:09 +02:00
Sam Morrow
f88a2a671c
fix(skills): make --fix and --dry-run mutually exclusive, suppress publish prompt
- --fix and --dry-run now error when combined
- "Ready to publish!" is suppressed when --fix is set since user must
  commit first

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 12:36:57 +02:00
Sam Morrow
c703294fbe
fix(skills): use canonical 'gh skill' not 'gh skills' alias
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 12:34:59 +02:00
Sam Morrow
2e64043d55
fix(skills): stop publish --fix from publishing
When --fix is used, return early after applying fixes instead of
continuing to the publish flow. The fixed files need to be committed
before publishing, so proceeding would fail anyway since the repo
would not be in sync.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 12:22:55 +02:00
William Martin
78f1ad537c Include CI context in telemetry 2026-04-20 12:02:56 +02:00
Sam Morrow
eaa018545a
refactor: decouple hidden-dir filtering from discovery layer
Move --allow-hidden-dirs filtering logic from the discovery package to
the install command, addressing review feedback. Discovery functions now
always return all skills (including hidden-dir), and callers decide how
to handle them.

Changes:
- DiscoverSkillsWithOptions/DiscoverLocalSkillsWithOptions always return
  hidden-dir skills; callers filter using IsHiddenDirConvention()
- DiscoverSkills/DiscoverLocalSkills (convenience wrappers) auto-filter
  hidden-dir skills for backward compatibility with preview/update/publish
- Remove --allow-hidden-dirs reference from discovery error messages
- Add filterHiddenDirSkills in install.go with caller-side flag logic
- Inline warning using heredoc.Docf, remove printHiddenDirWarning
- Add inline comments in matchHiddenDirConventions (babakks nitpicks)
- Add non-hidden-namespaced dir and no-skills-at-all test cases
- Add --allow-hidden-dirs tests in TestNewCmdInstall, TestInstallRun,
  and TestRunLocalInstall

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 11:14:39 +02:00
Tommaso Moro
082f15a8fd
Add support for installation in multiple agent hosts in gh skills install (#13209)
* add support for installation in multiple agent host

* print correct dir in warning

* remove dir as it depends on user vs project installation scope

* Move comment closer to assertion in registry test

Move the explanatory comment from above the map initialization to
directly above the assertions it describes, per review feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* List supported agent names and IDs in help text

Replace the self-referencing "run --help" sentence with an inline list
of all supported --agent values showing Name (id) pairs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use heredoc.Docf for Kiro CLI post-install hint

Replace individual fmt.Fprintln calls with a single heredoc.Docf block
for the Kiro CLI post-install guidance, per review feedback. Also
shorten the --agent flag usage line by overriding the auto-generated
enum list with a reference to the supported values in the help text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-18 15:22:09 -06:00
William Martin
998b6212b3
Add skills specific telemetry
* Add skills specific telemetry

* Remove VisibilityFuture, inline goroutine at call sites

The VisibilityFuture/FetchRepoVisibilityAsync/Wait wrapper was an
unidiomatic async abstraction built for a single pattern used in
exactly two call sites. In Go the channel is already the future;
wrapping it in a struct with a Wait(timeout) method adds no value.

Delete the abstraction and inline a local visResult struct,
buffered channel, goroutine, and select at each call site. Behavior
is preserved exactly: err -> "unknown", timeout -> "unknown",
success+public -> include skill_names.

FetchRepoVisibility (synchronous) is kept as-is.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix nonsense copilot tests

* Update telemetry tests for public-only dims and search event removal

Production telemetry emission changed:
- preview: skill_owner/skill_repo/skill_name (renamed from skill_names)
  are now emitted only when repo_visibility=public.
- install: skill_owner/skill_repo/skill_names are now emitted only
  when repo_visibility=public.
- search: the initial skill_search event was removed entirely; the
  skill_search_install event no longer carries query/owner dims.

Update tests to match: rename skill_names -> skill_name in preview,
make owner/repo assertions conditional on public visibility in both
preview and install, and reduce the search test to a single event
with explicit Empty assertions for the removed query/owner dims so a
privacy regression cannot pass silently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Test CategorizeHost and switch telemetry to skill_host_type

Add TestCategorizeHost covering all four classification branches
(github.com, ghes, tenancy, uncategorized) with cases verified
against the real ghauth implementation rather than guessed.

Update install and preview unit tests to assert the new
skill_host_type dimension name, and fix a typo in the preview
acceptance txtar (skill_hos_type -> skill_host_type).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Shrink visibility wait and test unknown visibility

The 2s visibilityWaitTimeout was wildly overprovisioned: by the time
telemetry emission reaches the select, the command has already done
several serial GitHub REST calls (and for install, a git sparse-checkout
plus possibly interactive prompts), so the one-call visibility fetch
has almost always completed. Drop the timeout to 200ms — a short safety
net for a stalled REST call, not a wait budget for a healthy one.

Also adds a table-driven case to TestFetchRepoVisibility covering an
unknown/future visibility value from the API, addressing @babakks'
review nitpick.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 19:58:59 +02:00
William Martin
6709e315df Do not send telemetry for aliases 2026-04-17 14:28:49 +02:00