feat(app_dart): fall back to ciStaging in GetPresubmitGuard when no guards found#5094
Conversation
…guards found In the Unified Check Run flow, if no modern `UnifiedCheckRun` presubmit guards are found for a commit, retrieve the legacy `ciStaging` documents as a fallback. This will make waiting for check-runs to pass universal. - Implement `CiStaging.getCiStagingForCommitSha` to query staging documents by repository and commit SHA. - Refactor `GetPresubmitGuard` to invoke `_getCiStagingFallback` when no guards are present. - Extract `check_run_id` from the staging `checkRunGuard` JSON, and look up pull request and author metadata via `PrCheckRuns`. - Add unit tests verifying `ciStaging` fallback execution and JSON response structure. - Clean up related linter warnings (redundant imports, type annotations, and curly braces).
There was a problem hiding this comment.
Code Review
This pull request implements a fallback mechanism in GetPresubmitGuard to query CiStaging records when no presubmit guards are found. It introduces the getCiStagingForCommitSha query method, maps task conclusions to statuses, and adds corresponding unit tests. Feedback on the changes suggests removing a redundant ciStagings.isNotEmpty check to simplify the code, and replacing DateTime.parse with DateTime.tryParse to prevent potential crashes from malformed timestamps.
|
autosubmit label was removed for flutter/cocoon/5094, because This PR has not met approval requirements for merging. Changes were requested by {ievdokdm}, please make the needed changes and resubmit this PR.
|
In the Unified Check Run flow, if no modern
UnifiedCheckRunpresubmit guards are found for a commit, retrieve the legacyciStagingdocuments as a fallback. This will make waiting for check-runs to pass universal.CiStaging.getCiStagingForCommitShato query staging documents by repository and commit SHA.GetPresubmitGuardto invoke_getCiStagingFallbackwhen no guards are present.check_run_idfrom the stagingcheckRunGuardJSON, and look up pull request and author metadata viaPrCheckRuns.ciStagingfallback execution and JSON response structure.fixes flutter/flutter#188756
Pre-launch Checklist
///).