-
Notifications
You must be signed in to change notification settings - Fork 167
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
Follow up misc fixes for pipeline version feature #2352
Follow up misc fixes for pipeline version feature #2352
Conversation
|
||
type PipelineRunDetailsVersionContextProps = { | ||
children: React.ReactNode; | ||
resource?: PipelineRunJobKF | PipelineRunKF | null; |
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.
nit: Don't we only want this context used if there's a resource provided? Seems like this should be marked as required.
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.
Yes, I need to do some refactor on the pipeline details page because the run is from const run = runResource?.run;
, which could be undefined
and the early exit should be checked. I will change that.
children, | ||
resource, | ||
}) => { | ||
const versionRef = getPipelineVersionResourceRef(resource); |
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 looks like this context is only accessed in 1 place, where this version data is needed, I'm wondering if it makes more sense to simply store the "run" object for this context and instead call it PipelineRunDetailsContext
. Since I think keeping track of a run from a couple different locations is its main purpose.
@@ -85,7 +86,7 @@ const PipelineRunDetails: PipelineCoreDetailsPageComponent = ({ breadcrumbPath, | |||
} | |||
|
|||
return ( | |||
<> | |||
<PipelineRunDetailsVersionContextProvider resource={run}> |
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 think we can limit this to wrap around PipelineRunDrawerBottomContent
only since that's the only place the context seems to be used.
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.
Same goes for the PipelineRunJobDetails
usage here.
const usePipelineRunVersionInfo = ( | ||
resource: PipelineRunKF | PipelineRunJobKF | null, | ||
): { | ||
version?: PipelineVersionKF; |
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.
Don't we always return version and error, they're just potentially undefined/null? We only want to make props optional if they're truly optional, not just to account for undefined values.
8b61eff
to
2917e3f
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: jpuzz0 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 |
6e090e2
into
opendatahub-io:f/pipelines-enhancement
JIRA: https://issues.redhat.com/browse/RHOAIENG-1749
Description
This PR did the following things:
disableRowRenderSupport
setView all runs
for pipeline rowHow Has This Been Tested?
Test Impact
N/A, will add later.
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main