Skip to content

Remove the webhook feature (endpoints, git/recipes code, frontend UI, and tests)#359

Merged
cteyton merged 7 commits into
mainfrom
claude/vigilant-keller-vwj3qe
Jun 15, 2026
Merged

Remove the webhook feature (endpoints, git/recipes code, frontend UI, and tests)#359
cteyton merged 7 commits into
mainfrom
claude/vigilant-keller-vwj3qe

Conversation

@cteyton

@cteyton cteyton commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Explanation

This PR removes the webhook feature end to end — the GitHub/GitLab push-webhook endpoints and all the code that automatically updated recipes from Git push events. It started as a removal of the webhook integration tests and was extended to delete the entire feature across the stack.

The webhook entry points (POST /:orgId/hooks/github, /gitlab, GET /:orgId/hooks) drove RecipesAdapter.updateRecipesFromGitHub/GitLabBaseUpdateRecipesFromWebhookUseCasegitPort.handleWebHookWithoutContent, plus a frontend "Webhook" tab that displayed the hook URLs. All of this is now gone.

What was removed

Tests

  • webhook-contract.integration.spec.ts and the related performance analysis doc (integrations-tests-analysis.md).
  • The handlePushHook unit-test suites in GithubRepository.spec.ts / GitlabRepository.spec.ts.

Frontend (apps/frontend)

  • The "Webhook" tab in the Manage Git Provider dialog and the WebHookConfig component.
  • The git gateway/query/key plumbing that fetched webhook URLs (listWebHooks, useGetGitWebhooksQuery, GET_GIT_WEBHOOKS_KEY) — the whole gitGateway was webhook-only.

API (apps/api)

  • The hooks controller/module and its HooksModule registration in AppModule.
  • The recipes.service passthrough methods updateRecipesFromGitHub/GitLab.

Recipes (@packmind/recipes, @packmind/types)

  • BaseUpdateRecipesFromWebhookUseCase and the GitHub/GitLab webhook use cases, their RecipesAdapter wiring, and the updateRecipesFromGitHub/GitLab methods + contracts from IRecipesPort.

Git (@packmind/git, @packmind/types)

  • The handleWebHook / handleWebHookWithoutContent use cases, the handlePushHook implementations and webhook-only helpers (isValidBranch, extractMatchingFilesFromCommits, isPushEventFromWebhook), the webhook payload types, and the webhook methods from IGitPort / IGitRepo.

What was intentionally kept

  • The async job pipeline (FetchFileContentUpdateRecipesAndGenerateSummariesDeployRecipes delayed jobs). It is now unused but retained as shared infrastructure. Because the kept FetchFileContent contract reused the webhook result-type shapes, those shapes were relocated into IFetchFileContentUseCase (FetchFileContentFile, FetchedFileContent) so the pipeline still compiles.
  • The GitHub App manifest hook_attributes.url (/api/v0/hooks/github-app) — that is manifest metadata for GitHub App registration, not one of the removed webhook endpoints.

Type of Change

  • Refactoring / feature removal
  • Test suite cleanup

Affected Components

  • Domain packages affected: @packmind/recipes, @packmind/git, @packmind/types
  • Apps affected: api, frontend
  • Breaking changes: the POST /:orgId/hooks/{github,gitlab} and GET /:orgId/hooks endpoints are removed; recipes are no longer auto-updated from Git push events.

Commits

Ordered so the build stays green at each step:

  1. test: remove webhook integration tests
  2. refactor(frontend): remove webhook configuration UI
  3. refactor(api): remove webhook endpoints
  4. refactor(recipes): remove webhook-triggered recipe update use cases
  5. refactor(git): remove webhook handling code (source + git tests together)
  6. docs: drop references to removed webhook methods

Testing

  • Typecheck passes: frontend, api, git, recipes, types
  • Lint passes (0 errors): frontend, git, recipes, types
  • Unit tests pass: git (520), recipes (226)
  • Integration tests pass: 15 suites / 506 tests — confirms the kept job pipeline and adapters still work end to end
  • Repo-wide scan: no remaining references to any removed webhook symbol

