Repository navigation
Conversation
Add error categories for aitools install failures and classify wrapped standard library errors (network, timeout, interrupt, missing manifest, permission and filesystem errors) by type, without reading error text. JSON decode errors stay UNCATEGORIZED. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
✅ Integration test reportCommit: a6fd339
Top 3 slowest tests (at least 2 minutes):
|
This branch has not been deployed
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.
Adds 16
AitoolsErrorCategoryvalues and classifies wrapped standard library errors by type, never by error text.Summary
The order matters in two places:
syscall.Errnoimplementsnet.Error. Without the bare-Errnocheck, every OS file error would be reported asNETWORK. The check is a direct type assertion becauseerrors.Aswould also match theErrnoinside a*net.OpError.connect: EACCES) is stillNETWORK.JSON decode errors stay
UNCATEGORIZED. The manifest, the release payload and.state.jsonall decode JSON, so the error type alone can't tellMANIFEST_INVALIDfromSTATE_INVALID. A follow-up PR adds typed fetch and state errors that set those.New values (
libs/telemetry/protos/aitools_install.go). Only some are emitted by this PR:NETWORK,TIMEOUT,MANIFEST_NOT_FOUND,PERMISSION_DENIED,FILESYSTEMINVALID_FLAGS,UNKNOWN_AGENT,PROMPT_FAILED,USER_ABORTED(follow-up: install flow telemetry)RELEASE_LOOKUP_FAILED,RATE_LIMITED,SKILLS_FETCH_FAILED,MANIFEST_INVALID,STATE_INVALID,PLUGIN_CLI_TIMEOUT(follow-up: typed installer errors)COMMAND_INTERRUPTED(nothing on the install path cancels the context yet)Changelog fragment:
.nextchanges/cli/aitools-install-error-categories.md.Evidence
TestClassifyInstallErrorGenericCauses: one case per branch, including a refused connection, a sandbox-blocked socket, EBUSY on rename, and a real missing-file error fromos.ReadFile.categorize.gowith this PR's tests):UNCATEGORIZED.TestClassifyInstallErrorCorruptStateIsUncategorizedruns the realinstaller.LoadStateon a corrupt file and getsUNCATEGORIZED, notMANIFEST_INVALID.Full run on the same change before rebasing onto current main: unit tests 8633 passed / 0 failed; acceptance tests (every dir except
bundle/) 350 passed / 0 failed; lint, fmt, whitespace, deadcode and.nextchangeschecks clean.GOOS=windows go vet ./cmd/aitools/passes. The tests were not run on Windows.Merge Danger
Door: Two-way for the code, one-way for the enum names once a CLI release ships them.
Reverting the classifier is trivial. But once released binaries send these strings, the server must keep accepting them. The telemetry backend schema must add these values before or together with the CLI release. If the CLI ships first, the backend records unknown names as a NULL
error_category; the event is still recorded.Blast Radius: Telemetry.
Only the
error_categoryin aitools install telemetry and inaitools install --output jsonchanges. Install behaviour and exit codes don't change. Known gap: a malformedDATABRICKS_SKILLS_BASE_URLis reported asNETWORK.Open item: add this PR's link to the changelog fragment (
task check-changelogrequires it).This pull request and its description were written by Isaac.