Skip to content

Add inline script environment lifecycle telemetry (PEP 723 PR 15/16) - #10

Closed
StellaHuang95 wants to merge 5 commits into
mainfrom
pep723-pr15-telemetry-v2
Closed

Add inline script environment lifecycle telemetry (PEP 723 PR 15/16)#10
StellaHuang95 wants to merge 5 commits into
mainfrom
pep723-pr15-telemetry-v2

Conversation

@StellaHuang95

Copy link
Copy Markdown
Owner

Clean-history replacement for #4. Fork-review PR; do not send upstream yet.

Part of microsoft#1602. This is roadmap PR 15 of 16 and builds on merged PRs 5–7.

Summary

  • add inlineScript.envCreated
  • add inlineScript.envReuseHit
  • add inlineScript.envError
  • define typed GDPR-safe schemas and stable low-cardinality error categories

Semantics

  • emit creation only after verified creation and sidecar persistence
  • measure actual build/rebuild duration, excluding lock wait and cache inspection
  • emit reuse only after complete cache validation
  • emit one lifecycle result per underlying coalesced operation
  • distinguish discovery failure, no compatible Python, user decline, install failure, package cancellation, lock timeout, and retained/orphaned lock unavailability
  • send no URI, path, version, dependency value, requirement, package name, or error-message content
  • preserve existing uv prompts, behavior, and telemetry

Scope

Telemetry only: no routing, discovery, cleanup, UI, project registration, retries, or cache algorithm changes.

Validation

  • TypeScript test compilation
  • ESLint
  • focused unit suite: 137 passing
  • two manual review passes; no significant findings remain

@StellaHuang95

Copy link
Copy Markdown
Owner Author

🔒 Automated review in progress — @StellaHuang95 is auto-reviewing this PR.

Comment thread src/managers/builtin/inlineScript/envManager.ts
Comment thread src/managers/builtin/uvPythonInstaller.ts
Comment thread src/test/managers/builtin/inlineScript/envManager.unit.test.ts Outdated
Comment thread src/test/managers/builtin/inlineScript/envManager.unit.test.ts
@StellaHuang95 StellaHuang95 added the review-auto:changes-requested Automated review: posted blocking findings to address. label Aug 17, 2026
## Summary

Adds a package-manager-centric integration baseline that intentionally
precedes and de-risks microsoft#1686, so the package-manager command refactor is
exercised against behavior established on `main`.

- drives one stateful install/list/direct-package/uninstall lifecycle
per active profile
- uses unique disposable projects and manager-owned disposable
environments
- exercises the live registered manager instances through a
runtime-gated integration-test bridge
- guards registry completeness so every registered package-manager ID
has an active fixture or explicit deferral
- covers normal Pip execution and Conda when their runtime prerequisites
are available
- records an uncached baseline instead of assuming a newly created
environment is empty
- restores workspace-scoped configuration from `inspect()` snapshots and
performs guarded failure-safe cleanup
- defers Poetry pending a Poetry-owned project/lockfile lifecycle
- defers uv-backed Pip because changing the machine-scoped selection
reliably within one extension host was not stable on `main`, while
available-version lookup would also introduce `uv tool run pip` network
seeding
- pins the disposable integration-test user profile to normal Pip
execution

## Validation

- `npm run compile`
- `npm run compile-tests`
- `npm run lint`
- `npm run unittest`
- targeted `packageManagement.integration.test.js`: 3 passing, 2
prerequisite skips locally
- Pip skipped because quick create selected Python 3.15.0 alpha, whose
bundled Pip metadata is incomplete
  - Conda skipped because Conda is not installed
- reviewer specialist: clean, no Critical or Important findings

The active Pip and Conda fixtures require package-index/network access
when their runtime prerequisites are present.

Fixes microsoft#1701

---------

Copilot-Session: 6b2fe9b5-38ea-442f-b07a-b6c71134d480
Copilot-Session: 3fd1a810-6840-4ac9-ac33-c8a9fda4bfc4
@StellaHuang95

Copy link
Copy Markdown
Owner Author

0e3584f is test-only: it adds the requested detailed uv outcome and normalized dependency-count coverage without changing telemetry emission, installation behavior, routing, activation, or default-off flows.

Comment thread src/test/managers/builtin/inlineScript/envManager.unit.test.ts Outdated
@@ -167,6 +185,7 @@ export class InlineScriptEnvManager implements EnvironmentManager, Disposable {
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Non-blocking recommendation

If a shared pendingSetups promise rejects, each awaiting create() caller can reach this catch and emit install-failure, violating the one-result-per-coalesced-operation contract. Catch and report at the shared promise boundary, then add a concurrent rejection test expecting one event.

[verified]

@StellaHuang95 StellaHuang95 added review-auto:approved Automated review: no blocking findings (approval posted). and removed review-auto:changes-requested Automated review: posted blocking findings to address. labels Aug 18, 2026
mrleemurray and others added 4 commits August 18, 2026 11:07
)

Replace the existing activity bar icon with a new design more aligned
with the wider codicon design language.


![image.png](https://github.com/user-attachments/assets/65b0c66b-0e1a-4610-89d7-94206fafa044)

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3cb82ae9-7424-40a4-9156-8c54ac6e0895
Cover detailed uv outcomes and normalized dependency counts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6b12d843-8011-4bfc-9ba9-f75761eadee2
Keep telemetry-only helpers scoped to their consuming test suite.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6b12d843-8011-4bfc-9ba9-f75761eadee2
@StellaHuang95
StellaHuang95 force-pushed the pep723-pr15-telemetry-v2 branch from 73dae62 to f2c5987 Compare August 18, 2026 21:47
@StellaHuang95

Copy link
Copy Markdown
Owner Author

Upstream review continues in microsoft#1723. Closing this fork-only review PR as superseded.

@@ -167,6 +185,7 @@ export class InlineScriptEnvManager implements EnvironmentManager, Disposable {
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue · Please address or respond

When a shared pending setup rejects, every caller awaiting it reaches this catch and emits install-failure. Report the error on the shared operation instead, and add a concurrent rejection test that asserts exactly one lifecycle event.

Comment thread src/api.ts
@@ -872,47 +883,63 @@ export interface GetPackagesOptions {
skipCache?: boolean;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Non-blocking recommendation

This public runHeadless API is part of substantial package-management, removal, CI, integration-test, version-parsing, and asset changes outside the PR's declared telemetry-only scope. Please split or rebase those changes so the telemetry work can be reviewed independently.

@StellaHuang95 StellaHuang95 added review-auto:changes-requested Automated review: posted blocking findings to address. and removed review-auto:approved Automated review: no blocking findings (approval posted). labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-auto:changes-requested Automated review: posted blocking findings to address.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants