FJ-31: Add fj repo webhook subcommands (list/view/create/edit/delete/test) #36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/repo-webhook-subcommands-FJ-31"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
FJ-31: Add
fj repo webhooksubcommandsAdds CLI management of repository webhooks:
fj repo webhook list|view|create|edit|delete|test.fj-core (domain layer, MCP-reusable)
Thin
forgejo-apiwrappers incrates/fj-core/src/repo.rsfollowing the existing pattern:list_hooks,get_hook,create_hook,edit_hook,delete_hook,test_hook. No clap/crossterm/fluent dependency leaks;cargo tree -p fj-client -p fj-core -e normal | grep -E 'clap|crossterm|fluent'stays empty.fj binary
WebhookSubcommandenum wired asRepoCommand::Webhook(literalwebhook, aliaswebhooks), mirroring the labels/units pattern. Hooks are addressed by numeric id;listoutput includes the id so it can be fed to the other subcommands.createmaps everyCreateHookOption/CreateHookOptionConfigfield:--type(clap ValueEnum over the forgejo-api hook kinds, defaultforgejo),--url,--content-type(defaultjson),--secret, repeatable--event,--branch-filter,--authorization-header,--active.edit <id>takes the same flags as options and sends only the fields whose flags were passed; the config map is built from just the supplied url/content-type/secret keys.test <id>triggers a delivery and accepts optional--ref.listandviewsupport--jsonvia a stableWebhookJsonprojection that intentionally excludes the webhook secret.New user-facing strings have en-US
.ftlentries incrates/fj/localization/en-US/messages.ftl. Git server hooks (repo_*_git_hook) are out of scope per the issue.Verification
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo build,cargo testall clean.fj repo webhook --helpand... create --helprender the expected command tree.Closes FJ-31 once merged.