Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support local aliases when launching a browser #11947

Merged
merged 1 commit into from Feb 20, 2024

Conversation

OrKoN
Copy link
Collaborator

@OrKoN OrKoN commented Feb 19, 2024

With this PR, @puppeteer/browsers starts maintaining a local mapping from an alias to the locally installed browser version. This allows using aliases such as canary/dev when launching the browser. Note that latest for launch will resolve to the latest version found in the local metadata file.

Note that the launch command would only consult metadata files and won't attempt to re-check aliases by contacting the server.

npx @puppeteer/browsers install chrome@canary
# Launching a Canary version would work if a Canary build has been installed previously.
npx @puppeteer/browsers launch chrome@canary 

Closes #11140
Closes #11781

@OrKoN OrKoN force-pushed the orkon/support-launch-aliases branch 3 times, most recently from 15c77f8 to 16f0301 Compare February 19, 2024 12:30
@OrKoN OrKoN marked this pull request as ready for review February 19, 2024 12:30
@OrKoN OrKoN requested review from jrandolf and removed request for jrandolf February 19, 2024 12:36
@OrKoN OrKoN marked this pull request as draft February 19, 2024 12:37
@OrKoN

This comment was marked as resolved.

@OrKoN OrKoN self-assigned this Feb 19, 2024
@OrKoN OrKoN force-pushed the orkon/support-launch-aliases branch 3 times, most recently from 07e7404 to a29dd2c Compare February 19, 2024 18:13
@OrKoN OrKoN changed the title feat: support launch aliases feat: support local aliases when launching a browser Feb 19, 2024
@OrKoN OrKoN added the full-ci label Feb 19, 2024
@OrKoN OrKoN marked this pull request as ready for review February 20, 2024 06:51
@OrKoN OrKoN force-pushed the orkon/support-launch-aliases branch 2 times, most recently from 8886960 to 6471e52 Compare February 20, 2024 12:47
@OrKoN OrKoN force-pushed the orkon/support-launch-aliases branch 2 times, most recently from 674894c to 9582dba Compare February 20, 2024 15:11
if (options.buildIdAlias) {
const metadata = installedBrowser.readMetadata();
metadata.aliases[options.buildIdAlias] = options.buildId;
metadata.aliases['latest'] = options.buildId;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
metadata.aliases['latest'] = options.buildId;

Copy link
Collaborator

@Lightning00Blade Lightning00Blade left a comment

Choose a reason for hiding this comment

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

LGTM, after suggestion is applied.

With this PR, @puppeteer/browsers starts maintaining a local
mapping from an alias to the locally installed version.
This allows using aliases such as `canary`/`latest` when launching
the browser.

Note that the launch command would only consult metadata files
and won't attempt to re-check aliases by contacting the server.
@OrKoN OrKoN force-pushed the orkon/support-launch-aliases branch from 9582dba to 2d0e0d6 Compare February 20, 2024 15:15
@OrKoN OrKoN merged commit 561e4cd into main Feb 20, 2024
64 checks passed
@OrKoN OrKoN deleted the orkon/support-launch-aliases branch February 20, 2024 18:09
@release-please release-please bot mentioned this pull request Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants