Skip to content

feat: add repository-level webhook#1159

Open
cohesive-flight wants to merge 5 commits into
Finsys:mainfrom
cohesive-flight:feat/repo-webhook
Open

feat: add repository-level webhook#1159
cohesive-flight wants to merge 5 commits into
Finsys:mainfrom
cohesive-flight:feat/repo-webhook

Conversation

@cohesive-flight

Copy link
Copy Markdown

Proposed change

Adds a repository-level webhook that deploys all git stacks belonging to the same repository across all environments. Includes smart filtering (only deploy stacks whose files changed) and shared repo cloning.

Closes #154

Type of change

  • Bug fix: non-breaking change which fixes an issue.
  • New feature / Enhancement: non-breaking change which adds functionality.
  • Breaking change: fix or feature that would cause existing functionality to not work as expected.
  • Other. Please explain:

@CLAassistant

CLAassistant commented Jun 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cohesive-flight

Copy link
Copy Markdown
Author

@jotka requesting review.

@jotka jotka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this, genuinley useful feature and the smart-filter idea is nice. few things i want sorted before it goes in though:

  1. concurrency. the webhook fires the deploy in the background and returns 202 straight away, but syncSharedRepository does fetch + git reset --hard on one shared repo dir. two pushes close together (merge that pushes a tag + branch, whatever) = two resets racing on the same working tree while stacks are reading compose files out of it. needs a per-repo lock/queue so runs cant overlap.

  2. no branch check. old handler had the branch guard (commented out), new one dropped it entirely - so a push to any branch triggers a redeploy of the tracked branch. should compare payload ref against repository.branch and just 200/ignore if it doesnt match.

  3. gitlab token compare is signature === secret, plain string equality = timing sidechannel. the github sha256 path already does timingSafeEqual, do the same for gitlab.

  4. security-wise this is a bigger blast radius than before (single stack -> every stack in every env), and the UI still lets you enable the webhook with an empty secret. combined thats an unauthed all-env deploy for anyone who knows the repo id. can we require a secret when webhook is enabled? also the GET trigger takes the secret in the query string which ends up in logs/referer - id rather drop the GET deploy path or move it behind auth.

couple smaller ones: deployOne basically reimplements the existing per-stack deploy logic (incl the new commitHash skip you added), would be nice to share that. and lastCommit is stored as a 7-char short sha which is a bit fragile for the equality checks - fine to keep full sha and just shorten for display.

rest looks good. migrations for both sqlite/pg are there which is great. happy to help if any of these are fiddly.

@cohesive-flight
cohesive-flight requested a review from jotka July 2, 2026 14:36
@cohesive-flight

Copy link
Copy Markdown
Author

@jotka done.

@MichiFr

MichiFr commented Jul 19, 2026

Copy link
Copy Markdown

Oh, just found this code enhancement. Guess, we can expect this in any of the upcoming releases very soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Webhook at the repository level

4 participants