-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove deprecated actions and Playwright API usage #13491
Remove deprecated actions and Playwright API usage #13491
Conversation
551b972
to
06767e7
Compare
uses: GabrielBB/xvfb-action@v1 | ||
with: | ||
run: yarn performance:startup:electron | ||
shell: bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xai Do you think omitting xvfb will be a problem for Electron? If yes, we'd need to switch to setup-xvfb as gabrielbb-xvfb-action is deprecated. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need xvfb because we cannot run Electron headless. So yes, we should switch to the maintained action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, no problem! I updated this PR. Can you please test if this works now? Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to test by running the workflow, right?
Edit: I am of course testing the code change ;)
75a29ae
to
a49b209
Compare
* Replace usage of deprecated GabrielBB/xvfb-action@v1 * Replace usage of deprecated <obj>.type(...)
46e513b
to
19b2abc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much, @planger, for spotting the unmaintained action we are consuming and for fixing our API calls!
Tested fine locally, i.e., the electron tests are still flaky, but no more flaky than before.
I agree that in the Electron case, we need to replace the unmaintained xvbf-action which had its last real commit in 2021-11.
The replacement used in this PR matches the recommendation in the discontinued xvbf-action and it seems to be actively maintained. It also seems to be used frequently (1/10 of the usage that the discontinued action has, which sounds reasonable to me). In the end, by executing the action, we end up executing this file: https://github.com/coactions/setup-xvfb/blob/main/dist/index.js
I very briefly scanned what it does and I have to mention that it includes odd-looking stuff such as this, which is explained with performance optimization. I did not spot any obvious red flags or outright harmful code, but keep in mind that this is a 4K lines javascript file and I looked at it for 3 minutes, which is not much, especially when considering that I am trying to limit my coffee input this week (read: I feel dumb and slow).
I assume that we need to establish a process for vetting third-party actions anyway at some point, and this workflow currently does not even seem to be executed by schedule or dispatch, so I will approve.
Edit: lol, my approval is, of course, not counting, because I am not a committer. If the actual reviewer finds the time, please also consider checking the 4K lines of javascript of the consumed action linked above.
Good catch @xai - indeed it's hard to know for sure that this code is not doing anything we would not want it to. I looked at their issue tracker and noticed this issue, that claims that |
with: | ||
run: yarn performance:startup:browser | ||
|
||
- name: Performance (Electron) | ||
uses: GabrielBB/xvfb-action@v1 | ||
uses: coactions/setup-xvfb@v1 | ||
with: | ||
run: yarn performance:startup:electron |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ATM this test suite does not seem to work - however it's the same on master, so it's not a problem caused by this PR.
I added trace "analyseTrace(): profilePath ..." - it seems that the trace files, that we attempt to parse using JSON.parse()
, are binary files not json...
$ yarn -s electron rebuild && cd scripts/performance && node electron-performance.js --name 'Electron Frontend Startup' --folder electron --runs 10
native node modules are already rebuilt for electron
analyseTrace(): profilePath: /home/user/theia/scripts/performance/profiles/electron/1.json
[Performance][Electron Frontend Startup][1] Largest Contentful Paint (LCP) failed to obtain a measurement: Unexpected token o in JSON at position 1
Failed to obtain a measurement. The most likely cause is that the performance trace file was incomplete because the script did not wait long enough for "Largest Contentful Paint (LCP)".
SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at analyzeTrace (/home/user/theia/scripts/performance/common-performance.js:151:26)
at measure (/home/user/theia/scripts/performance/common-performance.js:86:26)
analyseTrace(): profilePath: /home/user/theia/scripts/performance/profiles/electron/2.json
[Performance][Electron Frontend Startup][2] Largest Contentful Paint (LCP) failed to obtain a measurement: Unexpected token o in JSON at position 1
Failed to obtain a measurement. The most likely cause is that the performance trace file was incomplete because the script did not wait long enough for "Largest Contentful Paint (LCP)".
SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at analyzeTrace (/home/user/theia/scripts/performance/common-performance.js:151:26)
at measure (/home/user/theia/scripts/performance/common-performance.js:86:26)
[...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for looking into this!
I get the same error (in this PR and on master). I think this workflow file has not been used for a long time, also I don't see any runs of this workflow on GH. I just updated it to avoid leaving the deprecated action there.
Wow, nice! Thanks for checking this! This is really great news! If we have the xvfb-run binary in the image, we can save ourselves a lot of trouble. |
As it turns out (see coactions/setup-xvfb#21), it is available in our container anyway. Also pin the Python version to 3.11. Change-Id: Id8d2416996ea489675ca7e50da59286af1965777
Thank you @xai and @marcdumais-work for your thorough review. I've updated the |
Change-Id: I56905c171081f0e73688d58d670748285cab251c
I think that's fair. I was curious to confirm whether the image-built-in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks @planger !
Confirmed, I think: we get the same parsing error I noticed locally, that we briefly discussed : https://github.com/eclipse-theia/theia/actions/runs/8296738478/job/22706349277#step:7:20 |
What it does
GabrielBB/xvfb-action@v1
<obj>.type(...)
Contributed on behalf of STMicroelectronics.
How to test
Ensure workflows and Playwright tests still work as before.
Follow-ups
We should update https://github.com/eclipse-theia/theia-playwright-template and https://github.com/eclipse-theia/theia-e2e-test-suite accordingly to avoid using the deprecated GH action.
Review checklist
Reminder for reviewers