[DO NOT MERGE YET] New Sigscanner API and full PR check#26
[DO NOT MERGE YET] New Sigscanner API and full PR check#26
Conversation
There was a problem hiding this comment.
Some PRs get very large and a single push makes this workflow revalidate all previous commits. This seems like a bad idea.
If anything, most this logic should be offloaded to plaid. At least it would be able to maintain some state for already validated commits. Perhaps plaid could maintain/update status checks on a PR as its validating them. So, using webhook events as triggers for plaid-based stateful control-flow rather than orchestrating through stateless GHA workflows executions?
Also curious how that API responds when there’s merge commits present in the list of commits. For example, merging in default branch. But what about merging in another branch with unsigned commits, with a signed merge commit.
Edit: I’m guessing it will return all commits, and now you could easily get to the 512 limit if a 2 month old branch is brought back up to date through a massive merge.
Edit 2: An endpoint that accepts more than one commit in the payload?
Plaid does cache if a commit is verified. The design to keep a state per PR in Plaid was decided against to minimize change in Sigscanner. I think having Sigscanner be aware of PRs is reasonable. But functionally, there's no difference. It's between having the complexity (1 PR fetch and a loop) in the action vs in Sigscanner.
Merge commits are signed by Github PGP key so they will be accepted. I don't fully understand what you mean by "But what about merging in another branch with unsigned commits, with a signed merge commit."
This is my main concern regarding the max commit count. I am open to remove this limit if it's infeasible. The main risk here would be DoS of Sigscanner, which has an extremely high throughput. If Github allows that many commits in a PR, Sigscanner should be able to handle it.
Is the concern here about the load on Plaid/Sigscanner? |
Well I take it back. The number of round-trip network calls would be reduced from |
|
Okay I get what you mean about the merge commit now. Let me test it out. Ideally it should return all commits. It does return all commits: https://github.com/smartcontractkit/sigscanner-test/actions/runs/23569301621/job/68628116370?pr=2 |
Summary
This PR does two things:
A few notes
concurrency.cancel-in-progress=trueto kill redundant runs when new commits are pushed. If commits are force-pushed off, then users need to manually rerun cancelled runs.Total number of commits: ≤ 512. This will block large PRs like big merges.Tried my best to make the bash scripts short. Is it worth parting them out as standalone
.shscripts? I think currently, the complexity is still acceptable.Having Sigscanner handle multiple commits per call
From the discussion with @erikburt below, it is much more efficient to have Sigscanner handle multiple commits in 1 call. Personally I think it'd be elegant to be able to query Sigscanner by PR to reduce the complexity and the number of network calls in the GHA Workflow.
If possible, I'm inclined to have this iteration accepted and keep this check non-blocking for data collection still. I agree that an enforced version of this workflow should just make 1 call to Sigscanner to scan the PR.
Tests