Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

fix(plugins): Change path to plugins index.json file #1154

Merged
merged 2 commits into from
Jun 23, 2021

Conversation

vitaliy-guliy
Copy link
Contributor

Signed-off-by: Vitaliy Gulyy vgulyy@redhat.com

What does this PR do?

When Che is deployed in single-host mode, the plugin registry does not respect index.json file, where all the plugins are described.
For that case, it's better to read plugins.json file directly.

Screenshot/screencast of this PR

Screenshot from 2021-06-22 17-44-11

What issues does this PR fix or reference?

eclipse-che/che#19955

How to test this PR?

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Happy Path Channel

HAPPY_PATH_CHANNEL=next

Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
@benoitf
Copy link
Contributor

benoitf commented Jun 22, 2021

@vitaliy-guliy
Copy link
Contributor Author

vitaliy-guliy commented Jun 22, 2021

hello, is it related to a missing / at the end of the URL ?
for example
https://che-eclipse-che.apps.cluster-91de.91de.sandbox1444.opentlc.com/plugin-registry/v3/plugins/ works
https://che-eclipse-che.apps.cluster-91de.91de.sandbox1444.opentlc.com/plugin-registry/v3/plugins redirect to dashboard

yes.
The same issue we have for devfile registry.

@benoitf
Copy link
Contributor

benoitf commented Jun 22, 2021

my question is: should we not fix the URL just by appending a single / instead of specifying /index.json ?

@codecov
Copy link

codecov bot commented Jun 22, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@af569ae). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1154   +/-   ##
=======================================
  Coverage        ?   32.79%           
=======================================
  Files           ?      290           
  Lines           ?     9886           
  Branches        ?     1457           
=======================================
  Hits            ?     3242           
  Misses          ?     6641           
  Partials        ?        3           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af569ae...a841f43. Read the comment docs.

@che-bot
Copy link
Contributor

che-bot commented Jun 22, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:1154
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:1154

Test product:

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

@vitaliy-guliy
Copy link
Contributor Author

my question is: should we not fix the URL just by appending a single / instead of specifying /index.json ?

What if it's a custom registry (surge.sh, etc), that is running not under apache, where index.json is not configured as directory index?
Then getting of the index file will be impossible.

In our case we always generate index.json file /~https://github.com/eclipse-che/che-plugin-registry/blob/main/tools/build/src/meta-yaml/index-writer.ts#L44, why not to read it by explicit link?

@benoitf
Copy link
Contributor

benoitf commented Jun 23, 2021

well, I would say index.json is an implementation detail of the plug-in registry
as it's "emulating REST API' with / I would say it's better to use 'REST' calls so even if index.json become index.foo or is totally removed we're still safe.

Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
@vitaliy-guliy
Copy link
Contributor Author

Reworked on adding only '/plugins/' at the end.

@vitaliy-guliy
Copy link
Contributor Author

But we also need to investigate a bit the apache server.
In single host mode it generates wrong redirect link.

If you try

curl -v https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/plugin-registry/v3/plugins

you will get

HTTP/1.1 301 Moved Permanently
location: http://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/v3/plugins/

Location URI does not contain /plugin-registry anymore.

@benoitf
Copy link
Contributor

benoitf commented Jun 23, 2021

@vitaliy-guliy might be related to eclipse-che/che#19995

@che-bot
Copy link
Contributor

che-bot commented Jun 23, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:1154
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:1154

Test product:

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

@vitaliy-guliy
Copy link
Contributor Author

[crw-ci-test --rebuild]

@che-bot
Copy link
Contributor

che-bot commented Jun 23, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:1154
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:1154

Test product:

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

@dmytro-ndp
Copy link
Contributor

@vitaliy-guliy: recent execution of Happy path test has failed because of known issue eclipse-che/che#18034

@vitaliy-guliy
Copy link
Contributor Author

@vitaliy-guliy: recent execution of Happy path test has failed because of known issue eclipse/che#18034

Thanks for your comment.
Merging the PR as there is Happy Path / happy-path (alpine, next) (pull_request) passes.

@vitaliy-guliy vitaliy-guliy merged commit 7d9b311 into main Jun 23, 2021
@vitaliy-guliy vitaliy-guliy deleted the invalid-plugin-registry branch June 23, 2021 15:30
@che-bot che-bot added this to the 7.33 milestone Jun 23, 2021
@benoitf benoitf added the kind/bug Something isn't working label Jun 24, 2021
vinokurig pushed a commit that referenced this pull request Jul 15, 2021
* fix(plugins): Change path to the plugins index

Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
dmytro-ndp pushed a commit that referenced this pull request Jul 21, 2021
* fix(plugins): Change path to the plugins index

Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants