Inspiration
Most pipelines only test forward motion: does it build, does it pass, does it deploy? In real incidents the painful question is different — can we still run what we had before? I wanted a supervised agent that treats reversibility as a first-class gate, not an afterthought at 2 a.m.
That fit Life After Code: the hard part is no longer writing the code, it is what happens next in the DevSecOps lifecycle, with a human still owning the final call.
What it does
Undo is a Path A (Start Fresh) project on GitLab Duo Agent Platform.
- A small service exposes
GET /healthand reports the packaged version. - On every push to
main, the pipeline tests the app, publishes that exact build to the package registry, then starts the previous package and checks/health. - A custom Duo flow, Undo, triggers on pipeline passed. It reads the
prove_rollbackjob and opens a Work item: PASS or FAIL, previous SHA, new SHA. - A human replies
approveon a PASS issue — Supervised autonomy: the agent runs the middle steps; the person approves the outcome. [[5. After approve, the new revision is promoted on Google Cloud Run. Staging and production URLs serve the same/healthcontract.]] [[6. A Secure-stage job (SAST / secret detection) runs in CI; Observability is enabled on the group for the Monitor stage.]]
Stages we intentionally touch: verify, package, [[secure,]] release / configure (staging + [[Cloud Run]]), govern (human gate)[[, monitor]].
How we built it
- App: Python
app.py+ unit tests — deliberately minimal so the lifecycle is the product. - CI/CD:
.gitlab-ci.ymlwithtest→package→prove_rollback→ staging environment. - Agent platform: Custom ambient flow Undo (YAML), enabled with a Pipeline events → Passed trigger. No chat prompt required.
- Human gate: Work items created by the flow; reply
approveon PASS only. [[- Google Cloud: Container image → Artifact Registry → Cloud Run (staging then production after approve). Deploy config lives in the public repo.]] - Licence: MIT, visible on the project.
Built inside the provisioned hackathon group project: shielyule-group/ShielYule-project.
Challenges we ran into
- GitLab navigation vs training docs: Course labs refer to “Automate” and a Swag Shop project that was never provisioned. Flows live under AI → Flows in this UI; the real project sits in a group, not the empty personal Projects list.
- Credits: Duo reported “no credits” while still on a personal Ultimate trial pool. Fix was setting the Duo default namespace to the hackathon group so the 500 monthly hackathon credits apply.
- Shallow clones: The first
prove_rollbackjob went green but skipped for real — CI could not seeHEAD^. We fixed history depth soROLLBACK_OKis a genuine pass. - Approval without a promote: The first version asked for
approvebut nothing visible happened next. [[We closed that gap by promoting Cloud Run / updating Environments after approve.]] Making the gate visible mattered more than adding more agents.
Accomplishments that we're proud of
- An end-to-end Supervised loop: green pipeline → agent Work item → one-word human approve.
- A rollback proof that fails closed when verification is missing (FAIL issues that must not be approved).
- Keeping the app tiny on purpose so judges can follow every stage on GitLab dashboards. [[- A public Cloud Run URL tied to the same version the pipeline packaged.]]
What we learned
- Event-driven flows and triggers beat chat demos for this hackathon’s pass/fail bar.
- “Green pipeline” is not the same as “safe to promote” — proving the previous artefact still boots is a different, useful question.
- GitLab’s group-provisioned workspace, credits, and AI menus are part of the product surface you have to learn, not side quests. [[- Wiring GitLab CI to Google Cloud (identity + Artifact Registry + Cloud Run) is where deploy proof becomes judge-clickable.]]
What's next for Undo
- Keep the approve gate, and harden promote (traffic split, faster abort to the previous Cloud Run revision).
- Optional: Observability spans on
/health, richer Secure findings, and a recorded failure path where rollback proof FAIL blocks promote. - Not next: turning this into a generic “agent writes every MR” sample — Undo stays focused on reversibility.
Built With
- agents
- artifact-registry
- automation
- ci-cd
- cloud-run
- devops
- devsecops
- docker
- gitlab
- gitlab-duo
- gitlab-duo-agent-platform
- google-cloud
- mit-license
- python
Log in or sign up for Devpost to join the conversation.