Reviewer Notes

The removal cascades by necessity: the webhook endpoints, the recipe webhook use cases, and the git webhook handlers were only consumed by each other, so they were removed together. The async job pipeline was left in place per request, with the shared file-shape types relocated to a non-webhook contract.

https://claude.ai/code/session_01DuK1cKc27SXmtAPPpvcxSS

Remove the webhook-contract integration test (the only integration test
covering webhook lifecycle) and the related performance analysis document
that used it as its primary benchmark case study.
@greptile-apps

greptile-apps Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the webhook feature end-to-end — the GitHub/GitLab push-webhook HTTP endpoints, the use cases that processed them, the git repository webhook helpers, and the frontend "Webhook" tab. The async job pipeline (FetchFileContentUpdateRecipesAndGenerateSummariesDeployRecipes) is intentionally kept; the file-shape types that were previously aliased from the webhook contracts (HandleWebHookResult, HandleWebHookWithoutContentResult) are relocated to IFetchFileContentUseCase.ts as FetchedFileContent and FetchFileContentFile so the pipeline still compiles.

  • Removes ~4,200 lines across 45 files: HTTP hooks controller/module, HandleWebHook* use cases, UpdateRecipesFromGitHub/GitLab use cases, handlePushHook implementations in both GithubRepository and GitlabRepository, all webhook type contracts, and the frontend WebHookConfig component.
  • Relocates FetchFileContentFile and FetchedFileContent types from the now-deleted webhook contracts into IFetchFileContentUseCase.ts, maintaining type compatibility across the retained job pipeline.
  • Spec mock objects for IGitRepo are correctly scrubbed of the removed handlePushHook mock in all three affected spec files.

Confidence Score: 5/5

Safe to merge — the removal is thorough and consistent across all layers, and the retained async job pipeline compiles correctly with the relocated types.

Every layer touched by the webhook feature (HTTP endpoints, use cases, repository methods, type contracts, frontend UI, and tests) is removed consistently. The only structural change other than deletion is the relocation of two file-shape types into IFetchFileContentUseCase.ts, which maintains the async pipeline's compile-time contract without altering its runtime behavior. Spec mocks for IGitRepo are correctly updated in all three affected test files. No dead imports, dangling references, or partial removals were found.

No files require special attention. The type relocation in packages/types/src/git/contracts/IFetchFileContentUseCase.ts is the most structurally sensitive change, but it is straightforward and confirmed correct by the passing typecheck.

Important Files Changed

Filename Overview
packages/types/src/git/contracts/IFetchFileContentUseCase.ts Defines standalone FetchFileContentFile and FetchedFileContent types relocated from deleted webhook contracts; types are structurally correct and referenced consistently across the retained job pipeline.
packages/git/src/domain/jobs/FetchFileContent.ts Input/output types updated from HandleWebHookWithoutContentResult/HandleWebHookResult to the new FetchFileContentFile[]/FetchedFileContent[]; structural equivalence preserved.
packages/recipes/src/domain/jobs/UpdateRecipesAndGenerateSummaries.ts files field type updated from HandleWebHookResult to FetchedFileContent[]; pipeline contract remains intact.
apps/api/src/app/app.module.ts HooksModule import and registration removed cleanly; rest of AppModule is unchanged.
packages/git/src/infra/repositories/github/GithubRepository.ts handlePushHook, isValidBranch, isPushEventFromWebhook, and extractMatchingFilesFromCommits removed; non-webhook methods are untouched.
packages/git/src/infra/repositories/gitlab/GitlabRepository.ts handlePushHook, isValidBranch, isPushEventFromWebhook, and extractMatchingFilesFromCommits removed; non-webhook methods are untouched.
packages/git/src/application/adapter/GitAdapter.ts handleWebHook and handleWebHookWithoutContent use case instances and public method delegations removed; adapter otherwise unchanged.
apps/frontend/src/domain/git/components/ManageGitProviderDialog.tsx Webhook tab link and WebHookConfig section removed from the dialog; displayedScreen union type narrowed accordingly.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph REMOVED["❌ Removed"]
        GH_EP["POST /:orgId/hooks/github"]
        GL_EP["POST /:orgId/hooks/gitlab"]
        LIST_EP["GET /:orgId/hooks"]
        HC["HooksController / HooksModule"]
        RS_GH["recipes.service.updateRecipesFromGitHub"]
        RS_GL["recipes.service.updateRecipesFromGitLab"]
        UC_GH["UpdateRecipesFromGitHubUseCase"]
        UC_GL["UpdateRecipesFromGitLabUseCase"]
        BASE_UC["BaseUpdateRecipesFromWebhookUseCase"]
        HWH["HandleWebHookUseCase"]
        HWHWC["HandleWebHookWithoutContentUseCase"]
        PHP_GH["GithubRepository.handlePushHook"]
        PHP_GL["GitlabRepository.handlePushHook"]
        WH_UI["WebHookConfig (frontend)"]
    end

    subgraph KEPT["✅ Kept (async job pipeline)"]
        FFC["FetchFileContent job\n(uses FetchFileContentFile[])"]
        URGS["UpdateRecipesAndGenerateSummaries job\n(uses FetchedFileContent[])"]
        DR["DeployRecipes job"]
    end

    subgraph TYPES["🔄 Type relocation"]
        OLD["HandleWebHookWithoutContentResult\nHandleWebHookResult\n(deleted with webhook contracts)"]
        NEW["FetchFileContentFile\nFetchedFileContent\n(now in IFetchFileContentUseCase.ts)"]
        OLD -->|"relocated as"| NEW
    end

    NEW --> FFC
    FFC --> URGS
    URGS --> DR
Loading

Reviews (5): Last reviewed commit: "style(git): fix prettier formatting in r..." | Re-trigger Greptile

claude added 5 commits June 15, 2026 18:16
Remove the Webhook tab from the Manage Git Provider dialog along with the
WebHookConfig component and the git gateway/query/key plumbing that fetched
webhook URLs from the now-removed GET /:orgId/hooks endpoint.
Delete the hooks controller/module exposing GET /:orgId/hooks and
POST /:orgId/hooks/{github,gitlab}, unregister HooksModule from AppModule,
and drop the recipes.service passthrough methods that fed them.
Delete BaseUpdateRecipesFromWebhookUseCase and the GitHub/GitLab webhook use
cases, drop their wiring from RecipesAdapter, and remove the
updateRecipesFromGitHub/GitLab methods and contracts from IRecipesPort. The
delayed-job pipeline (build/factories) is kept as shared infrastructure.
Delete the handleWebHook/handleWebHookWithoutContent use cases, the
handlePushHook implementations and their webhook-only helpers in the GitHub
and GitLab repositories, the webhook payload types, and the webhook methods
from IGitPort/IGitRepo. The shared file-shape types previously declared in the
webhook contracts are relocated into IFetchFileContentUseCase so the kept
FetchFileContent job pipeline still compiles. Webhook test suites are removed.
Update the addFetchFileContentJob doc comments and the IBaseAdapter example
so they no longer reference the deleted handleWebHook/updateRecipesFromGitHub
symbols.
Comment thread apps/api/src/app/app.module.ts
@cteyton cteyton changed the title Remove webhook contract integration tests Remove the webhook feature (endpoints, git/recipes code, frontend UI, and tests) Jun 15, 2026
@cteyton

cteyton commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

@cteyton

cteyton commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@greptile update your review

Remove trailing blank lines flagged by prettier -c in CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@cteyton cteyton merged commit 1e66eb9 into main Jun 15, 2026
32 of 33 checks passed
@cteyton cteyton deleted the claude/vigilant-keller-vwj3qe branch June 15, 2026 20:12
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 this pull request may close these issues.

2 participants