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

Gitea "unknown event type" (create and delete) #175

Closed
posledov opened this issue Oct 13, 2024 · 5 comments · Fixed by #187
Closed

Gitea "unknown event type" (create and delete) #175

posledov opened this issue Oct 13, 2024 · 5 comments · Fixed by #187

Comments

@posledov
Copy link

posledov commented Oct 13, 2024

Gitea version :: 1.22.3
webhook-go version :: 2.2.0

cat /etc/voxpupuli/webhook.yml

---
server:
  protected: false
  port: 8088
chatops:
  enabled: false
  service:
  channel:
  user:
  auth_token:
  server_uri:
r10k:
  command_path: "/opt/puppetlabs/puppet/bin/r10k"
  config_path: "/etc/puppetlabs/r10k/r10k.yaml"
  default_branch: production
  prefix:
  allow_uppercase: false
  verbose: true
  deploy_modules: true
  generate_types: false

Creating or deleting a branch leads to the following errors:

жов 13 18:43:52 puppet.local.lan webhook-go[111824]: time="2024-10-13T18:43:52+03:00" level=error msg="error parsing webhook: unknown event type delete"
жов 13 18:43:52 puppet.local.lan webhook-go[111824]: [GIN] 2024/10/13 - 18:43:52 | 500 |    6.828339ms |  192.168.1.13 | POST     "/api/v1/r10k/environment"
жов 13 18:44:51 puppet.local.lan webhook-go[111824]: time="2024-10-13T18:44:51+03:00" level=error msg="error parsing webhook: unknown event type create"
жов 13 18:44:51 puppet.local.lan webhook-go[111824]: [GIN] 2024/10/13 - 18:44:51 | 500 |     290.667µs |  192.168.1.13 | POST     "/api/v1/r10k/environment"
@posledov
Copy link
Author

webhook-go version :: 2.7.1 – the same problem

@dhollinger
Copy link
Member

dhollinger commented Nov 23, 2024

That is the current intended functionality. We only parse and react to push events at this time:

https://github.com/voxpupuli/webhook-go/blob/master/lib/parsers/gitea.go#L39-L41

Ensure that when you setup your webhook that gets sent to Webhook Go that you are only enabling the push event.

@dhollinger
Copy link
Member

Awaiting a reply. Will be closed if no reply made is made by the end of January 2025

@posledov
Copy link
Author

posledov commented Jan 19, 2025

Hello, David.
Sorry for the delayed response!

Yes, indeed, if we disable the create event, the corresponding error disappears, and the branch/environment is created as it should be.

What about delete? When this event is disabled, an environment that was deleted on the git server is not immediately removed; it is only deleted during a push event for another branch/environment (if I understood correctly). So, it’s possible that environments can exist on the Puppet server whose branches have long been removed from the Git server.

With the voxpupuli/puppet_webhook, from which I’m trying to migrate to this one, the delete event works as expected.

@dhollinger
Copy link
Member

I'll have to look into how difficult it would be to add. The Webhook was built off previous Ruby-based tools that only monitored on a push event, but I can't imagine it's that difficult to add a path for a delete event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants