vscode-bitbake icon indicating copy to clipboard operation
vscode-bitbake copied to clipboard

Track re-enabling Pylance-dependent integration tests in CI

Open gcomneno opened this issue 2 months ago • 1 comments

Context

During the dependency update work in #517, the integration suites that depend on real Pylance diagnostics from generated embedded Python documents proved unreliable in GitHub Actions' fresh/headless VS Code profile.

The affected suites remain available for local runs, but are currently skipped when GITHUB_ACTIONS === 'true':

  • Bitbake Diagnostics Test Suite;
  • Bitbake CodeAction Test Suite.

This was accepted as a pragmatic temporary measure so the release pipeline would not remain blocked. The BitBake diagnostic-remapping path still has CI-safe synthetic coverage, but CI does not currently exercise the full integration with real Pylance diagnostics.

Enguerrand explicitly requested that this temporary skip be tracked so the real integration suites can be re-enabled when the CI-specific behavior can be investigated and stabilized.

Current behavior

  • the Pylance-dependent integration suites run locally;
  • the suites are skipped in GitHub Actions;
  • synthetic Pylance diagnostics verify the project-owned remapping behavior in CI;
  • the underlying fresh/headless-profile behavior has not been resolved.

Scope

  • preserve visibility of this temporary CI exception;
  • investigate the Pylance readiness/diagnostic behavior in the GitHub Actions VS Code profile when maintainership time permits;
  • re-enable the real Pylance-dependent suites in CI once they can run deterministically.

Non-goals

  • promising an immediate fix or delivery date;
  • removing the local integration coverage;
  • removing the CI-safe synthetic remapping test;
  • weakening CI merely to make the suites appear green.

Completion condition

This issue can be closed when the real Pylance-dependent diagnostics and code-action suites run reliably in GitHub Actions without the current conditional skip, while retaining appropriate coverage for the BitBake diagnostic-remapping behavior.

Related: #514, #516, #517

gcomneno avatar Sep 10 '26 09:09 gcomneno

I isolated the CI failure further and found a deterministic boundary.

The generated Python files currently live under the extension's workspaceStorage, and their Pylance participation relies implicitly on document open/save lifecycle. That is what makes the real diagnostics/code-action tests timing-dependent.

I verified that Pylance can instead analyze those generated files while they remain outside the user's workspace by using a bounded analysis domain:

  • python.analysis.diagnosticMode = "workspace"
  • python.analysis.include restricted to the generated embedded-Python directory

With Pylance explicitly ready, an unopened generated file inside that external include received diagnostics, while an unopened Python decoy outside it did not. This avoids both editor-visibility synchronization and the full-Yocto-workspace analysis caused by unrestricted workspace mode.

Based on that, my preferred implementation direction would be:

  • keep generated embedded files under workspaceStorage;
  • make EmbeddedLanguageDocsManager responsible only for storage and identity;
  • remove the defensive open/reopen/save lifecycle workaround;
  • introduce a small analysis-lifecycle owner for the bounded generated-Python domain;
  • reject diagnostics belonging to superseded generated content;
  • keep the existing project-owned diagnostics mapping;
  • then re-enable the real Pylance diagnostics/code-action CI tests.

For the Python settings, I would lean toward having the extension manage the bounded analysis domain automatically, with strict ownership rules:

  • preserve existing user python.analysis.include entries;
  • append only the extension-managed generated directory;
  • never broaden analysis to the full Yocto workspace;
  • respect bitbake.disableConfigModification;
  • restore only values still owned by the extension, without overwriting user changes made while it is active.

This seems preferable to requiring users to manually configure Pylance for an implementation detail of the embedded-language feature.

Before changing production code, does that configuration-ownership policy look acceptable to you, or would you prefer the Python analysis configuration to remain explicitly user-owned?

gcomneno avatar Sep 14 '26 18:09 gcomneno