fix(cssc): 31646926 fix 'list' command filtering by '--run-status'#40
Merged
cegraybl merged 10 commits intoMar 21, 2025
Merged
Conversation
… selection of status
…rked as skipped counts as successful, but just filtering skipped return nothing
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the filtering logic on the "list" command by updating how image statuses are determined based on both the scan and patch tasks. It consolidates changes in workflow status filtering, updates test cases (including renaming and parameter adjustments), and refines the retrieval and filtering of task logs to better reflect the intended behavior.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/acrcssc/azext_acrcssc/tests/latest/test_workflow_status.py | Renames a test function and updates task generation parameters to better simulate patch task behavior. |
| src/acrcssc/azext_acrcssc/helper/_workflow_status.py | Introduces a new workflow_status_filter parameter and adds a filtering function for taskruns. |
| src/acrcssc/azext_acrcssc/helper/_taskoperations.py | Adjusts the call to from_taskrun to pass workflow_status_filter for consistent filtering. |
| src/acrcssc/azext_acrcssc/tests/latest/test_helper_taskoperations.py | Updates mock dependencies to support changes in task retrieval and filtering. |
Comments suppressed due to low confidence (1)
src/acrcssc/azext_acrcssc/helper/_workflow_status.py:345
- The filtering condition for non-SKIPPED statuses relies solely on workflow.status() (which returns the run_status) rather than checking both the scan_status and patch_status. Consider updating this condition so that it properly filters workflows based on whether either scan_status or patch_status matches the intended filter.
for key, workflow in workflows.items() if workflow.status() == workflow_status_filter
huanwu
approved these changes
Mar 21, 2025
cegraybl
added a commit
that referenced
this pull request
Apr 23, 2025
Fix filtering on the `list` command by `--run-status` to make it correct once again. Now the `--run-status` will filter the image status depending on the final status of both the scan and patch instead of only one of them. Meaning that for an image to be marked as `FAILED` scan or patch have to be `FAILED`, for an image to be marked as `SUCCEEDED` both scan and patch have to be `SUCCEEDED` or `SKIPPED` as that is treated as a successful execution, and for an image to be marked as `SKIPPED` the scan has to be `SUCCEEDED` and the patch has to be `SKIPPED`. This PR also includes a unit test to catch issues with the filtering. In addition, includes fixes for unit tests that are run without azure credentials, adding the required mocks to avoid that dependency.
cegraybl
added a commit
that referenced
this pull request
Apr 24, 2025
Fix filtering on the `list` command by `--run-status` to make it correct once again. Now the `--run-status` will filter the image status depending on the final status of both the scan and patch instead of only one of them. Meaning that for an image to be marked as `FAILED` scan or patch have to be `FAILED`, for an image to be marked as `SUCCEEDED` both scan and patch have to be `SUCCEEDED` or `SKIPPED` as that is treated as a successful execution, and for an image to be marked as `SKIPPED` the scan has to be `SUCCEEDED` and the patch has to be `SKIPPED`. This PR also includes a unit test to catch issues with the filtering. In addition, includes fixes for unit tests that are run without azure credentials, adding the required mocks to avoid that dependency.
mabelegba
pushed a commit
that referenced
this pull request
Nov 25, 2025
* Upstream Merge * Merge from workload-orchestration : Added Example in Description (#34) * Merge from workload-orchestration : Fixed Example * Fixed Example for SolutionTemplateVersion * Made Changes for command-change CI fix' * Reset Version 1.0.0b1 * Added Bulk and Diagnostics Back (#35) Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Added Bulk Solution Example (#36) * Added Bulk and Diagnostics Back * Changes --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Fixed Solution Template Linter Issue * Added Integration Tests Framework for WorkloadOrchestration #37 Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Added ServiceName (#38) * Added Tests * Made Changes on ServiceName --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Added Full Target Solution Tests (#39) * Added Tests * Made Changes on ServiceName * Nit Changes * Made Changes for ContextLookup --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Added E2E workflow Tests (#40) * Added Tests * Made Changes on ServiceName * Nit Changes * Made Changes for ContextLookup * Added complete workflow * Add Licence * Added License --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Added Readme (#41) Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Bulk Deployemnent LRO changes (#42) * made changes * Added change * Added Changes in Test * Added CLi Changes * Added Setup --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Added Changes For Backward Compitablity (#43) * Added Changes For Backward Compitablity * Made changes --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Made changes (#44) Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Target Operations API refractoring (#47) * Changes I made * Make changes * Made chnages * Make changes --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Stable API 2025-06-01 (#48) * Made changes * Made Changes --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Change in ID in Targets (#50) * Made changes * changes --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Remove Id and Name from Target Review (#51) Co-authored-by: Atharva Udapure <audapure@microsoft.com> * final bulk (#52) Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Changes in ARG * Added Linter Exception * Added ITTests (#53) Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Standardize CLI (#54) * Made Changes * Made Changes * Made changes * Added Change * Made changes * Made changes * Made changes * Made Changes --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Linter FIxes and Remove Preview * Removed Resolved from CLI * change in version * made changes (#55) Co-authored-by: Atharva Udapure <audapure@microsoft.com> * Fixed history --------- Co-authored-by: Atharva Udapure <audapure@microsoft.com>
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.
Fix filtering on the
listcommand by--run-statusto make it correct once again.Now the
--run-statuswill filter the image status depending on the final status of both the scan and patch instead of only one of them. Meaning that for an image to be marked asFAILEDscan or patch have to beFAILED, for an image to be marked asSUCCEEDEDboth scan and patch have to beSUCCEEDEDorSKIPPEDas that is treated as a successful execution, and for an image to be marked asSKIPPEDthe scan has to beSUCCEEDEDand the patch has to beSKIPPED.This PR also includes a unit test to catch issues with the filtering.
In addition, includes fixes for unit tests that are run without azure credentials, adding the required mocks to avoid that dependency.
Some example output: