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

Bug 1796664: Add links to Marketplace workflows in OperatorHub #3861

Conversation

rebeccaalpert
Copy link
Contributor

@rebeccaalpert rebeccaalpert commented Jan 3, 2020

Read annotations and use action text, remote workflow link, and support link from annotations if present. Default to original values if not found.

The annotations don't seem to be present yet, but I added code to handle them for when they show up.

Fixes https://issues.redhat.com/projects/CONSOLE/issues/CONSOLE-1953.

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. component/olm Related to OLM labels Jan 3, 2020
@rebeccaalpert
Copy link
Contributor Author

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 3, 2020
@spadgett
Copy link
Member

spadgett commented Jan 3, 2020

cc @robszumski @alimobrem

@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Jan 3, 2020
@@ -87,6 +91,12 @@ export const OperatorHubItemDetails: React.SFC<OperatorHubItemDetailsProps> = ({
item.subscription.metadata.name
}?showDelete=true`;

const createLinkWorkflow =
Copy link
Member

Choose a reason for hiding this comment

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

Instead of having separate createLink and createLinkWorkflow variables, it would be better to have a single createLink variables that's set to the right value.

const createLink =
  _.get(obj, ['metadata', 'annotations', 'marketplace.openshift.io/remote-workflow']) ||
  `/operatorhub/subscribe?pkg=${
    obj.metadata.name
  }&catalog=${catalogSource}&catalogNamespace=${catalogSourceNamespace}&targetNamespace=${namespace}`;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this.

@spadgett spadgett added this to the v4.4 milestone Jan 3, 2020
@rebeccaalpert
Copy link
Contributor Author

/retest

1 similar comment
@rebeccaalpert
Copy link
Contributor Author

/retest

@@ -39,6 +41,8 @@ export const OperatorHubItemDetails: React.SFC<OperatorHubItemDetailsProps> = ({
catalogSourceNamespace,
} = item;
const notAvailable = <span className="properties-side-panel-pf-property-label">N/A</span>;
const actionText =
_.get(obj, ['metadata', 'annotations', 'marketplace.openshift.io/action-text']) || 'Install';
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing these annotations would be on the CSV not the PackageManifest, but we need to check with @alimobrem. If so, this would be

Suggested change
_.get(obj, ['metadata', 'annotations', 'marketplace.openshift.io/action-text']) || 'Install';
_.get(obj, ['status', 'channels', '0', 'currentCSVDesc', 'annotations', 'marketplace.openshift.io/action-text']) || 'Install';

and similar for the annotations below

Copy link

Choose a reason for hiding this comment

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

Yes they are on the CSV.

Thanks

@spadgett
Copy link
Member

@rebeccaalpert PR needs rebase and there's a pending comment about reading the annotation

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 24, 2020
@rebeccaalpert
Copy link
Contributor Author

rebeccaalpert commented Jan 24, 2020

@spadgett This is blocked by modal PR. Will rebase and upload latest once that merges.

@spadgett
Copy link
Member

spadgett commented Jan 24, 2020

@spadgett This is blocked by modal PR. Will rebase and upload latest once that merges.

Understood. If you rebase on your modal commit from the other PR and include it here, we should be able to review and tag.

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 24, 2020
'0',
'currentCSVDesc',
'annotations',
'marketplace.openshift.io/support-workflow',
Copy link
Member

Choose a reason for hiding this comment

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

@alimobrem @robszumski It looks like there's an existing support annotation. Is there a reason we can't simply use that?

Copy link
Contributor

Choose a reason for hiding this comment

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

We are using that one, right?

@@ -619,6 +619,14 @@ export const ClusterServiceVersionDetails: React.SFC<ClusterServiceVersionDetail
props,
) => {
const { spec, metadata, status } = props.obj;
const ibmSupportLink = _.get(props.obj, [
Copy link
Member

Choose a reason for hiding this comment

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

This path is wrong if you have the ClusterServiceVersion resource. This path is for the PackageManfiest.

Here it would just be on metadata.annotations.

@@ -647,6 +655,10 @@ export const ClusterServiceVersionDetails: React.SFC<ClusterServiceVersionDetail
<dd>
{spec.provider && spec.provider.name ? spec.provider.name : 'Not available'}
</dd>
<dt>Support</dt>
<dd>
{ibmSupportLink && <ExternalLink href={ibmSupportLink} text="Get Support" />}
Copy link
Member

Choose a reason for hiding this comment

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

We should fall back to the standard support link here if available. (Although I think the marketplace support link could use the standard annotation.)

'currentCSVDesc',
'annotations',
'marketplace.openshift.io/support-workflow',
]);
Copy link
Member

Choose a reason for hiding this comment

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

'currentCSVDesc',
'annotations',
'marketplace.openshift.io/action-text',
])) ||
Copy link
Member

Choose a reason for hiding this comment

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

@rebeccaalpert rebeccaalpert force-pushed the ibm-marketplace-annotations branch 3 times, most recently from d800ee1 to 08667e5 Compare January 25, 2020 00:45
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 25, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rebeccaalpert, spadgett

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

@spadgett
Copy link
Member

/hold cancel

This was approved and in the queue Friday, and no other changes have been made. (The commit from Friday rebased cleanly with no changes now that the modal PR merged.)

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 29, 2020
@rebeccaalpert
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

5 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@spadgett spadgett changed the title frontend: Add links to IBM Marketplace workflows in OperatorHub Bug 1796664: Add links to Marketplace workflows in OperatorHub Jan 30, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jan 30, 2020
@openshift-ci-robot
Copy link
Contributor

@rebeccaalpert: This pull request references Bugzilla bug 1796664, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Bug 1796664: Add links to Marketplace workflows in OperatorHub

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/test-infra repository.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

14 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit d07c7de into openshift:master Jan 31, 2020
@openshift-ci-robot
Copy link
Contributor

@rebeccaalpert: All pull requests linked via external trackers have merged. Bugzilla bug 1796664 has been moved to the MODIFIED state.

In response to this:

Bug 1796664: Add links to Marketplace workflows in OperatorHub

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/test-infra repository.

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality component/olm Related to OLM lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants