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

feat(tkresults): update filters api call #1019

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

abhinandan13jan
Copy link
Contributor

@abhinandan13jan abhinandan13jan commented Nov 5, 2024

Fixes

Please note that the new logs call takes a lot of network time.

Screenshot 2024-11-11 at 7 49 29 PM

https://issues.redhat.com/browse/KFLUXUI-40

Description

Screenshot 2024-11-07 at 3 36 18 PM Screenshot 2024-11-07 at 3 36 28 PM Screenshot 2024-11-07 at 3 37 42 PM Screenshot 2024-11-07 at 3 37 51 PM Screenshot 2024-11-07 at 3 38 44 PM Screenshot 2024-11-05 at 6 42 41 PM

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Screen shots / Gifs for design review

How to test or reproduce?

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 5, 2024
@abhinandan13jan abhinandan13jan changed the title [WIP]feat(tkresults): update filters api call feat(tkresults): update filters api call Nov 6, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 6, 2024
@abhinandan13jan abhinandan13jan force-pushed the update-tekton-results branch 2 times, most recently from 8b82bfc to af6140d Compare November 7, 2024 12:10
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.37%. Comparing base (44f9653) to head (6fcc21b).
Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
...ntractView/useEnterpriseContractResultFromLogs.tsx 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1019      +/-   ##
==========================================
+ Coverage   85.01%   85.37%   +0.36%     
==========================================
  Files         582      582              
  Lines       14332    14356      +24     
  Branches     4010     4020      +10     
==========================================
+ Hits        12184    12257      +73     
+ Misses       2021     1972      -49     
  Partials      127      127              
Files with missing lines Coverage Δ
...riseContractView/SecurityEnterpriseContractTab.tsx 85.00% <ø> (ø)
...mponents/TaskRunDetailsView/TaskRunDetailsView.tsx 96.15% <100.00%> (+0.50%) ⬆️
src/hooks/useTektonResults.ts 95.71% <100.00%> (-2.75%) ⬇️
...onents/pipeline-run-logs/logs/TektonTaskRunLog.tsx 100.00% <100.00%> (ø)
...ed/components/pipeline-run-logs/logs/logs-utils.ts 78.16% <100.00%> (+42.35%) ⬆️
src/utils/tekton-results.ts 98.54% <100.00%> (+0.01%) ⬆️
...ntractView/useEnterpriseContractResultFromLogs.tsx 93.06% <80.00%> (-0.69%) ⬇️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44f9653...6fcc21b. Read the comment docs.

---- 🚨 Try these New Features:

const getPipelineRunsMock = getPipelineRuns as jest.Mock;
const getTaskRunsMock = getTaskRuns as jest.Mock;
const getTaskRunLogMock = getTaskRunLog as jest.Mock;
// const getTaskRunLogMock = getTaskRunLog as jest.Mock;
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this meant to be left commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya, will remove this

> = ({ pipelineRun }) => {
const [ecResult, ecResultLoaded] = useEnterpriseContractResults(pipelineRun);
React.PropsWithChildren<{
pipelineRunName: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to pass the full pipeline run object here rather than the metadata values?

I have no objections with either strategy, I was just wondering if there was a reason why we extract the values, then pass to the component instead of passing the full object and minimizing the props.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I dont think we should use the full pipeline as a prop as any change in any unrelated portion of the pipeline i.e pipeline.spec or pipeline.status will trigger a re-render of the component.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point! Thank you

Copy link
Contributor

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

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

Can you access pipeline run uid and name from the the task run owner reference?

@@ -333,19 +340,29 @@ export const getTaskRuns = (
const getLog = (workspace: string, taskRunPath: string) =>
commonFetchText(`${getTRUrlPrefix(workspace)}/${taskRunPath.replace('/records/', '/logs/')}`);

export const getTaskRunLog = (
export const getTaskRunLogOld = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this?

) =>
commonFetchText(
`${getTRUrlPrefix(workspace)}/${namespace}/results/${pid}/logs/${taskRun?.metadata?.uid}`,
).catch(() => getTaskRunLogOld(workspace, namespace, taskRun.metadata.name));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you using getTaskRunLogOld?
If it fails to fetch we should just throw error and surface in UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Contributor

openshift-ci bot commented Nov 12, 2024

@abhinandan13jan: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@abhinandan13jan
Copy link
Contributor Author

/retest

@CryptoRodeo
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 18, 2024
Copy link
Contributor

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

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

/approve

Copy link
Contributor

openshift-ci bot commented Nov 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinandan13jan, sahil143

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants