Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlantis fail to auto-plan on Gitea push event #5134

Open
jndeverteuil opened this issue Dec 2, 2024 · 1 comment
Open

Atlantis fail to auto-plan on Gitea push event #5134

jndeverteuil opened this issue Dec 2, 2024 · 1 comment
Labels
bug Something isn't working provider/gitea

Comments

@jndeverteuil
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

When using Gitea as VCS and configuring webhooks, we configure hooks on events for like Pull Requests Comments and Push. I am able to successfully trigger a plan on a Pull Request Comment, by I get an unsupported event error when doing a Push

When I look at the code:

  • switch eventType {
    case "pull_request_comment":
    e.HandleGiteaPullRequestCommentEvent(w, body, reqID)
    case "pull_request":
    logger.Debug("Handling as pull_request")
    e.handleGiteaPullRequestEvent(logger, w, body, reqID)
    // Add other case handlers as necessary
    default:
    e.respond(w, logging.Debug, http.StatusOK, "Ignoring unsupported Gitea event type: %s %s=%s", eventType, "X-Gitea-Delivery", reqID)

It seems intended to only work with pull_request_comment and pull_request and will fail to auto-plan with other events.

Reproduction Steps

  • Configure webhooks on a Gitea repository with the following events checked (relevant documentation)

    • Repository events > Push
    • Issue events > Issue Comment
    • Pull Request events > Pull Request
    • Pull Request events > Pull Request Comment
    • Pull Request events > Pull Request Reviewed
    • Pull Request events > Pull Request Synchronized

image

  • Create a Pull Request
  • Push a new commit to the Pull Request
  • Review the Recent Deliveries in the repository settings > webhooks

Logs

Request

Request URL: https://<REDACTED>/events
Request method: POST
Content-Type: application/json
X-GitHub-Delivery: fa68c6e7-bda8-41d7-a23a-8c392a3c9429
X-GitHub-Event: push
X-GitHub-Event-Type: push
X-Gitea-Delivery: fa68c6e7-bda8-41d7-a23a-8c392a3c9429
X-Gitea-Event: push
X-Gitea-Event-Type: push
X-Gitea-Signature: d066fbce6d6dfb23f5dee309db3e0e0fbf8affedc1c1a2cd65988ac7ff4a4b21
X-Gogs-Delivery: fa68c6e7-bda8-41d7-a23a-8c392a3c9429
X-Gogs-Event: push
X-Gogs-Event-Type: push
X-Gogs-Signature: d066fbce6d6dfb23f5dee309db3e0e0fbf8affedc1c1a2cd65988ac7ff4a4b21
X-Hub-Signature: sha1=b533b1dbfde25340efc46e7543b7b09e71e3852d
X-Hub-Signature-256: sha256=d066fbce6d6dfb23f5dee309db3e0e0fbf8affedc1c1a2cd65988ac7ff4a4b21

Response

Ignoring unsupported Gitea event type: push X-Gitea-Delivery=fa68c6e7-bda8-41d7-a23a-8c392a3c9429

image

Environment details

  • Gitea v1.22.4
  • Atlantis v0.31.0 (commit: 245044c) (build date: 2024-11-22T17:58:20.688Z)

Additional Context

@jndeverteuil jndeverteuil added the bug Something isn't working label Dec 2, 2024
Copy link

dosubot bot commented Dec 2, 2024

Hey @jndeverteuil! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's dive into this together!

Atlantis currently does not support the 'push' event for Gitea webhooks, which is why you are encountering the "unsupported event" error. The supported event types for Gitea in Atlantis are:

  • Repository events: Push
  • Issue events: Issue Comment
  • Pull Request events: Pull Request
  • Pull Request events: Pull Request Comment
  • Pull Request events: Pull Request Reviewed
  • Pull Request events: Pull Request Synchronized [1].

However, the 'push' event is not handled in the current implementation of Atlantis, as the code is designed to work primarily with pull request and comment events [2].

There is a similar unsolved discussion regarding unsupported events in Atlantis, which might provide additional context: Github webhook integration error - Ignoring unsupported event [3].

To address this, you would need to modify the Atlantis codebase to handle 'push' events or explore community plugins or workarounds that might add this functionality. Unfortunately, there are no existing solutions or workarounds documented in the repository for this specific issue.

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working provider/gitea
Projects
None yet
Development

No branches or pull requests

1 participant