Skip to content

feat(stovepipe): add commit ingestion abstractions#200

Open
gsturges wants to merge 1 commit into
mainfrom
gsturges/codem-101-stovepipe-commit-ingestion-abstractions
Open

feat(stovepipe): add commit ingestion abstractions#200
gsturges wants to merge 1 commit into
mainfrom
gsturges/codem-101-stovepipe-commit-ingestion-abstractions

Conversation

@gsturges
Copy link
Copy Markdown
Contributor

@gsturges gsturges commented Jun 4, 2026

Summary

  • Add entity.PushEvent to represent a branch push (repo, branch, SHAs, pusher) for webhook/Kafka-driven ingestion.
  • Define CommitIngester and PushEventHandler in stovepipe/extension so a consumer can subscribe to push events and dispatch work.
  • Add stovepipe/core/filter with Config / ShouldProcess to gate processing by watched repo and optional branch list (empty list = all branches for that repo).
  • Add commitingester.LoggingHandler as a no-op PushEventHandler stub until persistence/pipeline wiring lands.

Test plan

  • make test (or targeted tests if added in a follow-up)
  • make lint

Made with Cursor

@gsturges gsturges requested review from a team, behinddwalls and sbalabanov as code owners June 4, 2026 23:38
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment thread stovepipe/entity/entity.go Outdated

// PushEvent represents a git push to a branch detected from a webhook event.
// Fields are immutable after construction.
type PushEvent struct {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need to be git aware? @mnoah1

SQ currently is not git aware in general for most part, so my general thought here would be to keep that semantics similar and define abstractions that can allow us to work with git or some other vcs, specific impl could be left to the implementer to decide

Copy link
Copy Markdown
Contributor

@mnoah1 mnoah1 Jun 5, 2026

Choose a reason for hiding this comment

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

This case seems very close to SubmitQueue's ChangeInfo struct, so maybe we could leverage that:

  • Internal extension subscribes to the events and translates them into a shape similar to ChangeInfo - maybe even reuse the existing entity altogether.
  • Similarly to the github.com:// schema, add a raw git:// schema that identifies the path to the change on a git remote or other vcs - at this point, it doesn't matter which code review system was used, just where to find the change on remote.
  • Will work well as an identifier in the db like the existing change table - easy to provide two uri's and compare them.

@behinddwalls does this make sense?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, this seems fine. We can think about whether to re-use the Change entity...we might have to move it out of SQ domain and into the top level

@gsturges gsturges force-pushed the gsturges/codem-101-stovepipe-commit-ingestion-abstractions branch 3 times, most recently from 64a6c14 to 9bbb8f9 Compare June 5, 2026 22:20
Comment thread stovepipe/entity/entity.go Outdated
// Example: "git://github.com/uber/go-code/refs/heads/main/c3a4d5e6f789..."
//
// Fields are immutable after construction.
type CommitEvent struct {
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.

Let's use the ChangeInfo naming from our earlier chat (and can use Change similarly throughout the PR where it says Commit currently).


"github.com/uber/submitqueue/stovepipe/entity"
)

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.

Add a New() function to enforce interface compliance here (and you can accept the logger as a param)

func (LoggingHandler) HandlePushEvent(ctx context.Context, event entity.PushEvent) error {
// Caller (the Kafka consumer in go-code) is responsible for actual logging.
// This stub is intentionally a no-op at the OSS layer.
return nil
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.

Add an actual log line here - once we get this wired into the internal service we can deploy and confirm it emits real events.

Comment thread stovepipe/extension/extension.go Outdated

// CommitEventHandler processes a single commit event received from the ingester.
type CommitEventHandler interface {
HandleCommitEvent(ctx context.Context, event entity.CommitEvent) error
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.

I think naming has diverged a bit here - we have HandleCommitEvent, HandlePushEvent. Let's go with something that mirrors our "Change" terminology - how about IngestChange

Introduce ChangeInfo, ChangeIngester/ChangeHandler, a no-op logging
handler stub, and URI watch filtering for downstream ingestion.
@gsturges gsturges force-pushed the gsturges/codem-101-stovepipe-commit-ingestion-abstractions branch from 9bbb8f9 to 9bfce3e Compare June 5, 2026 23:22
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.

4 participants