feat: add repository webhook management #798

Merged
lunny merged 11 commits from rossigee/tea:feature/webhook-management-clean into main 2025-10-19 03:40:25 +00:00
Member

Summary

This PR adds support for organization-level and global webhooks in the tea CLI tool.

Changes Made

Organization Webhooks

  • Added --org flag to webhook commands to operate on organization-level webhooks
  • Implemented full CRUD operations for org webhooks (create, list, update, delete)
  • Extended TeaContext to support organization scope

Global Webhooks

  • Added --global flag with placeholder implementation
  • Ready for when Gitea SDK adds global webhook API methods

Technical Details

  • Updated context handling to support org/global scopes
  • Modified all webhook subcommands (create, list, update, delete)
  • Maintained backward compatibility for repository webhooks
  • Updated tests and documentation

Usage Examples

# Repository webhooks (existing) tea webhooks list tea webhooks create https://example.com/hook --events push # Organization webhooks (new)  tea webhooks list --org myorg tea webhooks create https://example.com/hook --org myorg --events push,pull_request # Global webhooks (future) tea webhooks list --global 

Testing

  • All existing tests pass
  • Updated test expectations for new descriptions
  • Manual testing of org webhook operations completed

Closes: webhook management feature request

## Summary This PR adds support for organization-level and global webhooks in the tea CLI tool. ## Changes Made ### Organization Webhooks - Added `--org` flag to webhook commands to operate on organization-level webhooks - Implemented full CRUD operations for org webhooks (create, list, update, delete) - Extended TeaContext to support organization scope ### Global Webhooks - Added `--global` flag with placeholder implementation - Ready for when Gitea SDK adds global webhook API methods ### Technical Details - Updated context handling to support org/global scopes - Modified all webhook subcommands (create, list, update, delete) - Maintained backward compatibility for repository webhooks - Updated tests and documentation ## Usage Examples ```bash # Repository webhooks (existing) tea webhooks list tea webhooks create https://example.com/hook --events push # Organization webhooks (new) tea webhooks list --org myorg tea webhooks create https://example.com/hook --org myorg --events push,pull_request # Global webhooks (future) tea webhooks list --global ``` ## Testing - All existing tests pass - Updated test expectations for new descriptions - Manual testing of org webhook operations completed Closes: webhook management feature request
rossigee added 1 commit 2025-08-16 07:20:58 +00:00
feat: add repository webhook management
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 39s
204c588653
Add complete CRUD operations for repository webhooks: - Create, list, update, delete webhooks with safety features - Support for gitea, slack, discord, telegram, msteams, etc. - Advanced config: secrets, auth headers, branch filtering - Multiple output formats with comprehensive test coverage Enables scriptable webhook management for CI/CD automation.
rossigee added 1 commit 2025-08-17 05:48:19 +00:00
Run 'go fmt'.
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 38s
a85a1ed450
rossigee added 1 commit 2025-08-17 06:27:26 +00:00
Make docs.
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 41s
077a1372eb
lunny added the
kind
feature
label 2025-08-19 18:41:13 +00:00
lunny added this to the v0.11.0 milestone 2025-08-19 18:41:21 +00:00
lunny reviewed 2025-09-12 17:25:28 +00:00
cmd/webhooks.go Outdated
@@ -0,0 +29,4 @@
&webhooks.CmdWebhooksDelete,
&webhooks.CmdWebhooksUpdate,
},
Flags: append([]cli.Flag{
Owner

Webhooks also support organization-level and global-level configurations, but it seems this hasn’t been implemented here yet.

Webhooks also support organization-level and global-level configurations, but it seems this hasn’t been implemented here yet.
Author
Member

Good point. I've addressed the organisation-level, but if I understand it correctly the global level hooks still need implementing in the SDK.

Good point. I've addressed the organisation-level, but if I understand it correctly the global level hooks still need implementing in the SDK.
rossigee marked this conversation as resolved
lunny reviewed 2025-09-12 17:26:44 +00:00
@@ -0,0 +51,4 @@
}
if !cmd.Bool("confirm") {
fmt.Printf("Are you sure you want to delete webhook %d (%s)? [y/N] ", hook.ID, hook.Config["url"])
Owner

Use bubbletea as TUI framework.

Use bubbletea as TUI framework.
rossigee marked this conversation as resolved
lunny modified the milestone from v0.11.0 to v0.12.0 2025-09-12 23:01:47 +00:00
rossigee added 5 commits 2025-09-18 13:53:53 +00:00
Add complete CRUD operations for repository webhooks: - Create, list, update, delete webhooks with safety features - Support for gitea, slack, discord, telegram, msteams, etc. - Advanced config: secrets, auth headers, branch filtering - Multiple output formats with comprehensive test coverage Enables scriptable webhook management for CI/CD automation.
# Conflicts: #	README.md
fix: use flags.GetListOptions() for webhook list command
All checks were successful
check-and-test / Run govulncheck (pull_request) Successful in 21s
check-and-test / check-and-test (pull_request) Successful in 1m27s
92e37886a6
- Fixed compilation error in cmd/webhooks/list.go - Changed from c.GetListOptions() to flags.GetListOptions() - Follows pattern used in other list commands
rossigee added 1 commit 2025-10-19 01:42:08 +00:00
Merge branch 'main' into feature/webhook-management-clean
All checks were successful
check-and-test / Run govulncheck (pull_request) Successful in 21s
check-and-test / check-and-test (pull_request) Successful in 1m8s
f60e8eefe5
rossigee added 1 commit 2025-10-19 02:53:08 +00:00
feat: add support for organization-level webhooks
All checks were successful
check-and-test / Run govulncheck (pull_request) Successful in 19s
check-and-test / check-and-test (pull_request) Successful in 1m8s
bc1f6af833
- Add --org and --global flags to webhook commands - Extend TeaContext to support org/global scopes - Implement org webhook operations (create, list, update, delete) - Add placeholders for global webhooks (awaiting SDK support) - Update documentation and tests - Closes issue regarding organization-level webhook configurations
rossigee added 1 commit 2025-10-19 03:23:56 +00:00
Merge branch 'main' into feature/webhook-management-clean
All checks were successful
check-and-test / Run govulncheck (pull_request) Successful in 15s
check-and-test / check-and-test (pull_request) Successful in 1m15s
cba150b996
# Conflicts: #	README.md #	cmd/cmd.go #	docs/CLI.md
lunny approved these changes 2025-10-19 03:40:12 +00:00
lunny merged commit 3495ec5ed4 into main 2025-10-19 03:40:25 +00:00
Sign in to join this conversation.