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

Compatibility the new automatic multicast discovery and plugin file isolation #60

Merged
merged 15 commits into from
May 20, 2019

Conversation

davidfestal
Copy link
Contributor

@davidfestal davidfestal commented May 13, 2019

What does this PR do?

This PR Implements the compatibility the new automatic multicast discovery and the isolation of plugin files (work done on che-theia by @benoitf in PR eclipse-che/che-theia#91

What issues does this PR fix or reference?

This fixes issue redhat-developer/rh-che#1354 (also described in eclipse-che/che#13272 and eclipse-che/che#12395 (comment)

This also includes a fix for issue eclipse-che/che#13349

Was this PR tested ?

Yes, with upstream Che nightly docker image running on Minishift.
Still want to test the che-in-che flow (Development and test of remote Theia plugins under Che-Theia)

@davidfestal davidfestal requested a review from amisevsk as a code owner May 13, 2019 13:07
@davidfestal davidfestal requested a review from benoitf May 13, 2019 13:08
@davidfestal davidfestal self-assigned this May 13, 2019
@davidfestal davidfestal requested a review from ibuziuk May 13, 2019 13:08
Copy link
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

Looks mostly good on a first readthrough; I'll test more directly tomorrow.

Did you mean to make this PR into a feature branch?

port := endpoint.TargetPort
container.Ports = append(container.Ports, model.ExposedPort{ExposedPort: port})
if (! useLocalhost) {
endpoint := generateTheiaSidecarEndpoint(rand)
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation issues, please make sure all indentation is done via tabs.

@codecov
Copy link

codecov bot commented May 14, 2019

Codecov Report

Merging #60 into master will increase coverage by 2.95%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   62.52%   65.47%   +2.95%     
==========================================
  Files           6        6              
  Lines         555      559       +4     
==========================================
+ Hits          347      366      +19     
+ Misses        182      168      -14     
+ Partials       26       25       -1
Impacted Files Coverage Δ
brokers/unified/vscode/sidecar.go 100% <100%> (ø) ⬆️
utils/ioutil.go 28.66% <86.66%> (+19.1%) ⬆️
brokers/unified/vscode/broker.go 73.93% <86.95%> (-0.83%) ⬇️

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 23a7e2d...cada295. Read the comment docs.

Copy link
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

Thanks David

@davidfestal davidfestal changed the title [WIP] Compatibility the new automatic multicast discovery and plugin file isolation Compatibility the new automatic multicast discovery and plugin file isolation May 17, 2019
Copy link
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

Please set target branch to master; the target is a currently merged branch.

@@ -245,8 +245,9 @@ func extensionOrURL(extensionOrURL string) (extension string, URL string) {
}
}

func (b *brokerImpl) generatePluginArchiveName(plugin model.ChePlugin) string {
return fmt.Sprintf("%s.%s.%s.%s", plugin.Publisher, plugin.Name, plugin.Version, b.rand.String(10))
func (b *brokerImpl) generatePluginArchiveName(plugin model.ChePlugin, archivePath string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

This likely won't work on current master; archivePath is generated and no longer resolves filename, and resolving filename from URL won't work for many URLs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah nevermind I see this commit also modifies how archivePath is generated.

I worry that depending on URLs ending in the filename will cause problems -- e.g. https://marketplace.visualstudio.com/_apis/public/gallery/publishers/vscjava/vsextensions/vscode-java-debug/0.16.0/vspackage is a valid URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is fixed with commit ce4c699

Copy link
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

LGTM, pending switching base branch to master

utils/ioutil.go Outdated
contentDispoFilename = path.Base(path.Clean("/" + contentDispoFilename))
if contentDispoFilename == "." || contentDispoFilename == "/" {
contentDispoFilename = ""
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a few comments about why the steps above are necessary? Having multiple cases where contentDispoFilename is reset to the empty string is a little confusing. Some examples of cases being addressed would be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I refactored a bit the code to make it clearer in commit 103113f

Can you tell if you think a comment is still necessary ?

@davidfestal davidfestal changed the base branch from fix-che-11018 to master May 17, 2019 19:03
davidfestal added a commit that referenced this pull request May 20, 2019
after @amisevsk comment:
#60 (comment)

Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
... and use it to define the filename
when downloading the Theia or VsCode extension archives

Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
after @amisevsk comment:
#60 (comment)

Signed-off-by: David Festal <dfestal@redhat.com>
Copy link
Member

@ibuziuk ibuziuk left a comment

Choose a reason for hiding this comment

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

LGTM

@davidfestal
Copy link
Contributor Author

@ibuziuk @amisevsk @benoitf I updated the ReadMe accordingly. Do you want to have a look before we merge ?

@davidfestal davidfestal merged commit ff656fa into master May 20, 2019
@nickboldt nickboldt deleted the fix-rhche-1354 branch June 29, 2021 19:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants