-
Notifications
You must be signed in to change notification settings - Fork 68
#1849: Add support for VSCodium #1888
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
Open
laert-ll
wants to merge
14
commits into
devonfw:main
Choose a base branch
from
laert-ll:feature/1849-support-vscodium
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
22b95cd
Fix rebase conflict
laert-ll 6ffcb64
Rebase, fix conflict in CHANGELOG.adoc
laert-ll db8cbc3
Fixed conflicts.
laert-ll 14ca1ac
Merge changes into Vscode.java.
laert-ll 9b5048d
#1849: Cleaner logging for missing extensions
laert-ll 4255b4a
#1849: Cleaner logging for missing extensions, fixes failed test
laert-ll a1cb536
#1849: Add tests for VSCodium
laert-ll dc4a91b
Fixed VscodeTest.java merge conflicts.
laert-ll 1231467
#1849: Add license to LICENSE.adoc
laert-ll 5f9b845
#1849: Force-add vscodium extensions.json fixture
laert-ll bf684cd
#1849: Add VSCodium to Help.properties and Help_de.properties
laert-ll 2f97d66
#1849: Missing registration in UpdateManager
laert-ll 1fcb597
#1849: Fix formatting
laert-ll bcb9877
Merge branch 'main' into feature/1849-support-vscodium
hohwille File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
cli/src/test/resources/ide-projects/vscodium/_ide/urls/vscode/vscodium/1.116.02821/urls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ${testbaseurl}/download/vscode/vscodium/1.116.02821/VSCodium-1.116.02821.tgz |
2 changes: 2 additions & 0 deletions
2
cli/src/test/resources/ide-projects/vscodium/project/settings/ide.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| VSCODE_EDITION=vscodium | ||
| VSCODE_VERSION=1.116.02821 |
5 changes: 5 additions & 0 deletions
5
cli/src/test/resources/ide-projects/vscodium/project/workspaces/main/.vscode/extensions.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "recommendations": [ | ||
| "esbenp.prettier-vscode" | ||
| ] | ||
| } |
2 changes: 2 additions & 0 deletions
2
cli/src/test/resources/ide-projects/vscodium/repository/vscode/vscodium/default/bin/codium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #!/bin/bash | ||
| echo "Test for linux and Mac" |
1 change: 1 addition & 0 deletions
1
...rc/test/resources/ide-projects/vscodium/repository/vscode/vscodium/default/bin/codium.cmd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| @echo test for windows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
url-updater/src/main/java/com/devonfw/tools/ide/url/tool/vscode/VsCodiumUrlUpdater.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| package com.devonfw.tools.ide.url.tool.vscode; | ||
|
|
||
| import com.devonfw.tools.ide.url.model.folder.UrlVersion; | ||
| import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater; | ||
|
|
||
| /** | ||
| * {@link GithubUrlTagUpdater} for the "vscodium" edition of vscode (<a href="https://vscodium.com/">VSCodium</a>). | ||
| */ | ||
| public class VsCodiumUrlUpdater extends GithubUrlTagUpdater { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are GitHub releases available for VSCodium: As we already discussed in such case |
||
|
|
||
| private static final String DOWNLOAD_BASE_URL = "https://github.com/VSCodium/vscodium/releases/download"; | ||
|
|
||
| @Override | ||
| public String getTool() { | ||
|
|
||
| return "vscode"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getEdition() { | ||
|
|
||
| return "vscodium"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getGithubOrganization() { | ||
|
|
||
| return "VSCodium"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getGithubRepository() { | ||
|
|
||
| return "vscodium"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getDownloadBaseUrl() { | ||
|
|
||
| return DOWNLOAD_BASE_URL; | ||
| } | ||
|
|
||
| @Override | ||
| protected void addVersion(UrlVersion urlVersion) { | ||
|
|
||
| String baseUrl = getDownloadBaseUrl() + "/${version}/VSCodium-"; | ||
| doAddVersion(urlVersion, baseUrl + "linux-x64-${version}.tar.gz", LINUX, X64); | ||
| doAddVersion(urlVersion, baseUrl + "linux-arm64-${version}.tar.gz", LINUX, ARM64); | ||
| doAddVersion(urlVersion, baseUrl + "darwin-x64-${version}.zip", MAC, X64); | ||
| doAddVersion(urlVersion, baseUrl + "darwin-arm64-${version}.zip", MAC, ARM64); | ||
| doAddVersion(urlVersion, baseUrl + "win32-x64-${version}.zip", WINDOWS, X64); | ||
| doAddVersion(urlVersion, baseUrl + "win32-arm64-${version}.zip", WINDOWS, ARM64); | ||
| } | ||
|
|
||
| @Override | ||
| public String mapVersion(String version) { | ||
|
|
||
| // VSCodium tag schemes seen in history: 3-segment "1.55.0", 4-segment "1.84.2.23319", and current 3-segment with | ||
| // build-encoded patch like "1.116.02821". Accept any 3- or 4-segment numeric tag. | ||
| if (version.matches("\\d+\\.\\d+\\.\\d+(\\.\\d+)?")) { | ||
| return super.mapVersion(version); | ||
| } else { | ||
| return null; | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public String getCpeVendor() { | ||
| return "vscodium"; | ||
| } | ||
|
|
||
| @Override | ||
| public String getCpeProduct() { | ||
| return "vscodium"; | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
url-updater/src/test/java/com/devonfw/tools/ide/url/tool/vscode/VsCodiumUrlUpdaterMock.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package com.devonfw.tools.ide.url.tool.vscode; | ||
|
|
||
| import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; | ||
|
|
||
| /** | ||
| * Mock of {@link VsCodiumUrlUpdater} to allow integration testing with wiremock. | ||
| */ | ||
| public class VsCodiumUrlUpdaterMock extends VsCodiumUrlUpdater { | ||
|
|
||
| private final String baseUrl; | ||
|
|
||
| VsCodiumUrlUpdaterMock(WireMockRuntimeInfo wireMockRuntimeInfo) { | ||
| super(); | ||
| this.baseUrl = wireMockRuntimeInfo.getHttpBaseUrl(); | ||
| } | ||
|
|
||
| @Override | ||
| protected String getDownloadBaseUrl() { | ||
| return this.baseUrl; | ||
| } | ||
|
|
||
| @Override | ||
| protected String doGetVersionUrl() { | ||
|
|
||
| return this.baseUrl + "/repos/" + getGithubOrganization() + "/" + getGithubRepository() + "/git/refs/tags"; | ||
| } | ||
| } |
50 changes: 50 additions & 0 deletions
50
url-updater/src/test/java/com/devonfw/tools/ide/url/tool/vscode/VsCodiumUrlUpdaterTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package com.devonfw.tools.ide.url.tool.vscode; | ||
|
|
||
| import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; | ||
| import static com.github.tomakehurst.wiremock.client.WireMock.get; | ||
| import static com.github.tomakehurst.wiremock.client.WireMock.head; | ||
| import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; | ||
| import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; | ||
|
|
||
| import java.io.IOException; | ||
| import java.nio.file.Files; | ||
| import java.nio.file.Path; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
| import org.junit.jupiter.api.io.TempDir; | ||
|
|
||
| import com.devonfw.tools.ide.url.model.folder.UrlRepository; | ||
| import com.devonfw.tools.ide.url.updater.AbstractUrlUpdaterTest; | ||
| import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; | ||
| import com.github.tomakehurst.wiremock.junit5.WireMockTest; | ||
|
|
||
| /** | ||
| * Test of {@link VsCodiumUrlUpdater}. | ||
| */ | ||
| @WireMockTest | ||
| class VsCodiumUrlUpdaterTest extends AbstractUrlUpdaterTest { | ||
|
|
||
| /** | ||
| * verifies that update creates expected files for VSCodium versions. | ||
| */ | ||
| @Test | ||
| void testVsCodiumUrlUpdaterCreatesDownloadUrlsAndChecksums(@TempDir Path tempDir, WireMockRuntimeInfo wmRuntimeInfo) throws IOException { | ||
| // given | ||
| stubFor(get(urlMatching("/repos/VSCodium/vscodium/git/refs/tags")).willReturn(aResponse().withStatus(200) | ||
| .withBody(Files.readAllBytes(PATH_INTEGRATION_TEST.resolve("VsCodiumUrlUpdater").resolve("vscodium-tags.json"))))); | ||
| stubFor(head(urlMatching("/.*/VSCodium-(linux|darwin|win32)-(x64|arm64)-.*\\.(tar\\.gz|zip)")).willReturn(aResponse().withStatus(200))); | ||
| stubFor(get(urlMatching("/.*/VSCodium-(linux|darwin|win32)-(x64|arm64)-.*\\.(tar\\.gz|zip)")).willReturn(aResponse().withStatus(200).withBody(DOWNLOAD_CONTENT))); | ||
|
|
||
| UrlRepository urlRepository = UrlRepository.load(tempDir); | ||
| VsCodiumUrlUpdaterMock updater = new VsCodiumUrlUpdaterMock(wmRuntimeInfo); | ||
| // when | ||
| updater.update(urlRepository); | ||
|
|
||
| Path vscodium1 = tempDir.resolve("vscode").resolve("vscodium").resolve("1.92.1.24228"); | ||
| Path vscodium2 = tempDir.resolve("vscode").resolve("vscodium").resolve("1.116.02821"); | ||
|
|
||
| // then | ||
| assertUrlVersionOsArch(vscodium1); | ||
| assertUrlVersionOsArch(vscodium2); | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
url-updater/src/test/resources/integrationtest/VsCodiumUrlUpdater/vscodium-tags.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [ | ||
| { | ||
| "ref": "refs/tags/1.92.1.24228" | ||
| }, | ||
| { | ||
| "ref": "refs/tags/1.116.02821" | ||
| } | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: VSCodium does not support all the plugins that VSCode does.
I figured it would be better to suppress the very large red error messages that normally come when not being able to install the plugins, since it gives the impression that this is unexpected behavior. This is a temporary workaround for potentially a future story where we would have a separate list of plugins that are compatible with VSCodium.