Make --forge-type skip network detection for custom hosts#83
Merged
Conversation
Closed
|
This appears to work almost correctly The open server is still detected When type is omitted the message telling to use type is produced: but only with type provided connection error is reported, connection error should take priority Finally when the connection to the correct network is established some repositories are listed (50/174) |
Contributor
Author
|
Updated, thanks for the feedback |
|
This appears to work correctly Thanks! |
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.
Fixes #80, fixes #84.
--forge-typewas only used to pick a default hostname (gitea->codeberg.org); it never reachednewClient, which only consulted the config file'stype =entry before falling back to network probing. So--host src.suse.de --forge-type giteastill probedhttps://src.suse.deand failed when the server was unreachable or didn't expose the detection endpoints.newClientnow checks aforgeTypeOverride(set from--forge-typeinPersistentPreRun) before the config file, so an explicit--forge-typeregisters the right client for any--hostor git-remote domain without probing. This flows throughForgeForDomainandresolve.Repo, so it covers every command. The type switch is pulled out intoforgeForTypeand now also handlesgithubfor GHE hosts.Two follow-ups raised on this PR are also folded in:
DetectForgeTypediscarded the transport error from the initial header probe and fell through to API probes that failed the same way, so an unreachable host produced onlycould not detect forge type for https://...with no hint that it was a DNS or connection failure. The header-probe error is now wrapped and returned directly, and the resolve-layer error suggests--forge-typeor configtype =as a way to skip detection.Gitea pagination loops broke on
len(results) < perPage, but Gitea clamps the page size toMAX_RESPONSE_ITEMS(default 50), so--limit 1000returned one clamped page and stopped. All paginated gitea calls now use a sharedlastPage()that reads the SDK-parsedLinkheaders when present and falls back to the short-page heuristic, withpageSize()capping requests at 50. Covers repos, branches, issues, PRs, releases, labels, milestones, notifications, collaborators, deploy keys, secrets, reviews, forks, and CI runs.