Uh oh!
There was an error while loading. Please reload this page.
chore(server): use lib to call GitHub to list available versions - #1920
chore(server): use lib to call GitHub to list available versions#1920LeoColman wants to merge 5 commits into
Conversation
0b3a860 to
d733110CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
6268bad to
9a774c9Comparekrzema12
commented
May 13, 2025
@LeoColman could you resolve conflicts? |
9a774c9 to
0766641CompareLeoColman
commented
May 14, 2025
@krzema12 Done |
krzema12
commented
May 15, 2025
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
4a918eeComparekrzema12
commented
May 17, 2025
Let me take it from here, thank you 🙇 |
| } | ||
| }.build() | ||
| val repository = github.getRepository("$owner/$name") | ||
| val apiTags = repository.getRefs("tags").refsStartingWithV().map { Version(it) } |
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.
| response.body() | ||
| } | ||
| }.build() | ||
| val repository = github.getRepository("$owner/$name") |
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.
kohsuke.githublibrary.fetchAvailableVersionslogic and remove redundant dependencies.kotestwithMockServerfor more concise and structured testing.