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 1897354: make CRDCard display consistent with tabs #7393

Merged
merged 1 commit into from Dec 4, 2020

Conversation

rhamilto
Copy link
Member

@rhamilto rhamilto commented Dec 2, 2020

We were filtering out CRDs from the Provided API cards list if the model for the CRD didn't exist; this created a discrepancy between what the cards listed and what the tabs listed. This aligns the cards with the tabs, and both now reflect what's in the CSV YAML.

Reproducer:

add a fake spec.customresourcedefinitions.owned to the CSV.

spec:
  customresourcedefinitions:
    owned:
      - description: Foo is the Schema for the jaegers API
        displayName: Foo
        kind: Foo
        name: foo.jaegertracing.io
        version: v1

Before:
Screen Shot 2020-12-03 at 5 18 25 PM

After:
Screen Shot 2020-12-03 at 5 17 54 PM

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 2, 2020
@openshift-ci-robot
Copy link
Contributor

@rhamilto: An error was encountered adding this pull request to the external tracker bugs for bug 1897354 on the Bugzilla server at https://bugzilla.redhat.com:

JSONRPC error 32000: There was an error reported for the RPC call to Jira: There was an error reported for a GitHub REST call. URL: https://api.github.com/repos/openshift/console/pulls/7393 Error: 403 Forbidden at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 111. at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 111. eval {...} called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 98 Bugzilla::Extension::ExternalBugs::Type::GitHub::_do_rest_call('Bugzilla::Extension::ExternalBugs::Type::GitHub=HASH(0x559eb5...', 'https://api.github.com/repos/openshift/console/pulls/7393', 'GET') called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 62 Bugzilla::Extension::ExternalBugs::Type::GitHub::get_data('Bugzilla::Extension::ExternalBugs::Type::GitHub=HASH(0x559eb5...', 'Bugzilla::Extension::ExternalBugs::Bug=HASH(0x559eb5b74c20)') called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Bug.pm line 302 eval {...} called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Bug.pm line 302 Bugzilla::Extension::ExternalBugs::Bug::update_ext_info('Bugzilla::Extension::ExternalBugs::Bug=HASH(0x559eb5b74c20)', 1) called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Bug.pm line 125 Bugzilla::Extension::ExternalBugs::Bug::create('Bugzilla::Extension::ExternalBugs::Bug', 'HASH(0x559eb614bc30)') called at /var/www/html/bugzilla/extensions/ExternalBugs/Extension.pm line 940 Bugzilla::Extension::ExternalBugs::bug_start_of_update('Bugzilla::Extension::ExternalBugs=HASH(0x559eb5b7c9e0)', 'HASH(0x559eb5351640)') called at /var/www/html/bugzilla/Bugzilla/Hook.pm line 21 Bugzilla::Hook::process('bug_start_of_update', 'HASH(0x559eb5351640)') called at /var/www/html/bugzilla/Bugzilla/Bug.pm line 1173 Bugzilla::Bug::update('Bugzilla::Bug=HASH(0x559eb4cf87f0)') called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/WebService.pm line 88 Bugzilla::Extension::ExternalBugs::WebService::add_external_bug('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x559eb5bb1f78)') called at (eval 2272) line 1 eval ' $procedure->{code}->($self, @params) ;' called at /usr/share/perl5/vendor_perl/JSON/RPC/Legacy/Server.pm line 220 JSON::RPC::Legacy::Server::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x559eb5bb2e70)') called at /var/www/html/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm line 297 Bugzilla::WebService::Server::JSONRPC::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x559eb5bb2e70)') called at /usr/share/perl5/vendor_perl/JSON/RPC/Legacy/Server.pm line 126 JSON::RPC::Legacy::Server::handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...') called at /var/www/html/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm line 70 Bugzilla::WebService::Server::JSONRPC::handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...') called at /var/www/html/bugzilla/jsonrpc.cgi line 31 ModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::var_www_html_bugzilla_jsonrpc_2ecgi::handler('Apache2::RequestRec=SCALAR(0x559eb4bd0848)') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 207 eval {...} called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 207 ModPerl::RegistryCooker::run('Bugzilla::ModPerl::ResponseHandler=HASH(0x559eb4bd6038)') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 173 ModPerl::RegistryCooker::default_handler('Bugzilla::ModPerl::ResponseHandler=HASH(0x559eb4bd6038)') called at /usr/lib64/perl5/vendor_perl/ModPerl/Registry.pm line 32 ModPerl::Registry::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x559eb4bd0848)') called at /var/www/html/bugzilla/mod_perl.pl line 139 Bugzilla::ModPerl::ResponseHandler::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x559eb4bd0848)') called at (eval 2272) line 0 eval {...} called at (eval 2272) line 0 at /var/www/html/bugzilla/Bugzilla/Error.pm line 130. Bugzilla::Error::_throw_error('global/user-error.html.tmpl', 'ext_bz_rest_error', 'HASH(0x559eb6173328)') called at /var/www/html/bugzilla/Bugzilla/Error.pm line 193 Bugzilla::Error::ThrowUserError('ext_bz_rest_error', 'HASH(0x559eb6173328)') called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 120 Bugzilla::Extension::ExternalBugs::Type::GitHub::_do_rest_call('Bugzilla::Extension::ExternalBugs::Type::GitHub=HASH(0x559eb5...', 'https://api.github.com/repos/openshift/console/pulls/7393', 'GET') called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 62 Bugzilla::Extension::ExternalBugs::Type::GitHub::get_data('Bugzilla::Extension::ExternalBugs::Type::GitHub=HASH(0x559eb5...', 'Bugzilla::Extension::ExternalBugs::Bug=HASH(0x559eb5b74c20)') called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Bug.pm line 302 eval {...} called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Bug.pm line 302 Bugzilla::Extension::ExternalBugs::Bug::update_ext_info('Bugzilla::Extension::ExternalBugs::Bug=HASH(0x559eb5b74c20)', 1) called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/Bug.pm line 125 Bugzilla::Extension::ExternalBugs::Bug::create('Bugzilla::Extension::ExternalBugs::Bug', 'HASH(0x559eb614bc30)') called at /var/www/html/bugzilla/extensions/ExternalBugs/Extension.pm line 940 Bugzilla::Extension::ExternalBugs::bug_start_of_update('Bugzilla::Extension::ExternalBugs=HASH(0x559eb5b7c9e0)', 'HASH(0x559eb5351640)') called at /var/www/html/bugzilla/Bugzilla/Hook.pm line 21 Bugzilla::Hook::process('bug_start_of_update', 'HASH(0x559eb5351640)') called at /var/www/html/bugzilla/Bugzilla/Bug.pm line 1173 Bugzilla::Bug::update('Bugzilla::Bug=HASH(0x559eb4cf87f0)') called at /loader/0x559ea6ec1638/Bugzilla/Extension/ExternalBugs/WebService.pm line 88 Bugzilla::Extension::ExternalBugs::WebService::add_external_bug('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x559eb5bb1f78)') called at (eval 2272) line 1 eval ' $procedure->{code}->($self, @params) ;' called at /usr/share/perl5/vendor_perl/JSON/RPC/Legacy/Server.pm line 220 JSON::RPC::Legacy::Server::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x559eb5bb2e70)') called at /var/www/html/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm line 297 Bugzilla::WebService::Server::JSONRPC::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x559eb5bb2e70)') called at /usr/share/perl5/vendor_perl/JSON/RPC/Legacy/Server.pm line 126 JSON::RPC::Legacy::Server::handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...') called at /var/www/html/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm line 70 Bugzilla::WebService::Server::JSONRPC::handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...') called at /var/www/html/bugzilla/jsonrpc.cgi line 31 ModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::var_www_html_bugzilla_jsonrpc_2ecgi::handler('Apache2::RequestRec=SCALAR(0x559eb4bd0848)') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 207 eval {...} called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 207 ModPerl::RegistryCooker::run('Bugzilla::ModPerl::ResponseHandler=HASH(0x559eb4bd6038)') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 173 ModPerl::RegistryCooker::default_handler('Bugzilla::ModPerl::ResponseHandler=HASH(0x559eb4bd6038)') called at /usr/lib64/perl5/vendor_perl/ModPerl/Registry.pm line 32 ModPerl::Registry::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x559eb4bd0848)') called at /var/www/html/bugzilla/mod_perl.pl line 139 Bugzilla::ModPerl::ResponseHandler::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x559eb4bd0848)') called at (eval 2272) line 0 eval {...} called at (eval 2272) line 0
Please contact an administrator to resolve this issue, then request a bug refresh with /bugzilla refresh.

In response to this:

[WIP] Bug 1897354: add refresh message to Provided APIs empty state

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-ci-robot openshift-ci-robot added the component/olm Related to OLM label Dec 2, 2020
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Dec 2, 2020
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Bugzilla bug 1897354, which is valid. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

[WIP] Bug 1897354: add refresh message to Provided APIs empty state

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.

@rhamilto
Copy link
Member Author

rhamilto commented Dec 2, 2020

It occurs to me we should decouple the refresh message from the empty state and show it any time the CSV is recently created, but I'll wait on the design...

@@ -765,10 +766,15 @@ const crdCardRowStateToProps = ({ k8s }, { crdDescs }) => {
export const CRDCardRow = connect(crdCardRowStateToProps)((props: CRDCardRowProps) => {
const internalObjects = getInternalObjects(props.csv);
const crds = props.crdDescs?.filter(({ name }) => !isInternalObject(internalObjects, name));
// if the CSV was created within the last 5 minutes (300000 milliseconds)
const recentlyCreated = moment(Date.now()).diff(props.csv.metadata.creationTimestamp) < 300000;
Copy link
Member

Choose a reason for hiding this comment

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

Isn't 30,000ms == 30s? I would use 5 * 60 * 1000.

I wonder if we should check the date at all since we could have clock drift between the client and server. I think we should a similar message elsewhere in the UI without the date check.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@rhamilto Disregard, I missed a 0 :)

@rhamilto rhamilto changed the title [WIP] Bug 1897354: add refresh message to Provided APIs empty state Bug 1897354: make CRDCard display consistent with tabs Dec 3, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 3, 2020
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Bugzilla bug 1897354, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1897354: make CRDCard display consistent with tabs

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.

3 similar comments
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Bugzilla bug 1897354, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1897354: make CRDCard display consistent with tabs

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-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Bugzilla bug 1897354, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1897354: make CRDCard display consistent with tabs

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-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Bugzilla bug 1897354, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1897354: make CRDCard display consistent with tabs

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.

@rhamilto
Copy link
Member Author

rhamilto commented Dec 3, 2020

@itsptk and @tlwu2013, y'all good with this approach?

@rhamilto
Copy link
Member Author

rhamilto commented Dec 3, 2020

/retest

@itsptk
Copy link

itsptk commented Dec 4, 2020

@rhamilto I like it 👍, just curious:

Would the 'Create instance' button appear when the CRD is actually created then? (The same time the Foo tab stops saying "The server doesn't have a resource type Foo. Try refreshing the page if it was recently added." ?) Would the user need to refresh the Details for that 'create instance' button to appear?

@spadgett
Copy link
Member

spadgett commented Dec 4, 2020

@rhamilto I like it 👍, just curious:

Would the 'Create instance' button appear when the CRD is actually created then? (The same time the Foo tab stops saying "The server doesn't have a resource type Foo. Try refreshing the page if it was recently added." ?) Would the user need to refresh the Details for that 'create instance' button to appear?

Hi @itsptk. They should, although there might be a little bit of a delay for normal users. If it doesn't, I'd consider that a bug.

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto, 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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2020
@rhamilto
Copy link
Member Author

rhamilto commented Dec 4, 2020

Would the 'Create instance' button appear when the CRD is actually created then? (The same time the Foo tab stops saying "The server doesn't have a resource type Foo. Try refreshing the page if it was recently added." ?) Would the user need to refresh the Details for that 'create instance' button to appear?

Yes, the create button should appear automatically. I haven't tested it, but in looking at the code, it should "React".

@openshift-merge-robot openshift-merge-robot merged commit 863c3b6 into openshift:master Dec 4, 2020
@openshift-ci-robot
Copy link
Contributor

@rhamilto: All pull requests linked via external trackers have merged:

Bugzilla bug 1897354 has been moved to the MODIFIED state.

In response to this:

Bug 1897354: make CRDCard display consistent with tabs

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/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/olm Related to OLM lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants