googlecloudrobotics / core

Cloud Robotics Core: Kubernetes, Federation, App Management
Apache License 2.0
193 stars 61 forks source link

Only consider scheduled postsubmit runs #386

Closed drigz closed 4 months ago

drigz commented 4 months ago

Without this parameter, the API will also return commits from PRs, which may not have been reviewed and could be malicious.

This has the downside that if you're trying to fix the release workflow you need to change the schedules or be limited to one attempted fix per day, but the alternatives (see below) are also not ideal.

For defense in depth, we also check against the head_repository id, which I tested by temporarily changing event=schedule to actor=totoro642, in which case the action fails with:

Unexpected head repository ID: 817231418 - check postsubmit.yml configuration

Alternatives considered:

http://b/348316770

drigz commented 4 months ago

@mering PTAL - I also updated the description. I decided against git branch --contains because it seemed to duplicate the existing checks - and might be annoying if we start maintaining release branches.

EDIT: Markus told me that there's a "PTAL" button in GitHub! 🎉

mering commented 4 months ago

@mering PTAL - I also updated the description. I decided against git branch --contains because it seemed to duplicate the existing checks - and might be annoying if we start maintaining release branches.

I agree that the branch=main query filter together with head_repository.id check would be at least equivalent to the git branch --contains (probably even superior).