Skip to content

fix: trigger PR event handling on PR updates for Gitea/Forgejo#6178

Open
kfkonrad wants to merge 2 commits intorunatlantis:mainfrom
kfkonrad:kfkonrad/2026-02-11-ykkvnqnukmzy
Open

fix: trigger PR event handling on PR updates for Gitea/Forgejo#6178
kfkonrad wants to merge 2 commits intorunatlantis:mainfrom
kfkonrad:kfkonrad/2026-02-11-ykkvnqnukmzy

Conversation

@kfkonrad
Copy link
Copy Markdown

what

  • Until now Gitea (and compatible forks) only triggers automatic terraform plans when the PR is first created or an issue is posted (or rather all other events are ignored by Atlantis).
  • With this PR Atlantis will also run terraform plans when a PR on Gitea is updated (i.e. when a new commit is pushed/force-pushes).

why

  • Gitea has different event types for PR creation (pull_request) and PR updated (pull_request_sync)
  • Right now only the former is handled by Atlantis
  • The pull_request and pull_request_sync events use the same schema and can thus be handled by the same case in the existing switch statement
    • Yes, I double checked that both in manual testing and the Gitea and Forgejo codebases

tests

  • I tested my changes manually against my Forgejo instance
  • I verified the schema compatibility regarding the way it's parsed in handleGiteaPullRequestEvent between pull_request and pull_request_sync in both the Gitea and Forgejo codebases and by manually comparing the payload of the respective events

references

none

Copilot AI review requested due to automatic review settings February 11, 2026 09:50
@github-actions github-actions bot added the go Pull requests that update Go code label Feb 11, 2026
@dosubot dosubot bot added the bug Something isn't working label Feb 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Gitea/Forgejo's pull_request_sync webhook event, which is triggered when a pull request is updated (e.g., new commits are pushed). Previously, Atlantis only responded to the initial pull_request event, meaning subsequent pushes to a PR would not trigger automatic Terraform plans. The fix is simple and follows established patterns used for other VCS providers in the codebase.

Changes:

  • Added pull_request_sync to the case statement handling pull request events for Gitea/Forgejo, enabling Atlantis to run Terraform plans on PR updates

Comment thread server/controllers/events/events_controller.go
Comment thread server/controllers/events/events_controller.go
@kfkonrad kfkonrad force-pushed the kfkonrad/2026-02-11-ykkvnqnukmzy branch 3 times, most recently from be177ab to bc1cf21 Compare February 11, 2026 09:59
Signed-off-by: Kevin F. Konrad <kevin.konrad@skillbyte.de>
@kfkonrad kfkonrad force-pushed the kfkonrad/2026-02-11-ykkvnqnukmzy branch from bc1cf21 to 33b5873 Compare February 11, 2026 10:06
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update Go code lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants