-
Notifications
You must be signed in to change notification settings - Fork 90
#2186: create obsidian url updater #2203
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
Merged
hohwille
merged 20 commits into
devonfw:main
from
JoelAdbu:feature/2186-create-obsidian-urlupdater
Aug 25, 2026
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d16b458
Update quality status documents
JoelAdbu 7a97ffc
#2186:
JoelAdbu e74d874
2186:
JoelAdbu 5926c82
2186:
JoelAdbu d46f3c2
restored quality status documentation from devonfw
JoelAdbu 90520c0
Merge remote-tracking branch 'upstream/main' into feature/2186-create…
maybeec 70a8e59
Merge branch 'main' into feature/2186-create-obsidian-urlupdater
hohwille 2868230
constructive review: quickfix for test that broke due to changes on main
hohwille f4cc127
Apply suggestion from @hohwille
hohwille e3f81ef
Fix syntax error in ObsidianUrlUpdaterTest
hohwille 75bad32
Remove unnecessary blank line in ObsidianUrlUpdaterTest
hohwille 02c5daa
keep alphabetical order
hohwille 253a3b5
spotless harness can be so annoying
hohwille fc61bac
need to change my practices since spotless harness is preventing this…
hohwille 2be9eef
Merge branch 'main' into feature/2186-create-obsidian-urlupdater
hohwille ede7bf6
Merge branch 'main' into feature/2186-create-obsidian-urlupdater
hohwille 31532f5
Merge branch 'main' into feature/2186-create-obsidian-urlupdater
hohwille 10929c4
Merge remote-tracking branch 'upstream/main' into feature/2186-create…
JoelAdbu b848b78
2203:
JoelAdbu b4ffc26
Merge branch 'main' into feature/2186-create-obsidian-urlupdater
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
68 changes: 68 additions & 0 deletions
68
url-updater/src/main/java/com/devonfw/tools/ide/url/tool/obsidian/ObsidianUrlUpdater.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,68 @@ | ||
| package com.devonfw.tools.ide.url.tool.obsidian; | ||
|
|
||
| import com.devonfw.tools.ide.url.model.folder.UrlVersion; | ||
| import com.devonfw.tools.ide.url.updater.GithubUrlReleaseUpdater; | ||
|
|
||
| /** | ||
| * {@link GithubUrlReleaseUpdater} for Obsidian. | ||
| */ | ||
| public class ObsidianUrlUpdater extends GithubUrlReleaseUpdater { | ||
|
|
||
| /** | ||
| * The Constructor. | ||
| */ | ||
| public ObsidianUrlUpdater() { | ||
| super(); | ||
| } | ||
|
|
||
| /** | ||
| * Package-private constructor used for testing {@link ObsidianUrlUpdater}. | ||
| * | ||
| * @param downloadBaseUrl mock url used for download base. | ||
| * @param versionBaseUrl mock url used for version base. | ||
| */ | ||
| ObsidianUrlUpdater(String downloadBaseUrl, String versionBaseUrl) { | ||
| super(downloadBaseUrl, versionBaseUrl); | ||
| } | ||
|
|
||
| @Override | ||
| public String getTool() { | ||
| return "obsidian"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getGithubOrganization() { | ||
| return "obsidianmd"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getGithubRepository() { | ||
| return "obsidian-releases"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getVersionPrefixToRemove() { | ||
| return "v"; | ||
| } | ||
|
|
||
| @Override | ||
| protected void addVersion(UrlVersion urlVersion) { | ||
| String baseUrl = createGithubReleaseDownloadUrl("v${version}", ""); | ||
|
|
||
| doAddVersion(urlVersion, baseUrl + "Obsidian-${version}.exe", WINDOWS, X64); | ||
| doAddVersion(urlVersion, baseUrl + "Obsidian-${version}.dmg", MAC, X64); | ||
| doAddVersion(urlVersion, baseUrl + "obsidian_${version}_amd64.deb", LINUX, X64); | ||
| doAddVersion(urlVersion, baseUrl + "obsidian-${version}.tar.gz", LINUX, X64); | ||
| doAddVersion(urlVersion, baseUrl + "obsidian-${version}-arm64.tar.gz", LINUX, ARM64); | ||
| } | ||
|
|
||
| @Override | ||
| public String getCpeVendor() { | ||
| return "obsidian"; | ||
| } | ||
|
|
||
| @Override | ||
| public String getCpeProduct() { | ||
| return "obsidian"; | ||
| } | ||
| } | ||
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
78 changes: 78 additions & 0 deletions
78
...updater/src/test/java/com/devonfw/tools/ide/url/tool/obsidian/ObsidianUrlUpdaterTest.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,78 @@ | ||
| package com.devonfw.tools.ide.url.tool.obsidian; | ||
|
|
||
| import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; | ||
| import static com.github.tomakehurst.wiremock.client.WireMock.any; | ||
| import static com.github.tomakehurst.wiremock.client.WireMock.get; | ||
| 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.Path; | ||
| import java.util.List; | ||
|
|
||
| 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 ObsidianUrlUpdater}. | ||
| */ | ||
| @WireMockTest | ||
| public class ObsidianUrlUpdaterTest extends AbstractUrlUpdaterTest { | ||
|
|
||
| /** | ||
| * Test of {@link ObsidianUrlUpdater} for the creation of download URLs and checksums. | ||
| * | ||
| * @param tempDir Path to a temporary directory. | ||
| * @param wmRuntimeInfo the {@link WireMockRuntimeInfo}. | ||
| */ | ||
| @Test | ||
| void testObsidianUrlUpdater(@TempDir Path tempDir, WireMockRuntimeInfo wmRuntimeInfo) throws IOException { | ||
|
|
||
| // arrange | ||
| stubFor(get(urlMatching("/repos/obsidianmd/obsidian-releases/releases")) | ||
| .willReturn(aResponse() | ||
| .withStatus(200) | ||
| .withBody(readAndResolve(PATH_INTEGRATION_TEST.resolve("ObsidianUrlUpdater") | ||
| .resolve("obsidian-releases.json"), wmRuntimeInfo)))); | ||
|
|
||
| stubFor(any(urlMatching("/obsidianmd/obsidian-releases/releases/download/v\\d+\\.\\d+\\.\\d+/Obsidian-.*\\.exe")) | ||
| .willReturn(aResponse() | ||
| .withStatus(200) | ||
| .withBody(DOWNLOAD_CONTENT))); | ||
| stubFor(any(urlMatching("/obsidianmd/obsidian-releases/releases/download/v\\d+\\.\\d+\\.\\d+/Obsidian-.*\\.dmg")) | ||
| .willReturn(aResponse() | ||
| .withStatus(200) | ||
| .withBody(DOWNLOAD_CONTENT))); | ||
| stubFor(any(urlMatching("/obsidianmd/obsidian-releases/releases/download/v\\d+\\.\\d+\\.\\d+/obsidian_.*_amd64\\.deb")) | ||
| .willReturn(aResponse() | ||
| .withStatus(200) | ||
| .withBody(DOWNLOAD_CONTENT))); | ||
| stubFor(any(urlMatching("/obsidianmd/obsidian-releases/releases/download/v\\d+\\.\\d+\\.\\d+/obsidian-.*\\.tar\\.gz")) | ||
| .willReturn(aResponse() | ||
| .withStatus(200) | ||
| .withBody(DOWNLOAD_CONTENT))); | ||
| stubFor(any(urlMatching("/obsidianmd/obsidian-releases/releases/download/v\\d+\\.\\d+\\.\\d+/obsidian-.*-arm64\\.tar\\.gz")) | ||
| .willReturn(aResponse() | ||
| .withStatus(200) | ||
| .withBody(DOWNLOAD_CONTENT))); | ||
|
|
||
| UrlRepository urlRepository = UrlRepository.load(tempDir); | ||
| ObsidianUrlUpdater updater = new ObsidianUrlUpdater(wmRuntimeInfo.getHttpBaseUrl(), wmRuntimeInfo.getHttpBaseUrl()); | ||
|
|
||
| // act | ||
| update(updater, urlRepository); | ||
|
|
||
| // assert | ||
| List<String> expectedPlatforms = List.of("windows_x64", "mac_x64", "linux_x64"); | ||
| Path obsidianDir = tempDir.resolve("obsidian").resolve("obsidian"); | ||
| assertUrlVersion(obsidianDir.resolve("1.9.10"), expectedPlatforms); | ||
| assertUrlVersion(obsidianDir.resolve("1.10.6"), expectedPlatforms); | ||
| assertUrlVersion(obsidianDir.resolve("1.11.7"), expectedPlatforms); | ||
| assertUrlVersion(obsidianDir.resolve("1.12.7"), expectedPlatforms); | ||
| } | ||
| } |
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.