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

Does replace-existing-chrome option still need to exist? #57

Open
matthewhively opened this issue Sep 19, 2022 · 3 comments
Open

Does replace-existing-chrome option still need to exist? #57

matthewhively opened this issue Sep 19, 2022 · 3 comments
Labels
backlog Identified as a backlog item, often combined with low-priority and help-wanted labels enhancement New feature or request

Comments

@matthewhively
Copy link

Orb version

v 1.4.0

What happened

Chrome always reinstalls itself even when it is already running the latest version when the replace-existing-chrome extra option flag is set.

Expected behavior

Chrome should behave similarly to Firefox, and would skip installation when version == latest


With firefox there is a place to query the latest version.
https://product-details.mozilla.org/1.0/firefox_versions.json
It looks like historically there was no convenient place to find the latest chrome version.

However I did some quick looking, and found this:
https://stackoverflow.com/a/35144482/6716352
and a bit further down
https://stackoverflow.com/a/68626554/6716352
Supposedly this omahaproxy is what is used internally by the Chrome dev team.
https://omahaproxy.appspot.com/linux <<< this link has exactly the latest stable version number
Also available appears to be this: https://omahaproxy.appspot.com/all.json which could be parsed.

This seems legit as it is listed in the FAQ here:
https://www.chromium.org/administrators/frequently-asked-questions/

So maybe its time to update the scripting for chrome to properly handle version updates?

@BytesGuy BytesGuy added enhancement New feature or request backlog Identified as a backlog item, often combined with low-priority and help-wanted labels labels May 24, 2023
@matthewhively
Copy link
Author

For reference I have this hacky step added before the orb attempts to install chrome

            latest_stable=$(curl -s 'https://omahaproxy.appspot.com/linux')
            touch chrome_version # just in case the file doesn't exist from previous run
            installed_ver=$(cat chrome_version)
            echo "test: ${latest_stable} (latest) == ${installed_ver} (installed)"
            if [ "$latest_stable" != "$installed_ver" ]; then
              sudo rm -f /usr/bin/google-chrome  # symlink
              sudo rm -f /etc/alternatives/google-chrome # symlink
              sudo rm -f /usr/bin/google-chrome-stable # symlink
              sudo rm -rf /opt/google/chrome # folder
              sudo rm -rf /usr/local/bin/chromedriver # folder

              echo "Old Chrome browser & driver removed"

@matthewhively
Copy link
Author

The https://omahaproxy.appspot.com website is gone now. It now says to use this: https://chromiumdash.appspot.com/releases
I'm not yet sure how to parse it.

@matthewhively
Copy link
Author

Apparently this command will work.
latest_stable=$(curl -s 'https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Linux' | jq -r ' .[0] | .version ')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Identified as a backlog item, often combined with low-priority and help-wanted labels enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants