Fix GHA Firefox & Edge browsers #289
Open
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Purpose
The Problem
Browsers normally have a user agent field that looks like this:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
Originally, I was trying to append a "Selenium Bot" tag to the existing user agent field in order to preserve this information.
This worked great locally, but re-launching browsers is not compatible with github actions workflows.
The Fix
Scrap the extra steps and just override the user agent tag to say
OSF Selenium Bot
. This is good enough for our devops folks to monitor our daily automated traffic.Summary of Changes
OSF Selenium Bot
custom tagReviewer's Actions
git fetch origin pull/289/head:gha/fix_browsers
Run this test locally with Firefox or Edge browser
tests/test_search.py -sv
Or Run a GHA workflow via browser.
Testing Changes Moving Forward
We still need to update for MSEdge when we update to SELv4
Ticket
https://openscience.atlassian.net/browse/ENG-8286