positron icon indicating copy to clipboard operation
positron copied to clipboard

Assistant: fail build if postinstall step fails

Open sharon-wang opened this issue 4 months ago • 1 comments

Sequence of events

  1. Bumped copilot language server binary version https://github.com/posit-dev/positron/pull/9347
  2. Only tested dev builds and ran a release build which succeeded (but did not run the release build). The dev builds likely still had an old language server binary hanging around. The testing did not involve checking the version, just checking if completions behaviour still worked as expected.
  3. Copilot completions issue reported with release build https://github.com/posit-dev/positron/issues/9384
  4. Fixed the issue https://github.com/posit-dev/positron/pull/9396 (location of binaries changed; needed additional arch-specific handling for mac)
  5. Also needed to bump disk image size for mac https://github.com/posit-dev/positron-builds/pull/541

Steps going forward

When we bump the copilot language server binary, we should test by:

  • creating release builds at least for Mac and Windows, and testing the behaviour in the release builds (example testing steps)
  • failing the build if the postinstall step fails -- this would have notified us that the binary was missing in #9347, but the build succeeded and it was not apparent that the postinstall step had actually errored

Relevant logs

In the Mac builds > Install dependencies step, it actually notes the underlying problem:

> [email protected] postinstall
> ts-node scripts/post-install.ts


> [email protected] install-copilot-language-server
> ts-node scripts/install-copilot-language-server.ts

Updating Copilot Language Server: undefined -> 1.367.0
An error occurred: Error: ENOENT: no such file or directory, copyfile 'node_modules/@github/copilot-language-server/native/darwin-arm64/copilot-language-server' -> 'resources/copilot/arm64/copilot-language-server'
    at async copyFile (node:internal/fs/promises:621:10)
    at async main (/Users/ec2-user/actions-runner/_work/positron-builds/positron-builds/positron/extensions/positron-assistant/scripts/install-copilot-language-server.ts:68:3) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'copyfile',
  path: 'node_modules/@github/copilot-language-server/native/darwin-arm64/copilot-language-server',
  dest: 'resources/copilot/arm64/copilot-language-server'
}

However, this error didn't cause the build to fail, so it was not surfaced at the time.

The Ask

Fail the build if the Assistant postinstall step fails, so this sort of error can be caught at build time in the future.

Question: would we want to fail if any postinstall step fails, not just the Assistant extension?

sharon-wang avatar Sep 11 '25 17:09 sharon-wang

Thoughts on updates

  • do we want to update the language server more regularly, how often?
  • how can we test whether the language server is working well

sharon-wang avatar Oct 14 '25 17:10 sharon-wang