Skip to content

fix(cssc): 31694510, 31694600 Check for existence of cssc tasks before calling list command + enhance log message#32

Merged
Ruchii-27 merged 2 commits into
feature/cssc_extfrom
ruchi/DisplayImagesListedForLastNDays
Mar 11, 2025
Merged

fix(cssc): 31694510, 31694600 Check for existence of cssc tasks before calling list command + enhance log message#32
Ruchii-27 merged 2 commits into
feature/cssc_extfrom
ruchi/DisplayImagesListedForLastNDays

Conversation

@Ruchii-27
Copy link
Copy Markdown

@Ruchii-27 Ruchii-27 commented Mar 11, 2025

This PR adds a check to ensure that the cssc tasks exist before calling the list command. It also displays that the list command is executed for the last n days. Updated tests as well.

With this, below 2 bugs are addressed:

  1. https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31694510/?view=edit
    Before Fix:
    image
    After Fix:
    image

  2. https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31694600/?view=edit
    After Fix: added a line to indicate list executed for last n days:
    image

…aying list command for last n days + test updates
@Ruchii-27 Ruchii-27 requested review from cegraybl and huanwu March 11, 2025 02:14
@cegraybl cegraybl requested a review from Copilot March 11, 2025 16:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that CSSC tasks are verified before calling the list command and enhances the log messages to provide clearer output on the operations performed. Key changes include:

  • Adding a check for CSSC tasks in the track_scan_progress function.
  • Enhancing user output by printing the execution details for the last n days.
  • Updating tests to mock the new check and verify the improved functionality.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/acrcssc/azext_acrcssc/helper/_taskoperations.py Adds CSSC task existence check and prints additional log messages
src/acrcssc/azext_acrcssc/cssc.py Removes redundant print statements and simplifies return of task progress
src/acrcssc/azext_acrcssc/tests/latest/test_helper_taskoperations.py Updates tests to accommodate changes in track_scan_progress


cssc_tasks_exists, _ = check_continuous_task_exists(cmd, registry)
if not cssc_tasks_exists:
logger.warning(f"{CONTINUOUS_PATCHING_WORKFLOW_NAME} workflow task does not exist. Run 'az acr supply-chain workflow create' to create workflow tasks")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the error/warning message is now used in multiple places, I think we should add it as a constant

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now addressed.

@Ruchii-27 Ruchii-27 merged commit 9deef45 into feature/cssc_ext Mar 11, 2025
Copy link
Copy Markdown

@huanwu huanwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cegraybl cegraybl deleted the ruchi/DisplayImagesListedForLastNDays branch April 23, 2025 17:33
cegraybl pushed a commit that referenced this pull request Apr 23, 2025
…e calling list command + enhance log message (#32)

This PR adds a check to ensure that the cssc tasks exist before calling
the list command. It also displays that the list command is executed for
the last n days. Updated tests as well.

With this, below 2 bugs are addressed:
1.
https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31694510/?view=edit
Before Fix: 

![image](https://github.com/user-attachments/assets/61ced20f-d8c4-42d6-bc8d-67e3ae299ed1)
After Fix:

![image](https://github.com/user-attachments/assets/807745a3-71f5-471c-89b5-62161fbd3fd1)

2.
https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31694600/?view=edit
After Fix: added a line to indicate list executed for last n days:

![image](https://github.com/user-attachments/assets/fe832467-d337-4f18-a2c7-f713452e5c3a)

---------

Co-authored-by: Ruchi Maheshwari <rumahe@microsoft.com>
cegraybl pushed a commit that referenced this pull request Apr 24, 2025
…e calling list command + enhance log message (#32)

This PR adds a check to ensure that the cssc tasks exist before calling
the list command. It also displays that the list command is executed for
the last n days. Updated tests as well.

With this, below 2 bugs are addressed:
1.
https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31694510/?view=edit
Before Fix: 

![image](https://github.com/user-attachments/assets/61ced20f-d8c4-42d6-bc8d-67e3ae299ed1)
After Fix:

![image](https://github.com/user-attachments/assets/807745a3-71f5-471c-89b5-62161fbd3fd1)

2.
https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31694600/?view=edit
After Fix: added a line to indicate list executed for last n days:

![image](https://github.com/user-attachments/assets/fe832467-d337-4f18-a2c7-f713452e5c3a)

---------

Co-authored-by: Ruchi Maheshwari <rumahe@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants