fix(cicd): fix aggregate commands, add --level to events search#526
Merged
platinummonkey merged 1 commit intoMay 26, 2026
Merged
Conversation
pup cicd events aggregate and pup cicd tests aggregate were silently calling the search API instead of the aggregate API, and the compute/ group_by/limit args defined in the CLI enum were dropped with `..` and never passed through. This meant aggregation returned search hits rather than bucketed counts/averages, making the feature unusable. - Fix events_aggregate and tests_aggregate to call the correct aggregate_ci_app_pipeline_events / aggregate_ci_app_test_events APIs - Add --level flag to pup cicd events search (pipeline/stage/job/step) for granularity filtering, consistent with the MCP software-delivery skill that uses ci_level for unblock-pr workflows - Replace hand-rolled parse_ci_aggregation_function with util::parse_compute_raw, matching the established pattern from traces.rs / logs.rs; compute now accepts avg(@duration), percentile(@duration, 95) etc. — no separate --metric flag needed - Simplify time parsing across all cicd functions using the existing util::parse_time_to_datetime().to_rfc3339() instead of the 6-line manual timestamp-millis conversion block - Fix agents/cicd.md: correct pup cicd tests flaky → pup cicd flaky-tests search, pipeline search → pup cicd events search, add test-optimization settings/policies/flaky-test-update commands - Add CI/CD quick-reference rows to skills/dd-pup/SKILL.md Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
platinummonkey
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two silent bugs where
pup cicd events aggregateandpup cicd tests aggregatecalled the search API instead of the aggregate API, making those commands return search hits rather than bucketed counts/averages. Also adds--leveltopup cicd events searchfor job/stage/step granularity filtering.Changes
src/commands/cicd.rs: Fixevents_aggregateandtests_aggregateto callaggregate_ci_app_pipeline_events/aggregate_ci_app_test_events— previously both called the search API silentlysrc/commands/cicd.rs: Wirecompute,group_by,limitargs that were previously dropped with..in both aggregate match arms (src/main.rs)src/commands/cicd.rs: Add--levelparam toevents_search(pipeline/stage/job/step); injects@ci.level:<value>filter into querysrc/commands/cicd.rs: Replace hand-rolled aggregation function parser withutil::parse_compute_rawpattern fromtraces.rs; compute now usesavg(@duration)/percentile(@duration, 95)syntax — removes the need for a separate--metricflagsrc/commands/cicd.rs: Simplify 6-line time-parsing boilerplate in 4 functions →util::parse_time_to_datetime().to_rfc3339()(already used intests_list)src/commands/cicd.rs: Extractbuild_ci_compute_specshared helper used by both aggregate functionssrc/main.rs: Change aggregatelimitfromi32toi64to match the API type directlyagents/cicd.md: Fixpup cicd tests flaky→pup cicd flaky-tests search; fix pipeline search/aggregate →pup cicd events search/aggregate; add test-optimization settings/policies/flaky-test-update commandsskills/dd-pup/SKILL.md: Add CI/CD quick-reference rowsTesting
test_cicd_events_aggregate,test_cicd_tests_aggregate,test_cicd_events_search_invalid_level,test_cicd_events_aggregate_invalid_compute,test_cicd_tests_aggregate_invalid_computecargo clippy -- -D warningscleancargo fmt --checkclean🤖 Generated with Claude Code