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.

  1. A small service exposes GET /health and reports the packaged version.
  2. 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.
  3. A custom Duo flow, Undo, triggers on pipeline passed. It reads the prove_rollback job and opens a Work item: PASS or FAIL, previous SHA, new SHA.
  4. A human replies approve on 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 /health contract.]] [[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.yml with test → 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 approve on 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_rollback job went green but skipped for real — CI could not see HEAD^. We fixed history depth so ROLLBACK_OK is a genuine pass.
  • Approval without a promote: The first version asked for approve but 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
Share this project:

Updates

Submission history