chore(server): use lib to call GitHub to list available versions#1920
Open
chore(server): use lib to call GitHub to list available versions#1920
Conversation
0b3a860 to
d733110
Compare
3 tasks
krzema12
reviewed
Apr 27, 2025
krzema12
reviewed
Apr 27, 2025
...al/src/test/kotlin/io/github/typesafegithub/workflows/shared/internal/model/GithubApiTest.kt
Show resolved
Hide resolved
6268bad to
9a774c9
Compare
Member
|
@LeoColman could you resolve conflicts? |
9a774c9 to
0766641
Compare
Member
Author
|
@krzema12 Done |
Member
|
The tests are failing, let me know if you need help figuring out why. |
- Replace manual HTTP client implementation with `kohsuke.github` library. - Simplify `fetchAvailableVersions` logic and remove redundant dependencies. - Refactor tests to use `kotest` with `MockServer` for more concise and structured testing. - Update dependencies and remove unused code.
bd7013e to
4a918ee
Compare
Member
|
Let me take it from here, thank you 🙇 |
krzema12
reviewed
May 17, 2025
| } | ||
| }.build() | ||
| val repository = github.getRepository("$owner/$name") | ||
| val apiTags = repository.getRefs("tags").refsStartingWithV().map { Version(it) } |
Member
There was a problem hiding this comment.
FTR, it turned out that the lib doesn't support matching-refs API: https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#list-matching-references. Even though it's easy to emulate, I'd like to try staying with it. I'll thus look at contributing support for it to the lib.
krzema12
reviewed
May 17, 2025
| response.body() | ||
| } | ||
| }.build() | ||
| val repository = github.getRepository("$owner/$name") |
Member
There was a problem hiding this comment.
FTR, it turned out that merely getting a reference to a repo makes another API call. I don't like it. I'll see how easy it is to disable this behavior in the lib.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
kohsuke.githublibrary.fetchAvailableVersionslogic and remove redundant dependencies.kotestwithMockServerfor more concise and structured testing.