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
Service Binding From Add Flow #3958
Service Binding From Add Flow #3958
Conversation
2647ae3
to
da39e72
Compare
.then((resources) => | ||
doContextualBinding(resources, contextualSource, serviceBindingAvailable), | ||
) | ||
.catch(() => {}); |
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.
This is related to the bug in the description (ODC-2726); it catches and swallows the errors 😞
@@ -321,18 +322,8 @@ export const transformTopologyData = ( | |||
filters?: TopologyFilters, | |||
): TopologyDataModel => { | |||
const installedOperators = _.get(resources, 'clusterServiceVersions.data'); | |||
let operatorBackedServiceKindMap: OperatorBackedServiceKindMap; | |||
const operatorBackedServiceKindMap = getOperatorBackedServiceKindMap(installedOperators); |
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 refactor this to reuse it. From what I can tell no one checked for undefined
, so an empty map is always returned for the purity of getOperatorBackedServiceKindMap
.
/** URL query params that adjust scope / purpose of the page */ | ||
export enum QUERY_PROPERTIES { | ||
/** For defining a contextual application group (ie, add new workload into this application group) */ | ||
APPLICATION = 'application', | ||
/** For defining a contextual source of the redirect (ie, connect a new workload from this contextual source) */ | ||
CONTEXT_SOURCE = 'contextSource', | ||
} |
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.
Hope for reuse here... not sure if that's logical or not. But at least @karthikjeeyar you'll need to make use of this in your PR #3918 (probably after your PR is merged we clean it up)
/kind feature |
da39e72
to
81dc525
Compare
81dc525
to
dc16a2b
Compare
Verified locally as well, overall looks good :) good to have specs for utils, but as mentioned in description it can go as a follow-up PR |
dc16a2b
to
f7cabf0
Compare
I added https://issues.redhat.com/browse/ODC-2824 to make sure the tests get done next sprint. |
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
/hold |
searchParams, | ||
onSetApp, | ||
}) => { | ||
const [originalApp] = React.useState(application); |
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.
useRef
?
onSetApp, | ||
}) => { | ||
const [originalApp] = React.useState(application); | ||
const desiredApplication = searchParams.get(QUERY_PROPERTIES.APPLICATION); |
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.
Maybe avoid the searchParams
prop altogether and do this?
const desiredApplication = searchParams.get(QUERY_PROPERTIES.APPLICATION); | |
const desiredApplication = new URLSearchParams(location.search).get(QUERY_PROPERTIES.APPLICATION); |
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.
Would need to be window.location.search
for lint... but sure.
const operatorBackedServiceKindMap = getOperatorBackedServiceKindMap( | ||
await k8sList(ClusterServiceVersionModel, { ns: namespace }), | ||
); | ||
const ownerResourceKind = _.get(newResource, 'metadata.ownerReferences[0].kind'); |
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.
Should move to optional chaining.
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.
Ah right, wasn't merged when I did this.
let operatorBackedServiceKindMap: OperatorBackedServiceKindMap = {}; | ||
if (installedOperators) { | ||
operatorBackedServiceKindMap = installedOperators.reduce((kindMap, csv) => { | ||
_.get(csv, 'spec.customresourcedefinitions.owned', []).forEach((crd) => { |
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.
Should move to optional chaining.
f7cabf0
to
38f70e6
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, christianvogt, invincibleJai 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 |
/hold cancel |
Service Binding From Add Flow
Resolves https://issues.redhat.com/browse/ODC-2601
TODO:
We'll address these issues in a follow-up ticket. We should just get the code in for now to build that foundation.
Given an application / workload setup like this:
Using the work to redirect to the add flow being done in #3918 to populate the URL with an application + contextSource:
The slowness of the connector being added can be attributed to this issue: https://issues.redhat.com/browse/ODC-2726
cc @openshift/team-devconsole-ux
For testing purposes while #3918 is being reviewed... Here are the steps to reproduce the above scenario:
your-namespace
will need to be updated to your chosen project in no.1)http://localhost:9000/import/ns/your-namespace?importType=git&application=react-web-app-app&contextSource=core~v1~Deployment%2Freact-web-app
(using https://github.com/nodeshift-starters/nodejs-rest-http)
Key parts here are the
application=react-web-app-app
andcontextSource=core~v1~Deployment%2Freact-web-app
(ie groupVersionKind/app-name)