Skip to content

Invalidate branch delete event on Bitbucket Data Center #2035

Open
@zakisk

Description

@zakisk

Issue

When a branch is deleted via the repository UI, a repo:refs_changed event is triggered, which is treated as a push event by PAC. As a result, PAC attempts to validate the commit information, leading to an error message. We should prevent this from occurring by ignoring such events directly within the ParsePayload function to avoid unnecessary log noise.

Solution

The payload of a repo:refs_changed event includes a changes array with fromHash and toHash fields. When a branch is deleted, the toHash field will contain a zero hash value (0000000000000000000000000000000000000000). Therefore, we should check the toHash value in the event payload, and if it matches the zero SHA, we should return early from the ParsePayload function without further processing.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions