Skip to content

fix(cicd): always include data key in flaky-tests search request body#151

Merged
platinummonkey merged 1 commit intomainfrom
fix/cicd-flaky-tests-search-empty-body
Mar 3, 2026
Merged

fix(cicd): always include data key in flaky-tests search request body#151
platinummonkey merged 1 commit intomainfrom
fix/cicd-flaky-tests-search-empty-body

Conversation

@platinummonkey
Copy link
Collaborator

Summary

When pup cicd flaky-tests search is run with no --query, the code sent an empty {} body that the API rejected with a 400 error. Fix by always constructing the data object with the required type field, adding the filter only when a query is supplied.

Changes

  • src/commands/cicd.rs:477 — restructured flaky_tests_search (non-wasm32) to always build FlakyTestsSearchRequestData with type_ set; filter is added only when query is Some
  • src/commands/cicd.rs:501 — same fix for the wasm32 path using serde_json

Testing

  • cargo build compiles cleanly
  • cargo clippy -- -D warnings passes with no warnings
  • cargo test passes all 342 tests

Related Issues

Closes #150


🤖 Generated with Claude Code

When no --query is provided, the code sent an empty {} body that the API
rejected with 400 "document is missing required top-level members; must
have one of: data, meta, errors".

Fix by always constructing FlakyTestsSearchRequestData with the required
type field, adding the filter only when a query is supplied. The wasm32
path is fixed the same way.

Closes #150

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@platinummonkey platinummonkey merged commit 75c8a3e into main Mar 3, 2026
6 checks passed
@platinummonkey platinummonkey deleted the fix/cicd-flaky-tests-search-empty-body branch March 3, 2026 23:54
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.

bug: cicd flaky-tests search sends invalid body with no query

1 participant