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

fix(KFLUXUI-253): tekton results should filter deleted record out #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

testcara
Copy link
Contributor

@testcara testcara commented Dec 13, 2024

Fixes

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

Description

When we delete one pipeline task run manually before it is completed,UI should not always keep the obsoleted run there. This patch would ignore the meaningless unknown tekton results to ensure there is no deleted but 'in process' runs on UI.

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

Without the patch, the UI would list deleted 'running' pipelineruns.
Screenshot 2024-12-16 at 15 03 19
With the patch, the UI would ignore the deleted 'running' pipelineruns.
Screenshot 2024-12-16 at 15 05 12

How to test or reproduce?

  1. Navigate to 'Activity' of one component.
  2. Rerun some jobs and delete it by oc
  3. Refresh the page, the running ones would be not shown

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@testcara testcara force-pushed the KFLUXUI-253 branch 2 times, most recently from 6cf087c to cfa1ecd Compare December 14, 2024 02:12
@testcara
Copy link
Contributor Author

/retest

@testcara testcara changed the title WIP: fix(KFLUXUI-253): tekton results should filter unknown status record out fix(KFLUXUI-253): tekton results should filter unknown status record out Dec 14, 2024
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.06%. Comparing base (591f649) to head (0a173dc).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/tekton-results.ts 33.33% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (33.33%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
- Coverage   80.10%   80.06%   -0.05%     
==========================================
  Files         577      544      -33     
  Lines       21495    21159     -336     
  Branches     5064     5317     +253     
==========================================
- Hits        17219    16941     -278     
+ Misses       4252     4193      -59     
- Partials       24       25       +1     
Flag Coverage Δ
unittests 80.06% <33.33%> (-0.05%) ⬇️

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

Files with missing lines Coverage Δ
src/utils/tekton-results.ts 95.10% <33.33%> (+0.10%) ⬆️

... and 34 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 591f649...0a173dc. Read the comment docs.

@testcara testcara force-pushed the KFLUXUI-253 branch 3 times, most recently from 0b59a41 to 7c5062b Compare December 16, 2024 10:38
Comment on lines 306 to 342
// When pipelines are running, the etcd would keep their results.
// deleting pipelines frome ectd would make unknown tekton results.
// Just to get meaningful test runs, we need to filter 'unknown' out.
const filteredPipelineRuns = originalPipelineRuns.filter((pipelinerun) => {
return pipelinerun.status?.conditions?.every((c) => c.status !== 'Unknown') ?? true;
});
return [filteredPipelineRuns, list];
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible that an unknown status will appear for the pipeline runs that were not deleted? In that case, It's not a good idea to filter out the Unknown status pipeline runs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you specify why it is not good idea?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just improved the filter condition to ensure it is more accurate and added more explanations. Could you help to review again? Thank you!

@testcara testcara changed the title fix(KFLUXUI-253): tekton results should filter unknown status record out fix(KFLUXUI-253): tekton results should filter deleted record out Jan 9, 2025
CryptoRodeo
CryptoRodeo previously approved these changes Jan 27, 2025
Comment on lines 320 to 342
const filteredPipelineRuns = originalPipelineRuns.filter((pipelinerun) => {
return (
pipelinerun.status?.conditions?.every(
(c) => !(c.status === 'Unknown' && c.type === 'Succeeded' && c.reason === 'Running'),
) ?? true
);
});
return [filteredPipelineRuns, list];
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not a good idea to just filter out the Unknown status because When a pipeline run is running, its Condition Succeeded status is initially unknown. If the pipeline is deleted while in this state, it is archived to Tekton results with the same 'unknown' status. So we will end up filtering out the Running pipelines also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the regular running pipeline, it would be shown running well. see the screenshot:
Screenshot 2025-02-04 at 10 57 10
We will not filter out regular running pipelines. You could try to rerun one test run like https://localhost:8080/workspaces/wlin-tenant/applications/test-unstopped-pipeline/pipelineruns/test-28bg4 to check the whole process.

The filter will not affect any regular process.
Just when we delete the running pipeline, the pipeline would be gone and this is the expected behavior.

BTW, do you have better idea, if you would give more suggestion, let me do more improvement with better solution.
Is it possible we ask other team to add some item in the general status of the pipeline?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Make sense, only Tekton results are being filtered here. can you add a few test cases for this with running status condition and other status condition.

const filteredPipelineRuns = originalPipelineRuns.filter((pipelinerun) => {
return (
pipelinerun.status?.conditions?.every(
(c) => !(c.status === 'Unknown' && c.type === 'Succeeded' && c.reason === 'Running'),
Copy link
Contributor

Choose a reason for hiding this comment

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

do not we have enum for this?

Comment on lines 320 to 342
const filteredPipelineRuns = originalPipelineRuns.filter((pipelinerun) => {
return (
pipelinerun.status?.conditions?.every(
(c) => !(c.status === 'Unknown' && c.type === 'Succeeded' && c.reason === 'Running'),
) ?? true
);
});
return [filteredPipelineRuns, list];
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make sense, only Tekton results are being filtered here. can you add a few test cases for this with running status condition and other status condition.

@testcara
Copy link
Contributor Author

@sahil143 , more status have been added to the test. Thank you for your review. :-)

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