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

feat: add Github repository adapter to fetch releases from Github #616

Merged
merged 9 commits into from
Jun 20, 2021

Conversation

skaldarnar
Copy link
Member

@skaldarnar skaldarnar commented Nov 15, 2020

This PR adds a repository adapter to fetch releases from Github. It will only consider releases tagged with a semver, and skip other releases. It derives whether the build is LWJGLv3 or not by comparing semvers (against v4.1.0-rc.1).

I've tested this with the latest two (preview) releases under Linux Mint.

image


Old PR description below. This is no longer required to test this PR.

In order to test the Github integration for fetching releases you'll need to build and publish hub4j/github-api#977 locally. To do that, run mvn clean install and the JAR should be published to the local maven cache where Gradle can grab it from.
Use mavenLocal() as additional repository in build.gradle and bump the version for org.kohsuke:github-api to 1.117-SNAPSHOT.

Without this patched library, fetching release assets requires a request for each release. As we have 52 of them right now and we're doing some more requests (e.g., to check whether there is a launcher update) this will eat up the free 60 requests per hour with the first start of the launcher...

Another option would be to lazily fetch the assets/download URL, but that we way cannot guarantee that the desired asset is present in the release... 🤔

This will currently run into rate limit problems as we need to do a new request for each release to get the artifacts. I've proposed a PR to hub4j/github-api to fix that.
Another option would be to lazily fetch the assets/download URL, but that we way cannot guarantee that the desired asset is present in the release.
@skaldarnar skaldarnar added the Type: Enhancement New features or noticable improvements. label Nov 15, 2020
@skaldarnar
Copy link
Member Author

hub4j/github-api#977 got merged so the technical blockers for this should be gone with the next release of the library 🤓

@skaldarnar skaldarnar marked this pull request as ready for review June 19, 2021 23:38
@skaldarnar skaldarnar requested review from jdrueckert and keturn and removed request for jdrueckert June 19, 2021 23:41
@@ -22,7 +21,7 @@
import java.util.stream.Collectors;

/**
* Repository adapter for http://jenkins.terasology.io, replacing the {@link LegacyJenkinsRepositoryAdapter}.
* Repository adapter for http://jenkins.terasology.io.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Repository adapter for http://jenkins.terasology.io.
* Repository adapter for https://jenkins.terasology.io.

Copy link
Member Author

Choose a reason for hiding this comment

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

Technically this adapter still connects to HTTP (I did not change this here, because it does not solve the problem). Should probably do that in another PR

https://github.com/MovingBlocks/TerasologyLauncher/pull/616/files/5f62c1782a256a55b594a9de9c2d829bf470733a#diff-0aa9f2a209932ac1aa89399ead549d10d3cea93f42394eafb59542b2f409ed93R36

Copy link
Member

Choose a reason for hiding this comment

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

okay, fair enough

Copy link
Member

@jdrueckert jdrueckert left a comment

Choose a reason for hiding this comment

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

There are a few code analysis findings you might want to address.
Also, the emojis don't work yet. But I guess we can have another look at that as a follow-up.

@jdrueckert jdrueckert merged commit f1ba9c0 into master Jun 20, 2021
@jdrueckert jdrueckert deleted the feature/releases-from-github branch June 20, 2021 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New features or noticable improvements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants