-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: main
Are you sure you want to change the base?
Conversation
6cf087c
to
cfa1ecd
Compare
/retest |
Codecov ReportAttention: Patch coverage is
❌ 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@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 34 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
0b59a41
to
7c5062b
Compare
src/utils/tekton-results.ts
Outdated
// 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]; | ||
}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
src/utils/tekton-results.ts
Outdated
const filteredPipelineRuns = originalPipelineRuns.filter((pipelinerun) => { | ||
return ( | ||
pipelinerun.status?.conditions?.every( | ||
(c) => !(c.status === 'Unknown' && c.type === 'Succeeded' && c.reason === 'Running'), | ||
) ?? true | ||
); | ||
}); | ||
return [filteredPipelineRuns, list]; | ||
}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
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?
There was a problem hiding this comment.
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'), |
There was a problem hiding this comment.
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?
src/utils/tekton-results.ts
Outdated
const filteredPipelineRuns = originalPipelineRuns.filter((pipelinerun) => { | ||
return ( | ||
pipelinerun.status?.conditions?.every( | ||
(c) => !(c.status === 'Unknown' && c.type === 'Succeeded' && c.reason === 'Running'), | ||
) ?? true | ||
); | ||
}); | ||
return [filteredPipelineRuns, list]; | ||
}; |
There was a problem hiding this comment.
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.
0a173dc
f901aa6
to
0a173dc
Compare
@sahil143 , more status have been added to the test. Thank you for your review. :-) |
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
Screen shots / Gifs for design review
Without the patch, the UI would list deleted 'running' pipelineruns.
![Screenshot 2024-12-16 at 15 03 19](https://private-user-images.githubusercontent.com/12018515/395994361-3f6b48d9-7e13-44b9-8948-b86d84d7275c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODYyNDcsIm5iZiI6MTczOTM4NTk0NywicGF0aCI6Ii8xMjAxODUxNS8zOTU5OTQzNjEtM2Y2YjQ4ZDktN2UxMy00NGI5LTg5NDgtYjg2ZDg0ZDcyNzVjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE4NDU0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUwZTFmNDFmYjNhZDMzYmM3NWQ5NmQ5ZjcxMmNhMmM0MDE1YjBmYmExYjk2ZmQ4YWExNTY0NmI5NDM1M2M3MWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NweiwWGk88ZVfnohN2O1TLGu4U5gFoffIshtvV4Lm5Q)
![Screenshot 2024-12-16 at 15 05 12](https://private-user-images.githubusercontent.com/12018515/395994476-7aec2380-33f6-43b7-9290-565db7795759.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODYyNDcsIm5iZiI6MTczOTM4NTk0NywicGF0aCI6Ii8xMjAxODUxNS8zOTU5OTQ0NzYtN2FlYzIzODAtMzNmNi00M2I3LTkyOTAtNTY1ZGI3Nzk1NzU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE4NDU0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI2NTZjYWQxMTNiNGI5ZTMwYmMyMWIwYzEzYjJmYzkyMDM5ODIxMGExN2QwNTljYTZiYjA2ZTcwN2JjNmQ1MDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.KAlfcqra5a772S39vI_jTtZw63jm1_wQRxiCTBNPY1M)
With the patch, the UI would ignore the deleted 'running' pipelineruns.
How to test or reproduce?
Browser conformance: