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

WIP Make plugin references without version use 'latest' implicitly #13414

Closed
wants to merge 1 commit into from

Conversation

amisevsk
Copy link
Contributor

@amisevsk amisevsk commented May 24, 2019

What does this PR do?

related issue - #12937
Changes necessary to make plugin references without a version specified,
e.g. eclipse/che-theia to parse as eclipse/che-theia/latest by default. As a side effect,
this commit disables:

  • Validation of plugin references with a custom registry. This allows
    using direct links to meta.yamls (no need to have a path ending in
    publisher/name/version) but also works by arbitrarily splitting the URL
    into a 'registry' and 'id'
  • Devfile aliases and similar features are disabled for plugins from
    custom registries
  • Some tests that depend on having a custom registry specified are
    disabled until issue Improve/fix parsing of plugins/editors attribute #13385 is resolved.

See also: #13385, since I believe that the way we handle plugin references is in sore need of improvement.

This plugin is still WIP but I would like comments/review, especially regarding how custom registries are handled.

Changes necessary to make plugin references without a version specified,
e.g.

  eclipse/che-theia

to parse as 'eclipse/che-theia/latest' by default. As a side effect,
this commit disables:

- Validation of plugin references with a custom registry. This allows
using direct links to meta.yamls (no need to have a path ending in
publisher/name/version) but also works by arbitrarily splitting the URL
into a 'registry' and 'id'

- Devfile aliases and similar features are disabled for plugins from
custom registries

- Some tests that depend on having a custom registry specified are
disabled until issue
  eclipse-che#13385
is resolved.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
@amisevsk amisevsk added the kind/enhancement A feature request - must adhere to the feature request template. label May 24, 2019
@mshaposhnik
Copy link
Contributor

mshaposhnik commented May 24, 2019

IMO it is highly conflicting with #13297 There will be no possibilty to specify registry directly in ID, it will be in separate field.

@ibuziuk
Copy link
Member

ibuziuk commented May 24, 2019

@mshaposhnik could you please clarify why it is highly conflicting with #13297 ? Do you mean impl details because in terms of functionality I do not see any conflict.

@mshaposhnik
Copy link
Contributor

mshaposhnik commented May 24, 2019

Both code & logic:

  • There will be no more registries in plugin ID. They're moved into separate field; So the parsing logic is changed;
  • Direct links to meta.yaml shouldn't be introduced here since they will be done in reference field in my PR etc
    So for me i'ts better to limit scope of the PR just to default version and avoid those collisions with registry/references URL etc.

@ibuziuk
Copy link
Member

ibuziuk commented May 24, 2019

@mshaposhnik how are you planning to proceed with #13414 ? are you going to merge it for CR1 ?

@mshaposhnik
Copy link
Contributor

@ibuziuk we trying our best :)

@ibuziuk
Copy link
Member

ibuziuk commented May 24, 2019

@mshaposhnik no sorry I meant your PR #13297 ? is it planned to be merged fairly soon?

for me i'ts better to limit scope of the PR just to default version and avoid those collistions with registry/refercences URL etc.

I agree, so wondering when are you planning to merge the fix for #13104 and we could adjust the latest version support of it @amisevsk wdyt ?

@mshaposhnik
Copy link
Contributor

@ibuziuk yes i understood, we're solving last couple of problems (like setting memory limits and checking for default editors/plugins for those specified via reference) and will be ready to merge.

@amisevsk
Copy link
Contributor Author

@mshaposhnik I don't think the two PRs conflict on a logic level, in fact I think your PR complements this PR pretty well in the general case. The main purpose of this PR is to allow plugin IDs without version specified (in which case they're rewritten with latest). The other changes present here are to allow that to work in don't-break-everything way. Basically, the whole "don't parse URLs" thing is a side effect and workaround.

PR #13297 simplifies this quite a bit actually, since it changes how plugin strings are written -- it would be easy to adapt this onto your open PR and this PR would probably become simpler.

I'm fine with waiting for #13297 to be merged and reworking this one to fit in with it.

That said, I'd appreciate comments on #13385, since I think using simple strings for plugins is becoming more and more of a problem and we should strongly consider moving away from it.

Copy link
Member

@sleshchenko sleshchenko left a comment

Choose a reason for hiding this comment

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

PR description says that it is still WIP, is it?

{
"editor_plugin_component/devfile_editor_plugins_components_with_invalid_memory_limit.yaml",
"(/components/0/memoryLimit):The value must be of string type, but actual type is integer."
},
{
"editor_plugin_component/devfile_editor_component_with_multiple_colons_in_id.yaml",
"(/components/0/id):The string value must match the pattern \"^((https?://)[a-zA-Z0-9_\\-./]+/)?[a-z0-9_\\-.]+/[a-z0-9_\\-.]+/[a-z0-9_\\-.]+$\"."
"(/components/0/id):The string value must match the pattern \"^((https?://)[a-zA-Z0-9_\\-./]+/)?[a-z0-9_\\-.]+/[a-z0-9_\\-.]+(/[a-z0-9_\\-.]+)?$\"."
Copy link
Member

Choose a reason for hiding this comment

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

Since we use slash instead of colon for separating version from name, this test case looks outdated. Could you consider removing it and add a new test case with invalid URL instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@amisevsk
Copy link
Contributor Author

@sleshchenko I still consider it WIP because I'd like some discussion about the disabled/modified tests, and also it conflicts with #13297, and so may need to be significantly reworked.

@sleshchenko
Copy link
Member

@sleshchenko I still consider it WIP because I'd like some discussion about the disabled/modified tests, and also it conflicts with #13297, and so may need to be significantly reworked.

Then please consider adding WIP into PR title to avoid occasional merge of this PR.

@amisevsk
Copy link
Contributor Author

Then please consider adding WIP into PR title to avoid occasional merge of this PR.

It would need an approval first, so I'm not too worried ;)

@amisevsk amisevsk changed the title Make plugin references without version use 'latest' implicitly WIP Make plugin references without version use 'latest' implicitly May 27, 2019
@l0rd l0rd mentioned this pull request Jun 4, 2019
@che-bot che-bot added the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Aug 6, 2019
@eclipse-che eclipse-che deleted a comment from che-bot Aug 6, 2019
@amisevsk
Copy link
Contributor Author

Closing PR as woefully out of date; this would need to be reworked with other plugin changes.

@amisevsk amisevsk closed this Aug 21, 2019
@amisevsk amisevsk deleted the plugin-latest-support branch August 21, 2019 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants