Skip to content

Handles branch delete event on github#2044

Merged
chmouel merged 2 commits intotektoncd:mainfrom
PuneetPunamiya:fix-branch-delete-event-github
Apr 23, 2025
Merged

Handles branch delete event on github#2044
chmouel merged 2 commits intotektoncd:mainfrom
PuneetPunamiya:fix-branch-delete-event-github

Conversation

@PuneetPunamiya
Copy link
Copy Markdown
Member

  • When a branch is deleted via repository UI, a push event is triggered and the payload will have a zero hash value

  • Hence, this patch handles the deletion of branch deletion and returns early from ParsePayload function without further processing which in turn also avoids unnecessary log noise

Changes

Submitter Checklist

  • 📝 Ensure your commit message is clear and informative. Refer to the How to write a git commit message guide. Include the commit message in the PR body rather than linking to an external site (e.g., Jira ticket).

  • ♽ Run make test lint before submitting a PR to avoid unnecessary CI processing. Consider installing pre-commit and running pre-commit install in the repository root for an efficient workflow.

  • ✨ We use linters to maintain clean and consistent code. Run make lint before submitting a PR. Some linters offer a --fix mode, executable with make fix-linters (ensure markdownlint and golangci-lint are installed).

  • 🧪 While 100% coverage isn't required, we encourage unit tests for code changes where possible.

  • If adding a provider feature, fill in the following details:

    • GitHub App
    • GitHub Webhook

    (update the provider documentation accordingly)

@PuneetPunamiya PuneetPunamiya force-pushed the fix-branch-delete-event-github branch from 2ae004a to cfdfa82 Compare April 15, 2025 07:48
@PuneetPunamiya
Copy link
Copy Markdown
Member Author

Once this is merged, will raise a follow up PR for other git providers

Comment thread pkg/provider/github/parse_payload.go
Comment thread pkg/provider/github/parse_payload.go Outdated
Comment thread pkg/provider/github/parse_payload.go Outdated
When a branch is deleted via repository UI, a push event
is triggered and the payload will have a zero hash value

Hence, this patch handles the deletion of branch deletion and
returns early from ParsePayload function without further
processing which in turn also avoids unnecessary log noise

Signed-off-by: PuneetPunamiya <ppunamiy@redhat.com>
@PuneetPunamiya PuneetPunamiya force-pushed the fix-branch-delete-event-github branch from 15f7ad1 to e2f5c8e Compare April 22, 2025 12:55
@chmouel
Copy link
Copy Markdown
Member

chmouel commented Apr 22, 2025

/retest

@chmouel chmouel merged commit 396cd62 into tektoncd:main Apr 23, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants