DX: Improve auth error messages, sparse checkout token consistency, and error deduplication#478
Draft
DX: Improve auth error messages, sparse checkout token consistency, and error deduplication#478
Conversation
Agent-Logs-Url: https://github.com/microsoft/apm/sessions/9bb842de-64e6-40cc-a925-8e944e72b76e Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
… deduplication (#470) Agent-Logs-Url: https://github.com/microsoft/apm/sessions/9bb842de-64e6-40cc-a925-8e944e72b76e Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/apm/sessions/9bb842de-64e6-40cc-a925-8e944e72b76e Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/apm/sessions/9bb842de-64e6-40cc-a925-8e944e72b76e Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve auth error messages and token consistency
DX: Improve auth error messages, sparse checkout token consistency, and error deduplication
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three DX improvements identified during RCA for #425 — not root-cause bugs, but they made auth failures harder to diagnose.
1. Misleading "transitive dep" error for direct dependencies
download_callbacknow checksdirect_dep_keysto select the right label:Failed to download dependency org/repo: <error>Failed to resolve transitive dep org/repo (via root > mid): <error>2. Sparse checkout ignoring per-org tokens
_try_sparse_checkoutusedself.github_token(global) instead ofresolve_for_dep()(per-org). Extracted shared_resolve_dep_token()helper used by both_try_sparse_checkoutand_clone_with_fallback.3. Duplicate error count on clone failure
A dep failing in the BFS resolution callback was re-attempted in the main install loop, producing two diagnostic entries ("2 packages failed" for one failure). Added
callback_failuresset; main loop skips already-failed deps with verbose logging.Type of change
Testing
4 new tests: direct vs transitive error message selection, deduplication (single error entry), sparse checkout per-org token resolution. Full suite (3112 tests) passes.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.