Skip to content

test: strengthen webhook unit coverage#784

Merged
EffortlessSteven merged 2 commits into
mainfrom
codex/improve-unit-testing-9ly23w
May 17, 2026
Merged

test: strengthen webhook unit coverage#784
EffortlessSteven merged 2 commits into
mainfrom
codex/improve-unit-testing-9ly23w

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Motivation

  • Improve unit test coverage for the webhook fixture crate to catch subtle bugs in HMAC handling, payload canonicalization, and cache identity.
  • Ensure provider-specific signature inputs and negative "near-miss" scenarios are validated across GitHub, Stripe, and Slack profiles.

Description

  • Added new unit tests in crates/uselesskey-webhook/src/lib.rs covering an RFC-style long-key HMAC-SHA256 vector to exercise the key-hashing branch (hmac_sha256_hashes_keys_larger_than_block_size).
  • Added tests that verify WebhookPayloadSpec::Raw payloads are used verbatim for signature inputs for GitHub, Stripe, and Slack (raw_payload_is_used_verbatim_for_signature_inputs).
  • Added deterministic cache identity checks to ensure fixtures are stable for identical (profile, label, payload_spec) and differ when any element changes (fixture_cache_identity_includes_profile_label_and_payload_spec).
  • Added cross-profile negative tests that exercise near-miss scenarios (StaleTimestamp, WrongSecret, TamperedPayload) and verify provider verification rejects them (near_miss_scenarios_are_marked_and_recomputed_for_each_profile).

Testing

  • Ran cargo test -q -p uselesskey-webhook, which completed successfully (16 passed; 0 failed).
  • Ran cargo clippy -q -p uselesskey-webhook --all-targets -- -D warnings, which completed with no lints reported.

Codex Task

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 36 minutes and 52 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a67335eb-2e73-43a4-9c04-f7bd13f8cc7d

📥 Commits

Reviewing files that changed from the base of the PR and between a87e2d4 and c477b63.

📒 Files selected for processing (1)
  • crates/uselesskey-webhook/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/improve-unit-testing-9ly23w

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EffortlessSteven EffortlessSteven merged commit 8fe07bb into main May 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant