Skip to content

Commit

Permalink
Improve catchup script (#236)
Browse files Browse the repository at this point in the history
* feat(catchup script): delete the current script to rewrite it with a clear stack

* feat(catchup script): create a script that switch to a new working branch and update the English branch we need to compare current Ember version and new Ember version

* feat(catchup script): output the list of files that changed between ref-upstream and upstream/master and parse it as an array of filenames

* feat(catchup script): make the name of the branch dynamic by passing arguments to the script

* feat(catchup script): create a directory to put patch files we want to create for each changed file

* feat(catchup script): prepare a list of warnings to log all manual actions required at the end of the process

* feat(catchup script): create the function that will output the diff files in the script/patches folder

* feat(catchup script): declare an array filesToPost that will be used to track the files to post in a GitHub issue

* feat(catchup script): create the function that loop on the changed files to create the diff files

* feat(catchup script): once a diff file is create, read its content. We need to do this because we want to do a replacement in the content

* feat(catchup script): for each file, remove the term release/ from the filename and from the content of the diff

* feat(catchup script): for each diff file, rewrite the content with the updated path, so the file can be patched in our architecture

* feat(catchup script): try to apply the patch. If the file is new or if git apply fails (file translated), then we add to filesToPost to open a GitHub issue later

* feat(catchup script): add a relevant return to the writeDiffFiles function so we know if there are patch files to commit and push

* feat(catchup script): prepare the header to post the GitHub issues. It requires to read the secret token.

* feat(catchup script): prepare the body of the GitHub issue for a given file and diff. There's no diff block if the file is new

* feat(catchup script): create the function that will post the GitHub issue for a given file

* feat(catchup script): create and call the function that will post all the GitHub issues

* feat(catchup script): if at least one file could be patched automatically, push the changes on GitHub

* feat(catchup script): open the catchup PR when the changes could be pushed

* feat(catchup script): prepare 3 functions to properly close the process. One reset ref-upstream then the other will switch back to master or the catchup branch depending on the situation

* feat(catchup script): properly close the process, update ref-upstream only if we no longer need the current state (all operations to create/edit diff files are ok), and switch back to the best branch

* feat(catchup script): print the warning messages also when the script ends with code 1
  • Loading branch information
BlueCutOfficial authored Jan 10, 2024
1 parent 20e0b01 commit f2d1cea
Show file tree
Hide file tree
Showing 2 changed files with 434 additions and 159 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"test:ember": "ember test",
"test:node": "mocha node-tests --exclude node-tests/local/**",
"test:node-local": "mocha node-tests/local",
"test:node-local-exclude-api-urls": "FOLLOW_API_URLS=false npm run test:node-local",
"catchup": "node scripts/catchup.mjs"
"test:node-local-exclude-api-urls": "FOLLOW_API_URLS=false npm run test:node-local"
},
"devDependencies": {
"@ember/optional-features": "^2.0.0",
Expand Down
Loading

0 comments on commit f2d1cea

Please sign in to comment.