Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent download of empty files in Pipeline Logs #2229

Conversation

manaswinidas
Copy link
Contributor

@manaswinidas manaswinidas commented Nov 24, 2023

JIRA: RHOAIENG-259

Description

This PR :

GIF for raw logs:

Screen.Recording.2023-11-30.at.7.35.07.PM.mov

Screenshots for view raw logs and disabled and enabled states of both Raw logs and Download button:

Enabled state:

Screenshot 2023-11-30 at 7 36 07 PM

Disabled:
Screenshot 2023-11-30 at 7 50 23 PM

Small screen:
Screenshot 2023-11-30 at 8 06 31 PM

How Has This Been Tested?

  1. Run any pipeline
  2. Go to the Logs tab
  3. Go to any node that has completed execution but has no logs
  4. Check that you see "No logs available" and the "Download" button is disabled

Test Impact

Added tests to check whether the drawer opens on clicking the node of a pipeline run

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Commits have been squashed into descriptive, self-contained units of work (e.g. 'WIP' and 'Implements feedback' style messages have been removed)
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit tests & storybook for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change (find relevant UX in the SMEs section).

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@openshift-ci openshift-ci bot requested review from pnaik1 and ppadti November 24, 2023 17:55
@manaswinidas manaswinidas linked an issue Nov 27, 2023 that may be closed by this pull request
1 task
@manaswinidas manaswinidas force-pushed the prevent-empty-download branch 4 times, most recently from 2d7713a to 26570ac Compare November 30, 2023 14:46
@openshift-merge-robot openshift-merge-robot added the needs-rebase PR needs to be rebased label Dec 9, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase PR needs to be rebased label Dec 11, 2023
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

The download all step logs link button in the alert should also be disabled when the file is empty. Otherwise, I can still download empty files.

Screenshot 2023-12-11 at 3 23 32 PM

@manaswinidas
Copy link
Contributor Author

@DaoDaoNoCode Oh yes, I missed this. Thanks for pointing this out. Added now.
Screenshot 2023-12-12 at 8 26 04 PM

Copy link
Contributor

@dpanshug dpanshug left a comment

Choose a reason for hiding this comment

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

Disabling the download all step logs should not depend on the selected step.

When selected step with logs, the button is enabled.

Screenshot from 2023-12-18 12-46-15

When selected step without logs, the button gets disabled.

Screenshot from 2023-12-18 12-46-27

the link button should be enabled for all steps, if one step has a log

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

Code lgtm, needs to run through it tomorrow to test. My internet is still down now for the whole afternoon so I got very limited internet access.

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

Tested, works fine.
/lgtm

@@ -121,6 +115,7 @@ const LogsTabForPodName: React.FC<{ podName: string }> = ({ podName }) => {
<LogsTabStatus
loaded={loaded}
error={error}
isLogsAvailable={podContainers.length !== 1 && logs !== ''}
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode Dec 20, 2023

Choose a reason for hiding this comment

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

I feel the logic is not correct here... if you simply do !(podContainers.length === 1 && !logs) you will get podContainers.length !== 1 || !!logs

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

openshift-ci bot commented Jan 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: DaoDaoNoCode

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@DaoDaoNoCode DaoDaoNoCode dismissed dpanshug’s stale review January 2, 2024 15:23

The request changes have been addressed

@openshift-merge-bot openshift-merge-bot bot merged commit ffa7afd into opendatahub-io:f/pipelines-enhancement Jan 2, 2024
4 checks passed
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.

[Bug]: Prevent downloading empty files
6 participants