-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ci: added a job for react-compiler
checks 🧬
#45998
Merged
Merged
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
466fa84
ci: added a job for react-compiler checks
kirillzyusko 2220f95
fix: convert json output to single-line output
kirillzyusko a49676f
fix: redirect spinner output to stderr and ignore it
kirillzyusko 629722b
fix: let's debug step by step and see what is wrong
kirillzyusko cf5c218
fix: single output from the core
kirillzyusko 05c2411
fix: patch not found error
kirillzyusko 6f9a675
fix: simplify branching switching
kirillzyusko b9cf9d9
fix: don't apply patch
kirillzyusko 6b5ac7b
fix: backport changes to old code
kirillzyusko f29821f
fix: don't reinstall deps (temporarily), CI should be green now
kirillzyusko 116a7d3
refactor: re-organize patches after rebase
kirillzyusko 907b628
fix: setup node after branch switch
kirillzyusko d4b8483
fix: scan files in target first, and then switch to current branch
kirillzyusko fd1332d
fix: don't cast JSON to number :)
kirillzyusko 849e306
feat: implement actual check
kirillzyusko b7feb93
check: add intentionally uncompilable code to see whether action work…
kirillzyusko df0850a
Revert "check: add intentionally uncompilable code to see whether act…
kirillzyusko f1201ad
fix: eslint, script logic
kirillzyusko 884f90e
fix: recompile script
kirillzyusko dd1ee50
Revert "Revert "check: add intentionally uncompilable code to see whe…
kirillzyusko 8eae14c
Revert "Revert "Revert "check: add intentionally uncompilable code to…
kirillzyusko 26da3b5
feat: added documentation
kirillzyusko 0991129
fix: modify text content
kirillzyusko 0b78359
docs: change problems -> problem
kirillzyusko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'Check React compiler' | ||
description: 'Compares two lists of compiled files and fails a job if previously successfully compiled files are no longer compiled successfully' | ||
inputs: | ||
OLD_LIST: | ||
description: List of compiled files from the previous commit | ||
required: true | ||
NEW_LIST: | ||
description: List of compiled files from the current commit | ||
required: true | ||
runs: | ||
using: 'node20' | ||
main: 'index.js' |
35 changes: 35 additions & 0 deletions
35
.github/actions/javascript/checkReactCompiler/checkReactCompiler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import * as core from '@actions/core'; | ||
|
||
type ReactCompilerOutput = { | ||
success: string[]; | ||
failure: string[]; | ||
}; | ||
|
||
const run = function (): Promise<void> { | ||
const oldList = JSON.parse(core.getInput('OLD_LIST', {required: true})) as ReactCompilerOutput; | ||
const newList = JSON.parse(core.getInput('NEW_LIST', {required: true})) as ReactCompilerOutput; | ||
|
||
const errors: string[] = []; | ||
|
||
oldList.success.forEach((file) => { | ||
if (newList.success.includes(file) || !newList.failure.includes(file)) { | ||
return; | ||
} | ||
|
||
errors.push(file); | ||
}); | ||
|
||
if (errors.length > 0) { | ||
errors.forEach((error) => console.error(error)); | ||
throw new Error('Some files could be compiled with react-compiler before successfully, but now they can not be compiled.'); | ||
} | ||
|
||
return Promise.resolve(); | ||
}; | ||
|
||
if (require.main === module) { | ||
run(); | ||
} | ||
|
||
export default run; |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Can we also include some information about what to do next? I think it would be good to create some md file in the guidelines explaining the various failures or reasons why the compilation does not succeed and how to avoid them/ resolve them.
The way how its done now I am sure would cause lots of confusion and questions in Slack so better to try to mitigate it with some guidelines even if people would come and ask.
The guideline should also say how they can test this locally
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.
@mountiny done 🙌 Would you mind to review these changes again? 👀