-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
lets add a feature to ensure that all github actions on a branch passed, before pulling and updating docker
game plan, creating cicd actions
- crate a separate branch locally, add yml file in a .github folder
- follow this guide to create a file: https://docs.github.com/en/actions/get-started/quickstart#creating-your-first-workflow
- it can be a simple yml file, like this https://gist.github.com/weibeld/f136048d0a82aacc063f42e684e3c494
- run cicd system, and add a log below to print
payload, when the action finishes, do we see some json appear? what does it look like?
Line 181 in bcaad15
payload = json.loads(payload_body) - paste the json from the above step into this issue
game plan 2, making multiple actions
- lets merge the first pr, then make a new pr to add another step to the actions file above, with a separate job name
- to verify, in your second pr, there should now be 2 jobs running.
- if you run cicd again, with that log line that we add to see payload:
- what does the json look like when each job completes?
- what about when all jobs are done?
- do we get any extra json for all steps being completed
game plan 3 adding action logic to yml
- watch this to learn python dataclasses https://www.youtube.com/watch?v=r4iq_yPmIc0
- add a new field like
actions_need_to_pass: trueto the yml - add the python code below to support it
Line 48 in bcaad15
class RepoToWatch:
game plan 4: testing it all out
if actions_need_to_pass is true, we need to change some logic
if the webhook sees a push event
- it should extract the
head_commit'sidfield, and store it to acollections.defaultdictwhich maps repo name to aset - defaultdict example is here
when we see a completedevent
- extract the
head_commit'sidfield, check if that exists in our defaultdict - if it does, verify that all checks passed.
- if all checks passed, proceed to actually update the repo, and remove the id from the set.
once we have all this, what should our cicd embeds change to be? should we push an embed like "i saw a new commit on main, but i wont update yet because i didnt see a passing action"?
Metadata
Metadata
Assignees
Labels
No labels