Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(server): use lib to call GitHub to list available versions#1920

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
LeoColman wants to merge5 commits intomain
base:main
Choose a base branch
Loading
from1884-use-a-lib-to-interact-with-github

Conversation

LeoColman
Copy link
Member

  • Replace manual HTTP client implementation withkohsuke.github library.
  • SimplifyfetchAvailableVersions logic and remove redundant dependencies.
  • Refactor tests to usekotest withMockServer for more concise and structured testing.
  • Update dependencies and remove unused code.

@LeoColmanLeoColmanforce-pushed the1884-use-a-lib-to-interact-with-github branch 2 times, most recently from0b3a860 tod733110CompareApril 25, 2025 23:27
@LeoColmanLeoColman linked an issueApr 26, 2025 that may beclosed by this pull request
3 tasks
@LeoColmanLeoColmanforce-pushed the1884-use-a-lib-to-interact-with-github branch 2 times, most recently from6268bad to9a774c9CompareMay 12, 2025 18:09
@krzema12
Copy link
Member

@LeoColman could you resolve conflicts?

@LeoColmanLeoColmanforce-pushed the1884-use-a-lib-to-interact-with-github branch from9a774c9 to0766641CompareMay 14, 2025 21:22
@LeoColman
Copy link
MemberAuthor

@krzema12 Done

@krzema12
Copy link
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 redundantdependencies.- Refactor tests to use `kotest` with `MockServer` for more concise andstructured testing.- Update dependencies and remove unused code.
@LeoColmanLeoColmanforce-pushed the1884-use-a-lib-to-interact-with-github branch frombd7013e to4a918eeCompareMay 16, 2025 00:51
@krzema12
Copy link
Member

Let me take it from here, thank you 🙇

@krzema12krzema12 changed the titlerefactor(server): simplify GitHub API usagechore(server): use lib to call GitHub in some use casesMay 17, 2025
@krzema12krzema12 changed the titlechore(server): use lib to call GitHub in some use caseschore(server): use lib to call GitHub to list available versionsMay 17, 2025
}
}.build()
val repository = github.getRepository("$owner/$name")
val apiTags = repository.getRefs("tags").refsStartingWithV().map { Version(it) }
Copy link
Member

Choose a reason for hiding this comment

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

FTR, it turned out that the lib doesn't supportmatching-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")
Copy link
Member

Choose a reason for hiding this comment

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

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@krzema12krzema12krzema12 left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Use a lib to interact with GitHub
2 participants
@LeoColman@krzema12

[8]ページ先頭

©2009-2025 Movatter.jp