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

[EngSys] upgrade dev dependency puppeteer to ^22.0.0 #28200

Merged
merged 17 commits into from
Feb 6, 2024

Conversation

jeremymeng
Copy link
Member

@jeremymeng jeremymeng commented Jan 9, 2024

by running rush add -m --dev -p puppeteer@^22.0.0

  • adjust core-xml test due puppeteer switched from Chromium to Chrome
  • ignore Accept-Language headers for browser playback tests

Resolves #25790

@github-actions github-actions bot added Azure.Core Azure.Identity EngSys This issue is impacting the engineering system. Event Hubs KeyVault OpenAI Service Bus Storage Storage Service (Queues, Blobs, Files) WebPubSub labels Jan 9, 2024
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@jeremymeng jeremymeng force-pushed the engsys/puppeteer-v21 branch from db722d1 to 3ab2efe Compare January 10, 2024 03:04
@jeremymeng jeremymeng marked this pull request as ready for review February 3, 2024 00:11
@@ -216,6 +217,12 @@ export class Recorder {
* - sanitizerOptions - Generated recordings are updated by the "proxy-tool" based on the sanitizer options provided, these santizers are applied only in "record" mode.
*/
async start(options: RecorderStartOptions): Promise<void> {
if (isBrowser && isPlaybackMode()) {
Copy link
Member

Choose a reason for hiding this comment

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

Were changes in the recorder related to the upgrade or something found in passing?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see #28455 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes there's some behavior changes in headers being sent (Accept-Language). I updated sanitizers in recorder and keyvault. However some keyvault tests still failed.

Copy link
Member

Choose a reason for hiding this comment

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

I need to re-record keyvault tests with the new service version some time in the next few days (it's not fully deployed yet). Hopefully just rerecording will fix the problem but if not I will investigate further at that time :)

Copy link
Member

Choose a reason for hiding this comment

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

Also, I am curious what the change to Accept-Language was. I remember this being a bugbear for me when playing back tests in the past since the locale on my machine was en-CA instead of en-US which is what was present in the recordings.

Copy link
Member Author

@jeremymeng jeremymeng Feb 5, 2024

Choose a reason for hiding this comment

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

IIRC ideally the header should be ignored by test-proxy. Not sure what was the exact issue that prevented it from happening.

Copy link
Member

Choose a reason for hiding this comment

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

We wanted to do this here Azure/azure-sdk-tools#6152 but didn't in the end, presumably due to engsys objection. @HarshaNalluru do you recall why?

Copy link
Member

Choose a reason for hiding this comment

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

Their resistance was that it might have unintended consequences and is disruptive keeping other languages as well in mind.

From JS perspective, it should be safe, and we need to move forward with this change, so doing it in JS recorder makes sense.

Copy link
Member

@maorleger maorleger left a comment

Choose a reason for hiding this comment

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

Changes largely look good to me! We chatted about going to 22 but happy to review a separate PR for it (or get it into this one)

@jeremymeng jeremymeng changed the title [EngSys] upgrade dev dependency puppeteer to ^21.0.0 [EngSys] upgrade dev dependency puppeteer to ^22.0.0 Feb 5, 2024
Copy link
Member

@timovv timovv left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -216,6 +217,12 @@ export class Recorder {
* - sanitizerOptions - Generated recordings are updated by the "proxy-tool" based on the sanitizer options provided, these santizers are applied only in "record" mode.
*/
async start(options: RecorderStartOptions): Promise<void> {
if (isBrowser && isPlaybackMode()) {
Copy link
Member

Choose a reason for hiding this comment

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

Also, I am curious what the change to Accept-Language was. I remember this being a bugbear for me when playing back tests in the past since the locale on my machine was en-CA instead of en-US which is what was present in the recordings.

@@ -216,6 +217,12 @@ export class Recorder {
* - sanitizerOptions - Generated recordings are updated by the "proxy-tool" based on the sanitizer options provided, these santizers are applied only in "record" mode.
*/
async start(options: RecorderStartOptions): Promise<void> {
if (isBrowser && isPlaybackMode()) {
Copy link
Member

@HarshaNalluru HarshaNalluru Feb 5, 2024

Choose a reason for hiding this comment

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

Move this to a new method "preStart()" or similar, and call that here to keep the code clean?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

if (isPlaybackMode()) {
if (!this.httpClient) {
throw new RecorderError("httpClient should be defined in playback mode");
}

await setMatcher(Recorder.url, this.httpClient, matcher, this.recordingId, options);
const excludedHeaders = isBrowser
? (options.excludedHeaders ?? []).concat("Accept-Language")
Copy link
Member

@HarshaNalluru HarshaNalluru Feb 5, 2024

Choose a reason for hiding this comment

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

Can you add a comment explaining why? for future reference

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

@HarshaNalluru HarshaNalluru left a comment

Choose a reason for hiding this comment

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

💚

@jeremymeng jeremymeng merged commit 18d6d50 into Azure:main Feb 6, 2024
113 checks passed
@jeremymeng jeremymeng deleted the engsys/puppeteer-v21 branch February 6, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core Azure.Identity EngSys This issue is impacting the engineering system. Event Hubs KeyVault OpenAI Service Bus Storage Storage Service (Queues, Blobs, Files) WebPubSub
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Dependency package puppeteer has a new version available
5 participants