JuDFTteam / best-of-atomistic-machine-learning

🏆 A ranked list of awesome atomistic machine learning projects ⚛️🧬💎.
Creative Commons Attribution Share Alike 4.0 International
370 stars 35 forks source link

Fix Actions error create-update-branch #303

Closed Irratzo closed 3 months ago

Irratzo commented 3 months ago

Configuration Change:

Beginning 2024-06-13, the update-best-of-list workflow has failed repeatedly (example failed runs, if not deleted: 1, 2).

The error occurs in the step create-update-branch. The error message is this.

Run peterjgrainger/action-create-branch@v2.0.1
  with:
    branch: update/2024.06.13-08.19
  env:
    BRANCH_PREFIX: update/
    DEFAULT_BRANCH: main
    VERSION: 2024.06.13-08.19
    GITHUB_TOKEN: ***
Error: HttpError: Branch not found

The workflow also shows two warnings, up to this step.

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, peterjgrainger/action-create-branch@v2.0.1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, peterjgrainger/action-create-branch@v2.0.1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

This is a critical error. The list README cannot be generated anymore. Manual branch creation and then run the workflow is not fail-safe.

So, need to fix the error.

Irratzo commented 3 months ago

Solution attempt 1.

Try fixing the error by fixing the mentioned workflow warning 1.

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, peterjgrainger/action-create-branch@v2.0.1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

First, locate the Actions code in this repo that uses actions/checkout@v2 and peterjgrainger/action-create-branch@v2.0.1.

The Actions code is in update-best-of-list.yml. URL, permalink. For actions/checkout@v2, L27, L39, for peterjgrainger/action-create-branch@v2.0.1 (the one that creates the fail error), L34.

Let's compare to the best-of lists root repo, best-of. There, the same action versions are still used in the update-best-of-list-yml (permalink). Indeed, that file there hasn't been changed since 3 years, and a recent update run there (example) prints the same warning. But the error that I observe here does not occur, which is strange. In the corresponding best-of-generator template repo, I was not able to find the corresponding code location.

Anyway, let's first attempt to fix this in my repo here. If it works, I can create a PR in the best-of repo. Since it seems to be stale (see stale issues), unlikely that the devs will pick it up, but it would be the correct thing to do. I wonder how the proper way to do it, ie, get the PR merged there, then get the fix there into my repo by updating upstream or something like that. But, let's ignore that idea.

Okay, let's find the repos of the corresponding action, to find the correct new versions.

So, let's try that. Just replace the action versions in this repo's file update-best-of-list.yml with those versions.

Irratzo commented 3 months ago

Okay it failed with error "Unable to resolve action peterjgrainger/action-create-branch@v3, unable to find version v3". Indeed, the full version identifier is "v3.0.0". So, let's try that instead.

Irratzo commented 3 months ago

Nice, it worked.

I have asked the best-of maintainers to fix this issue upstream, as well. Let's hope they still are active.

Issue closed.