Skip to content
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

Automatically run tasks in CI if task is in a non-terminal state #337

Open
mds1 opened this issue Oct 2, 2024 · 0 comments
Open

Automatically run tasks in CI if task is in a non-terminal state #337

mds1 opened this issue Oct 2, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@mds1
Copy link
Contributor

mds1 commented Oct 2, 2024

In script/utils/check-task-statuses.sh we define the following allowed task status:

VALID_STATUSES=("DRAFT, NOT READY TO SIGN" "CONTINGENCY TASK, SIGN AS NEEDED" "READY TO SIGN" "SIGNED" "EXECUTED" "CANCELLED")

Of these, the SIGNED (for presigned pauses only), EXECUTED. and CANCELLED statuses are terminal, meaning once a task's status is changed to this value it should never change again.

When we add new tasks, the task author must manually remember to add them to CI (see just_simulate_sc_rehearsal_1 as an example), but this is easy to forget. Instead, we should have CI do the following:

  • Loop over all tasks in all tasks/* directories.
  • Extract all tasks that have a status that is not a terminal status
  • Determine if they are single safe or nested safe tasks (this can be done based on the name of the Solidity file—if it's NestedSignFromJson it's a nested safe task, otherwise it's a standard single safe)
  • Simulate the task in CI (simulation commands differ for nested vs. standard). For nested safes, we should also simulate the approve calls, which provides an additional mitigation for Wrong state diff checks during nested approval calls #268
  • The CI job should fail if any approval or simuation fails

The reason we filter tasks by "tasks in a non-terminal status" instead of "statues that precede execution" is to be more robust: If a new task status is added, by default CI will try executing tasks with those status, and we can add that task status to the terminal status list if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Development

No branches or pull requests

1 participant