Commit Graph
13 Commits
Author SHA1 Message Date
4e6997ae07 build: support platform-specific built-in extensions from GitHub releases (#324206)
* Support platform-specific built-in extensions from GitHub releases

Adds support for downloading platform-specific built-in extension VSIXs
from GitHub releases, keyed by marketplace target platform. Also downloads
the latest pre-release assets for insiders builds, ignoring the pinned
version and checksum.

- extensionTarget.ts: resolve build target + release asset name
- builtInExtensions.ts: platformSpecific checksum map + insiders detection
- extensions.ts/fetch.ts: fromGithub asset selection + prerelease support
- CI: platform-aware cache key and target env plumbing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Insiders downloads the latest release instead of latest pre-release

Insiders builds should always be on the newest published release, so the
GitHub download now resolves the most recently published release (including
pre-releases) rather than filtering to pre-releases only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address code review feedback for platform-specific extensions

- Sort latest releases by published_at instead of created_at
- Log a warning when skipping checksum validation in latest mode
- Document that platform-specific extensions always download from GitHub
- Skip gracefully on unsupported platforms; keep a clear error for a
  known target missing from the platformSpecific map

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address CCR feedback: restrict targets and harden helpers

- Restrict getExtensionTarget to the supported marketplace targets, returning
  undefined for unsupported OS/arch (e.g. win32-ia32, linux-riscv64) so callers
  skip gracefully instead of failing with a missing-asset error
- Remove the bogus ia32 -> x86 mapping (no win32-x86 target exists)
- Validate the target format in getPlatformSpecificAssetName and throw a clear
  error for malformed targets
- Guard the latest-release sort against NaN timestamps (missing published_at
  sorts to the end deterministically)
- Update tests accordingly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Align asset naming with VS Code convention and support product.overrides.json

The platform-specific extension this feature targets (typescript-go's
TypeScriptTeam.native-preview) publishes VSIX assets named
<name>-<target>.vsix using the raw marketplace target platform, not the
node-vsce-sign osx/win/arm aliasing. Update getPlatformSpecificAssetName to
the standard <name>-<target>.vsix convention and validate against the
supported target set.

- fetch.ts: in latest mode, select the newest published release that actually
  contains the requested asset, so releases shipping only other artifacts
  (e.g. tarballs) without a matching VSIX are skipped
- builtInExtensions.ts: merge product.overrides.json (gitignored, local) so
  overridden built-in extensions are downloaded, mirroring bootstrap-meta
- Update tests for the new naming convention

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Detect extensions project by path segment, not substring

ESBuildTranspiler decided CJS vs ESM output via configFilePath.includes('extensions').
When the repo is checked out (e.g. as a git worktree) into a folder whose name
merely contains the substring 'extensions', the 'src' project was wrongly treated
as an extension and transpiled to CJS, breaking top-level await in src/cli.ts,
src/server-cli.ts and src/server-main.ts. Match an 'extensions' path segment instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove product.overrides.json support from built-in extensions download

Revert the download script to read product.json directly, per review feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-14 10:26:58 +00:00
Michael LivelyandGitHub cdb3b86073 Revert "fix(build): use Bearer auth for GitHub API requests in fetch.ts" (#312032)
Revert "fix(build): use Bearer auth for GitHub API requests in fetch.ts (#312…"

This reverts commit 17f555f7bd.
2026-04-22 23:32:08 +00:00
17f555f7bd fix(build): use Bearer auth for GitHub API requests in fetch.ts (#312022)
The Authorization header was constructed as 'Basic ' + base64(token), which
GitHub rejects because Basic auth requires base64(username:password). The
malformed header caused all GitHub API requests to fail with HTTP 403,
which the fetch wrapper masks with a misleading 'you may be rate limited'
message.

This was tolerable on GitHub-hosted runners because their IPs aren't
aggressively rate limited unauthenticated, but on the new 1ES Azure-hosted
runners (shared outbound IPs) the 60 req/hr unauthenticated limit is hit
immediately, breaking core-ci on every PR.

Switch to the Bearer scheme, which is the correct format for both
GITHUB_TOKEN and PATs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 22:44:36 +00:00
Dmitriy VasyuraandGitHub 725d99634b Increase timeout for body download in fetchUrl to accommodate large files (#291443) 2026-01-28 23:51:21 +00:00
RoboandGitHub fd10f9c207 chore: reduce any usage in build/ (#270109) 2025-10-06 22:56:36 +00:00
Matt Bierner 360c9fd134 Add lint rule for as any and bulk ignore all existing breaks
For #269213

This adds a new eslint rule for `as any` and `<any>({... })`. We'd like to remove almost all of these, however right now the first goal is to prevent them in new code. That's why with this first PR I simply add `eslint-disable` comments for all breaks

Trying to get this change in soon after branching off for release to hopefully minimize disruption during debt week work
2025-10-02 23:38:33 -07:00
Ladislau SzomoruandGitHub 4d7c56ee82 Engineering - Add GitHub action for pull requests (#254056)
* Test - handle running tests as part of a GitHub action

* Add GitHub action files
2025-07-04 08:21:56 +00:00
Aman KarmaniandGitHub e76c50f20e build: switch build/tsconfig.json to module: nodenext (#238426)
* build/tsconfig: switch to module: nodenext for bun compat

* build: rewrite imports for nodenext compat

* build: re-generate
2025-01-22 20:12:39 +01:00
84607a2fe2 Fix some always true/false errors in codebase (#223359)
* Fix some always true/false errors in codebase

Testing out latest TS nightly that can identify when an expression is always true/false. This caught a few likely coding mistakes in our codebase

Unsure about the intent in some of these cases but I've tried my best to understand them. Pinging relevant code owners for the confusing cases

* Bump TS version

* Fix unreachable in build scripts

* Bump versions

* restore intent

* Revert package.json change

* Fixing a few new layer checker errors

These are global in node now

* Skip lib check in integration project

* One more skiplibcheck

* More skip lib

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
2024-07-30 15:37:27 -07:00
Connor PeetandGitHub 64c8c3fe98 eng: hint if rate limit error is reached on preinstall (#200993)
* eng: hint if rate limit error is reached on preinstall

Fixes #194790

* compile
2023-12-15 18:49:51 +01:00
1ac14a7f70 fix: console format of fetchUrl (#198909)
* fix: console format of fetchUrl

* compile

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
2023-12-05 07:43:00 +00:00
João MorenoandGitHub 87e7f8b5e1 replace node-fetch with native fetch (#198408)
* replace node-fetch with native fetch

* fix dep version

* handle terminated error from fetch

* more error handling
2023-11-16 17:29:35 +01:00
Benjamin PaseroandGitHub 8afb685c9b eng - add checksum validation support to nodejs and extensions (#184877)
* eng - add `checksum` validation support to `remote`

* eng - wire in more `checksum` support

* eng - renames for remote fetching

* eng - renames for remote fetching

* eng - disable verbose

* eng - always fetch verbose in CI

* eng - 💄

* eng - add checksums for node

* eng - report checksum matches

* eng - fix build

* eng - warn when not being able to check sum

* eng - support checksums for built in extensions

* eng - clear todo

* eng - add nodejs metadata to product.json

* 🆙 version

* 🆙 distro

* update distro

* eng - switch to checksum file

* cleanup alpine

* fix alpine

* fix bug

* eng - fetch all from remote

* eng - 💄

* eng - print checksums

* eng - fix missing import

* 🆙 distro

* undo version change
2023-06-14 16:57:06 +02:00