Skip to content

Add release channel support for remote server downloads#12571

Draft
juliasilge wants to merge 3 commits intomainfrom
feat/match-remote-host-server-to-frontend
Draft

Add release channel support for remote server downloads#12571
juliasilge wants to merge 3 commits intomainfrom
feat/match-remote-host-server-to-frontend

Conversation

@juliasilge
Copy link
Contributor

Addresses #11382

When Positron connects to WSL, SSH, or dev container remote hosts, it downloads a server build from the CDN. Right now, we always download from the dailies/ CDN path, which only retains builds for 60 days. After 60 days, users on a particular monthly release can no longer connect to remote hosts.

This PR adds a quality field to product.json that we can then use to control the CDN path for remote server downloads:

  • dailies (default): For daily builds from main branch
  • releases: For monthly releases from release/* branches

The value is set at build time via the VSCODE_QUALITY environment variable (at least right now; see my comment below about how we can make this whatever we want). A follow-up PR in positron-builds will set this environment variable based on the source branch.

What happens after this PR is merged but before we make changes to our builds?

  • All builds (daily AND release) will have quality: "dailies" since our env var is not yet set in the build workflows
  • Remote server downloads will continue using the dailies/ CDN path
  • This is identical to current behavior; nothing breaks, but the 60-day issue is not yet fixed

What happens positron-builds changes?

  • Daily builds: quality: "dailies" → downloads from dailies/ (60-day retention)
  • Release builds: quality: "releases" → downloads from releases/ (permanent retention)
  • The 60-day issue will be fixed for monthly release users

Release Notes

New Features

  • N/A

Bug Fixes

QA Notes

@:remote-ssh

To verify the implementation locally:

  1. Build Positron without setting the env var:

    cat <build-path>/resources/app/product.json | grep '"quality"'
    # Expected: "quality": "dailies"
  2. Build with the env var set:

    VSCODE_QUALITY=potato <your-build-command>
    cat <build-path>/resources/app/product.json | grep '"quality"'
    # Expected: "quality": "potato"

Obviously, this will not be what we use, but it shows you how we are setting this up. 🥔

  1. Verify the URL template includes ${quality}:
    cat <build-path>/resources/app/product.json | grep 'serverDownloadUrlTemplate'
    # Expected: "https://cdn.posit.co/positron/${quality}/reh/..."

@github-actions
Copy link

github-actions bot commented Mar 18, 2026

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:remote-ssh

readme  valid tags

const productJsonStream = gulp.src(['product.json'], { base: '.' })
// --- Start Positron ---
.pipe(jsonEditor({ commit, date: readISODate('out-build'), version, positronVersion, positronBuildNumber }))
.pipe(jsonEditor({ commit, date: readISODate('out-build'), version, positronVersion, positronBuildNumber, quality: releaseChannel }))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the gulp files, we import releaseChannel and then put it into the product.json in the field quality. We want to use quality because it is what we can use for URL templating.

* Note: This is written to product.json as 'quality' to leverage existing
* VS Code URL substitution infrastructure (${quality} in URL templates).
*/
export const releaseChannel = process.env.VSCODE_QUALITY ?? 'dailies';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can use whatever env var we want here. For example, this could be:

Suggested change
export const releaseChannel = process.env.VSCODE_QUALITY ?? 'dailies';
export const releaseChannel = process.env.RELEASE_CHANNEL ?? 'dailies';

What env var do we want to set over in positron-builds?

"description": "The URL from where the Positron server will be downloaded. You can use the following variables and they will be replaced dynamically:\n- ${quality}: Positron server quality, e.g. stable or insiders\n- ${version}: Positron server version, e.g. 2024.10.0-123\n- ${commit}: Positron server release commit\n- ${arch}: Positron server arch, e.g. x64, armhf, arm64\n- ${arch-long}: Positron server arch in long format, e.g. x86_64, arm64",
"scope": "application",
"default": "https://cdn.posit.co/positron/dailies/reh/${arch-long}/positron-reh-${os}-${arch}-${version}.tar.gz"
"default": "https://cdn.posit.co/positron/${quality}/reh/${arch-long}/positron-reh-${os}-${arch}-${version}.tar.gz"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This quality placeholder is already plumbed through in all the right places for us to use in this way.

Comment on lines +205 to +206
// Default to dailies for backwards compatibility
return 'dailies';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not an upstream file, so I think it's fine for us to change this, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant