Skip to content

Conversation

@rodrigoluizs
Copy link

@rodrigoluizs rodrigoluizs commented Nov 20, 2024

Summary

This PR introduces new endpoints to the Webhook API that allow users to perform actions using connectionName instead of connectionId. The goal is to improve usability and simplify integration by enabling users to reference webhooks by their human-readable names, eliminating the need to manage and persist connectionId values.

Introduced Changes

1. New Endpoints:
  • Added endpoints prefixed with /by-name to explicitly handle connectionName:
  • POST /plugins/webhook/connections/by-name/:connectionName/deployments
  • POST /plugins/webhook/by-name/:connectionName/issues
  • POST /plugins/webhook/by-name/:connectionName/issue/:issueKey/close
  • DELETE /plugins/webhook/connections/by-name/:connectionName
  • GET /plugins/webhook/connections/by-name/:connectionName
  • PATCH /plugins/webhook/connections/by-name/:connectionName
2. Internal Logic:
  • Updated the Webhook API implementation to retrieve connections using connectionName.
  • Reused existing logic by delegating common operations to internal methods, ensuring no duplication of functionality.
3. Backward Compatibility:
  • Existing endpoints using connectionId remain unchanged, ensuring full backward compatibility with current integrations.

Does this close any open issues?

Closes #8195

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. component/plugins This issue or PR relates to plugins pr-type/feature-development This PR is to develop a new feature labels Nov 20, 2024
@klesh
Copy link
Contributor

klesh commented Nov 22, 2024

LGTM, Thanks for your contribution.

@rodrigoluizs
Copy link
Author

Thanks for the review @klesh!

Should I submit another PR to the release-v1.0 branch?

@klesh klesh merged commit 5ec1d32 into apache:main Nov 22, 2024
13 checks passed
@klesh
Copy link
Contributor

klesh commented Nov 22, 2024

@rodrigoluizs That would be great.

rodrigoluizs pushed a commit to Bonial-International-GmbH/incubator-devlake that referenced this pull request Nov 22, 2024
…8203)

* feat(webhooks): add by-name methods to connection helper

* feat(webhooks): add connection endpoints by name

* feat(webhooks): add post deployment endpoint by name

* feat(webhooks): add issue endpoints by name
@rodrigoluizs rodrigoluizs deleted the rodrigoluizs/webhook-api-by-name-endpoints branch November 22, 2024 06:36
klesh pushed a commit that referenced this pull request Nov 26, 2024
…8213)

* feat(webhooks): add by-name methods to connection helper

* feat(webhooks): add connection endpoints by name

* feat(webhooks): add post deployment endpoint by name

* feat(webhooks): add issue endpoints by name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/plugins This issue or PR relates to plugins pr-type/feature-development This PR is to develop a new feature size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature][Webhooks] Support for Webhook Name in Webhook Endpoints

2 participants