Skip to content

Expose currently supported events properly on services API

What does this MR do?

Problem to overcome

The events are seemingly missing from the services API. They are not documented but they should be exposed here: services.rb:26. Some events, e.g. commit_events, are exposed as expected but still, some others like merge_requests_events, cannot be set up through the API at all. The problem is that some events are exposed with the wrong name, for example merge_request_events instead of merge_requests_events (note the plural - requestS).

The corresponding specs only test one event for a service (always the first one which is typically commit or push), that's why it wasn't detected at all.

Resolution

The MR does the following:

  • exposes the proper event names for PUT/POST requests
  • adds the missing commit_events to GET responses (it was an unrelated bug)
  • extends the specifications to test all supported events and not only the first one
    • if you run the new tests only, so without the fix, you can see that the API of drone-ci, hangouts-chat, hipchat, jira, mattermost, microsoft-teams, packagist, and slack services are broken
  • documents the currently supported events

I believe it should entirely solve #56737 (closed) and partially solve #59702 (closed) and #41113 (moved) as well

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #56737 (closed)

Merge request reports