feat: add suite_status filter for cloud drift tests#210
Merged
sohil-kshirsagar merged 2 commits intomainfrom Mar 25, 2026
Merged
feat: add suite_status filter for cloud drift tests#210sohil-kshirsagar merged 2 commits intomainfrom
sohil-kshirsagar merged 2 commits intomainfrom
Conversation
Add a suite_status filter field that allows users to fetch and run draft tests from the cloud without going through validation mode. When --filter suite_status=draft is set, the CLI bypasses the cache and passes the status filter directly to GetAllTraceTests on the backend. This works for both `drift run` and `drift list`. Also bumps tusk-drift-schemas to v0.1.32 for the new status_filter field on GetAllTraceTestsRequest.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Contributor
There was a problem hiding this comment.
2 issues found across 12 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/runner/filter.go">
<violation number="1" location="internal/runner/filter.go:160">
P1: `ParseTraceTestStatusFilter` normalizes to lowercase via `strings.ToLower` for the backend fetch, but the same user-provided value (e.g., `DRAFT`) is kept as-is in the filter string passed to `FilterTests`. Since `SuiteStatus` on the `Test` struct is always lowercase (`"draft"`, `"in_suite"` from `protoTraceTestStatusToString`), and Go regex is case-sensitive, a filter like `suite_status=DRAFT` will correctly fetch draft tests from the server but then filter them all out on the client side, returning zero results.
Either normalize the `suite_status` filter value to lowercase before client-side filtering, or use a case-insensitive regex (e.g., `(?i)` prefix) for the `suite_status` field.</violation>
</file>
<file name="cmd/list.go">
<violation number="1" location="cmd/list.go:99">
P2: `suite_status` regex values silently fall back to the cache path, which only returns IN_SUITE tests, so valid filter forms (for example `suite_status=^draft$`) can miss draft tests.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Convert if-else chain to switch in loadCloudTests (gocritic lint). Make suite_status filter case-insensitive so that suite_status=DRAFT correctly matches the lowercase "draft" value on tests after the server-side fetch. Without this, uppercase filter values would fetch the right tests from the backend but then filter them all out client-side.
jy-tan
approved these changes
Mar 25, 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.

Add a
suite_statusfilter that lets users fetch and run cloud tests by their suite status (draft or in_suite), e.g.tusk drift run --cloud -f 'suite_status=draft'.Why
Today, draft tests are only fetchable through the validation endpoint. There's no way to run just draft tests to sanity-check them before they get promoted to the suite. This unblocks that workflow without requiring
--validate-suite.How it works
When the CLI detects
suite_status=in the filter, it pre-parses the value and passes it asstatus_filterto the backend'sGetAllTraceTestsendpoint (new field from drift-schemas v0.1.32). This bypasses the ID-based cache path since that only fetches IN_SUITE test IDs. When no suite_status filter is set, behavior is unchanged.Dependencies
status_filtertoGetAllTraceTestsRequesttusk-drift-schemas#45)