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

fix(chromedriver): use chromedriver patch version as semver pre-release version #498

Closed
wants to merge 3 commits into from

Conversation

andrevechina
Copy link

@andrevechina andrevechina commented Jun 16, 2021

Issue:
While trying to download Chromedriver version 91.0.4472.101, version 91.0.4472.19 is being downloaded instead, because:

  • Chromedriver patch version is not being considerer
  • Chromedriver version 91.0.4472.101 is listed before version 91.0.4472.19

image

Proposed solution:
Update getValidSemver so it generates semver versions that include all 4 Chromedriver version numbers:
<MAJOR>.<MINOR>.<BUILD>.<PATCH>

Chromedriver semver versions will always use the pre-release format:
<MAJOR>.<MINOR>.<BUILD>-patch.<PATCH>

Version precedence will include all 4 number as per:
Semantic Versioning 2.0.0 definition, section 11, sub-section 4
https://semver.org/#spec-item-11

Fixes:
#413
#496
#497

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Jun 16, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@andrevechina
Copy link
Author

@googlebot I signed it!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Jun 16, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@tbruna
Copy link

tbruna commented Jun 16, 2021

@googlebot I fixed it.

@google-cla
Copy link

google-cla bot commented Jun 16, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@tbruna
Copy link

tbruna commented Jun 16, 2021

@googlebot I consent.

@google-cla
Copy link

google-cla bot commented Jun 16, 2021

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: yes and removed cla: no labels Jun 16, 2021
@@ -33,7 +33,7 @@ describe('status', () => {
.catch(err => {
done.fail();
});
});
}, 30000);
Copy link
Author

Choose a reason for hiding this comment

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

Running update twice sometimes was taking more than Jasmine's default timeout (5s).
Updating this timeout to 30s made this test suite a lot more stable.

@@ -95,7 +95,7 @@ function status(options: Options) {
if (semver.gt(a, b)) {
return 1;
} else {
return 0;
return -1;
Copy link
Author

@andrevechina andrevechina Jun 16, 2021

Choose a reason for hiding this comment

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

Small fix on displaying versions sorted.

@StanislavKharchenko
Copy link

Hope someone can approve and merge this.
@cnishina as webdriver-manager maintainer?

@kallebjork
Copy link

kallebjork commented Jul 6, 2021

For what it is worth. I applied this patch in one of our projects and it works great.

BEFORE THIS PATCH

node_modules/protractor/node_modules/webdriver-manager/bin/webdriver-manager update --versions.chrome=91.0.4472.101
-->
I/downloader - curl -o/Users/user/ws/app-x-workspace/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_91.0.4472.101.zip https://chromedriver.storage.googleapis.com/91.0.4472.19/chromedriver_mac64.zip

AFTER THIS PATCH

node_modules/protractor/node_modules/webdriver-manager/bin/webdriver-manager update --versions.chrome=91.0.4472.101
-->
I/downloader - curl -o/Users/user/ws/app-x-workspace/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_91.0.4472.101.zip https://chromedriver.storage.googleapis.com/91.0.4472.101/chromedriver_mac64.zip

@StanislavKharchenko
Copy link

@angular @kyliau @Splaktar could someone from Angular team approve and merge this PR?
I forgot that Craig @cnishina no longer maintain this package.
Will be better to merge also with both webdriver-manager 12.x and 13.x

@krissteinort
Copy link

krissteinort commented Jul 16, 2021

Just want to bump this one since it's been open for a month, any chance someone from the Angular team can merge this please? 🙏 @angular @kyliau @Splaktar?

@kvbutler
Copy link

Yup bump, someone please merge this PR.

@kvbutler
Copy link

kvbutler commented Jul 19, 2021

Actually there is an issue with this, see my PR, https://github.com/andrevechina/webdriver-manager/pull/1.

For those who want a quick fix I published a new npm package.

Ugly workaround below.

package.json postinstall script:

"postinstall": "cd ./node_modules/protractor && npm i webdriver-manager@npm:webdriver-manager-hf-patchversion"

Also for context I have another script in package.json:

"update-webdriver": "webdriver-manager update --versions.chrome"

And I run it as such:

npm run update-webdriver -- 91.0.4472.124

You should see the correct version of the chromedriver after this.

image

@kvbutler
Copy link

Does anyone maintain this codebase anymore @angular @kyliau @Splaktar @cnishina?

@dgp1130
Copy link
Collaborator

dgp1130 commented Sep 23, 2021

Heya, apologies about the delayed response here. The Angular team has been preoccupied with other challenges lately and haven't been able to give Protractor and webdriver-manager the attention they deserve.

The PR here seems like a solid fix to a pretty clear bug and I don't have any concerns with merging it. Unfortunately, the repository is in a bit of an awkward state right now, as some CI actions aren't running and 7.x.x isn't even on the master branch right now. I'm hoping to spend some time fixing this up and getting the repository back into a releaseable state, and once that happens we should be able to merge this and get a release out.

@andrevechina andrevechina closed this by deleting the head repository Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants