Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce dev.cdeventsx.scm-branch.initialCommit as an Experimental CDEvent for DORA #247

Open
dsanyika opened this issue Mar 12, 2025 · 0 comments

Comments

@dsanyika
Copy link

dsanyika commented Mar 12, 2025

To support DORA’s Lead Time for Change (LTC) metric, we need to track the first project commit on a repository branch. This should be distinguished from branch.created as not all workflows involve code changes be included when creating a branch and it should allow multiple projects be started on the same branch. LTC is developer focused and should be computed from the first code commit.

Since CDEvents lacks a change.committed event, we propose branch.initialCommit as an experimental event under CDEventsX to capture the first project commit in a branch. It is important to denote that the intent is for the developer to signal the start on a project (feature, fix, enhancement, etc.) that should be tracked for the LTC metric.

Proposed Event Definition:

Event Type:

dev.cdeventsx.scm-branch.initialCommit.0.4.1

{
  "context": {
    "version": "0.4.1",
    "id": "<UUID>",
    "source": "<SCM URL>",
    "type": "dev.cdeventsx.scm-branch.initialCommit.0.4.1",
    "timestamp": "<ISO8601>",
    "schemaUri": "https://cdeventsx.dev/schema/scm-branch-initialCommit.json",
    "chainId": "<Ticket-ID or Commit SHA>"
  },
  "subject": {
    "id": "<Commit SHA>",
    "source": "<SCM URL>",
    "type": "branch",
    "content": {
      "repository": "<Repo URL>",
      "branch": "<Branch Name>",
      "commitSha": "<Commit SHA>",
      "author": "<Author Name>",
      "message": "<Commit Message>"
    }
  },
  "customData": {
    "deployer": "SCM Hook"
  },
  "customDataContentType": "application/json"
}

Use Case:

DORA requires measuring LTC from the first commit to deployment.

  • branch.initialCommit ensures the starting point compatible with LTC tracking.
  • This enables event correlation between commits, pipelines, and deployments.

Impact:

  • Provides an immediate experimental CDEvents solution for tracking LTC.
  • Developers can emit branch.initialCommit with a post-commit hook.
  • Allows SCM tools (GitHub, GitLab, Bitbucket) to emit branch.initialCommit via a post-receive hook or push event.
@dsanyika dsanyika changed the title Introduce dev.cdeventsx.cdf-branch.initialCommit as an Experimental CDEvent for DORA Introduce dev.cdeventsx.scm-branch.initialCommit as an Experimental CDEvent for DORA Mar 13, 2025
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

No branches or pull requests

1 participant