Show progress status and pipeline error states
Description
Improves UI States for Security Reports. I was able to provide screenshots for some of the cases. The others, are tested with unit tests as they only change the text copy. They are harder to test since we poll every 30 seconds. Some of the intermediate states happen too fast between polls, but I will try to add screenshots. (The Parsing) state won't be reproducible in smaller projects since it parses quicker than our polling interval. Polling interval that we use for vs-code to fetch all the MR and branch data.
Implementation Info
- This refactor takes
export type GqlSecurityFindingReport = GetSecurityFindingsReportQuery['project']['mergeRequest']['findingReportsComparer']['report'];
and goes up one level to expose thestatus
field infindingReportsComparer
. The change is propagated in all usages. - Secondary to that, we added additional security report states derived from both the pipelines status AND the reports comparer statuses.
- Possible states defined in the unit tests.
Related Issues
Resolves gitlab#425357 (closed)
How has this been tested?
-
Check out the branch in this MR 425357-add-in-progress-status
for the gitlab-vscode-extension -
Clone the https://gitlab.com/gitlab-org/frontend/playground/gitlab-mr-widgets-demo project locally -
Branch off of the test branch main-patch-cf9d
from thegitlab-mr-widgets-demo project
project -
Push up main-patch-cf9d-branched
to the origin. -
Create a MR to merge main-patch-cf9d-branched
to main -
Open in vs-code the the gitlab-mr-widgets-demo project
, verify the current checked out branch ismain-patch-cf9d-branched
-
Open the gitlab extension and observe the UI going through state changes as the pipeline runs and completes
Local testing tips
-
To view the parsing state you want to artificially change https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/c69892784408f3bd2e05f74056e0d70fb209a032/src/desktop/current_branch_refresher.ts#L120 to poll ever 2 seconds instead of 30 seconds. On a small project you won't see the parsing state because it happens in a few seconds.
Screenshots (if appropriate):
Status | Screenshot |
---|---|
No Scan Results (no MR) | |
No scan results (after pipeline fun) | |
In Progress | |
Parsing | |
Completed | |
Pipeline Canceled |
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Edited by Fernando Cardenas