tektoncd / tektoncd/pipelines-as-code
[Gitea/Forgejo] Tag push webhooks fail with 'could not find commit info: 0000000000000000000000000000000000000000'
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 214
- Forks
- 144
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 27
Description
In pkg/provider/gitea/parse_payload.go, when handling *forgejostructs.PushPayload, the fallback for an empty SHA uses gitEvent.Before:
if processedEvent.SHA == "" {
processedEvent.SHA = gitEvent.Before
}
When pushing a new tag (or a new branch without new commits):
• gitEvent.HeadCommit is nil.
• gitEvent.Before is "0000000000000000000000000000000000000000" (representing ref creation in Git push payloads).
• gitEvent.After contains the target SHA.
Because Before is assigned to processedEvent.SHA, PAC attempts to look up the commit 0000000000000000000000000000000000000000 via the
Gitea/Forgejo API and fails:
{"level":"error","logger":"pipelinesascode","msg":"an error occurred: could not find commit info:
0000000000000000000000000000000000000000","provider":"gitea","event-type":"push","target-branch":"refs/tags/v0.0.1"}
Expected Behavior:
PAC should inspect gitEvent.After (and resolve annotated tag object SHAs to their peeled commit SHA if needed) instead of falling back to
gitEvent.Before.
Additional Info
-
Kubernetes version:
Client Version: v1.37.0
Kustomize Version: v5.8.1
Server Version: v1.34.11
- Tekton Pipeline version:
v1.15.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/provider/gitea/parse_payload.go at the PushPayload handling and trace how processedEvent.SHA is selected. Exercise tag creation and branch creation without new commits, then verify the target comes from gitEvent.After rather than the all-zero Before value and that annotated tags resolve to their peeled commit SHA.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100