Skip to content

Feat: last-change attribution - #2692

Open
s1ntaxe770r wants to merge 6 commits into
developfrom
feat/drift-last-change
Open

s1ntaxe770r wants to merge 6 commits into
developfrom
feat/drift-last-change

Conversation

@s1ntaxe770r

Copy link
Copy Markdown
Collaborator

🧠 Ai UsageDetails (if applicable):

When a drift is detected, it is often more helpful for teams to know what commit caused the drift. This pr adds change attribution to drift detection as well as a config options to allow notifications via slack

Used claude to generate test cases and for code path discovery
Changes where manually verified in a private slack channel(see SS)

image

When drift is detected, run git log -1 on the project directory to find
the last person who changed it and include author, commit and relative
time in the Slack / GitHub issue drift notifications. Blame is
best-effort: if git history is unavailable (e.g. shallow clone) the
notification is sent without it.
- Slack drift notifications can post via a bot token (chat.postMessage):
  the channel gets one summary message and the plan goes into its thread,
  since incoming webhooks cannot thread replies.
- Plans are truncated at a line boundary (12k chars webhook, 40k thread)
  with an omitted-characters note pointing at the workflow logs, so huge
  monorepo plans no longer flood the channel.
- git blame fields now use the unit separator instead of '|' so author
  names containing pipes parse correctly.
- refuse blame attribution on shallow clones: the grafted tip commit
  matches every path, so git log would name the repo's last committer
  for every project instead of the real author
- slack postMessage: check HTTP status, retry 429s honoring Retry-After,
  pace thread replies at ~1/s
- TruncatePlan: rune-safe cut, and keep the hard cut when retreating to
  a line boundary would discard most of the window (single-line plans)
- fenced chunks include their fences in the 4000-char budget; ``` inside
  plan text is broken with a zero-width space so it cannot close the block
- providers error when only one of bot-token/channel is set; EE advanced
  mode keeps precedence over bot-token mode
- github issue notification truncates the plan instead of the message so
  the closing code fence survives
- docs: configure-checkout: false (the action's own checkout re-shallows
  the repo), step-by-step bot token setup, fixed backendless cross-link
Drop all emojis except ⚠️ and stop posting the terraform plan to
the channel: with many repos and projects the plan is pure noise. Each
project now sends one compact summary (project, repo, last change by);
the plan lives in the workflow logs, or in the summary's thread when a
bot token is configured.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
opentaco-docs de44ed2 Commit Preview URL

Branch Preview URL
Aug 10 2026, 08:58 AM

SplitCodeBlocks lost its last caller when plans stopped being posted to
the channel, and LastChange.Email was captured but never shown in any
notification.
@s1ntaxe770r
s1ntaxe770r requested a review from motatoes August 10, 2026 14:06

This branch has not been deployed

No deployments
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.

2 participants