Skip to content

ROX-29253: Adjusting partial report logic#15449

Merged
sachaudh merged 1 commit intomasterfrom
ROX-29253
May 28, 2025
Merged

ROX-29253: Adjusting partial report logic#15449
sachaudh merged 1 commit intomasterfrom
ROX-29253

Conversation

@sachaudh
Copy link
Contributor

Description

This PR makes some adjustments to the partial reporting feature. We've split PARTIAL_ERROR into PARTIAL_SCAN_ERROR_DOWNLOAD and PARTIAL_SCAN_ERROR_EMAIL.

Note: I'll add a follow-up PR to refactor the labels we use for the report jobs according to what Mansur recommended in the last UI/UX meeting. Attached a screenshot of what we intend to change it to:

image

Screenshots

Screenshot 2025-05-27 at 10 55 00 AM Screenshot 2025-05-27 at 10 55 06 AM Screenshot 2025-05-27 at 10 56 04 AM Screenshot 2025-05-27 at 10 56 26 AM Screenshot 2025-05-27 at 10 55 15 AM

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

@sachaudh sachaudh requested review from bradr5, dvail and pedrottimark May 27, 2025 18:09
@sachaudh sachaudh requested a review from a team as a code owner May 27, 2025 18:09
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sachaudh - I've reviewed your changes - here's some feedback:

  • Ensure you still handle the legacy PARTIAL_ERROR runState (or provide a migration) so existing reports don’t break until the API moves to the two new states.
  • In PartialReportModal, when used for email (no onDownload), consider adding an explicit “OK” or close button in the modal actions so users have a clear way to dismiss it.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@rhacs-bot
Copy link
Contributor

rhacs-bot commented May 27, 2025

Images are ready for the commit at 32a0ca5.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.8.x-823-g32a0ca54db.

@codecov
Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.23%. Comparing base (92e5d0b) to head (32a0ca5).
Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #15449      +/-   ##
==========================================
- Coverage   49.24%   49.23%   -0.02%     
==========================================
  Files        2578     2578              
  Lines      189182   189182              
==========================================
- Hits        93161    93142      -19     
- Misses      88686    88700      +14     
- Partials     7335     7340       +5     
Flag Coverage Δ
go-unit-tests 49.23% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@dvail dvail left a comment

Choose a reason for hiding this comment

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

LGTM. Regarding the bot comments:

Ensure you still handle the legacy PARTIAL_ERROR runState (or provide a migration) so existing reports don’t break until the API moves to the two new states.

This is a good catch, but we only need to take action if this wasn't done on the BE. Do you know if the API has changed so that PARTIAL_ERROR will never be a valid response to the UI?

In PartialReportModal, when used for email (no onDownload), consider adding an explicit “OK” or close button in the modal actions so users have a clear way to dismiss it.

This is a good idea too, it would be nice to have an explicit "Close" button in these modals for clarity. I see the download modals use "Cancel" - would "Close" be appropriate in both cases?

I checked the PF design guidelines and I couldn't find any example of a modal that didn't have a confirmation and a cancellation button 🤔 , although I'm sure this pattern is something we have replicated throughout the UI.

@sachaudh
Copy link
Contributor Author

sachaudh commented May 28, 2025

This is a good catch, but we only need to take action if this wasn't done on the BE. Do you know if the API has changed so that PARTIAL_ERROR will never be a valid response to the UI?

PARTIAL_ERROR isn't going to be a type anymore. We were planning to have that as the type until Luis found a need to split it up. So we don't have to do anything here.

This is a good idea too, it would be nice to have an explicit "Close" button in these modals for clarity. I see the download modals use "Cancel" - would "Close" be appropriate in both cases?

I checked the PF design guidelines and I couldn't find any example of a modal that didn't have a confirmation and a cancellation button 🤔 , although I'm sure this pattern is something we have replicated throughout the UI.

Ah, yeah nice catch. In my opinion, it makes sense to have Cancel if we're in some mutation flow (creating, editing, cloning, etc.). For displaying something, especially in a modal, it probably makes more sense to say Close. If we display an X I wonder if it's even necessary to show a Close.

Looking at the code, I see some places we do show Close but other places we show Cancel. Might be a good idea for us to standardize on when we should use each.

@sachaudh
Copy link
Contributor Author

sachaudh commented May 28, 2025

I'm going to be smart about the change. I have two PRs branching off this one. I need to make a change to the last one anyways, so i'm going to make the fix there. That way I can just merge this and not go through a full CI run again.

@sachaudh sachaudh merged commit 14e8fe1 into master May 28, 2025
90 checks passed
@sachaudh sachaudh deleted the ROX-29253 branch May 28, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants