Skip to content

fix(webhook): preview test endpoints without sending (#900) - #941

Merged
jeff-r2026 merged 2 commits into
Tencent:mainfrom
ydflow:fix/webhook-test-dry-run
Oct 1, 2026
Merged

jeff-r2026 merged 2 commits into
Tencent:mainfrom
ydflow:fix/webhook-test-dry-run

Conversation

@ydflow

@ydflow ydflow commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

teamai webhook test --dry-run currently sends HTTP requests because the command does not forward the global preview flag. Forward that flag, load configuration without persisting migrations during a preview, and report the number of matching endpoints before returning without sending.

The review follow-up handles dry-run before the empty-endpoint warning, so an unmatched --url or an empty endpoint list previews 0 targets. The normal sending path is unchanged.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Test Plan

  • npm run build
  • npm run typecheck
  • npm run lint
  • npx vitest run src/__tests__/webhook.test.ts — 20 passed, including matching, unmatched-URL, and empty-list previews with no fetch calls
  • npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/webhook-test-dry-run.test.ts — 2 passed; runs dist/index.js with both a configured unreachable endpoint and an unmatched --url, checks the preview counts (1 and 0), and verifies the local config remains byte-for-byte unchanged

The new zero-endpoint unit cases and unmatched-URL real-CLI case failed before the review fix and passed after rebuilding with the fix.

The full unit suite on the same upstream baseline was attempted locally on Windows but encountered POSIX file-mode expectations, shell differences, file locks, and timeouts in other modules. The full-suite result needs upstream CI.

Related Issues

Refs #900 (webhook test row).

@jeff-r2026 jeff-r2026 self-assigned this Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
  • [P2 non-blocking] src/webhook.ts:167 — With configured endpoints, teamai webhook test --dry-run --url <unmatched-url> reports “No webhook endpoints configured” instead of previewing 0 matching endpoints. Handle dry-run before this early return or distinguish “no configured endpoints” from “no URL match.”

The PR description includes a sufficient representative real-CLI verification record.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

No findings.

  • Earlier [P2 non-blocking] zero-match preview issue is resolved: dry-run now reports 0 endpoints before the empty-endpoint warning path.
  • The PR description includes sufficient representative real-CLI verification for this runtime behavior change.

@jeff-r2026
jeff-r2026 merged commit 6db9144 into Tencent:main Oct 1, 2026
13 checks passed
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