davsclaus opened a new pull request, #30124:
URL: https://github.com/apache/camel/pull/30124
## What
Items 10 and 8 of CAMEL-27004 (split from CAMEL-26914):
- **Examples from GitHub** (`camel run --example`, and examples in the TUI):
`ExampleHelper.downloadGithubExample` skipped every file that GitHub did not
answer with 200, such as at a rate limit (403/429) or with a 404, and the
example **ran without it, without a word**. Now the download fails with the URL
and the status (and a rate-limit hint for 403/429), and removes the files it
had already downloaded. `camel run` already prints that failure ("Failed to
fetch example from GitHub: ...") and exits with 1. The TUI shows it in its
notification.
- **Quarkus platforms offline**: `QuarkusHelper.fetchPlatformStreams`
refreshes the platform list once a day. When that refresh could not reach the
registry or got an error status, the command failed, such as `camel export
--runtime=quarkus` offline or behind a proxy, **although yesterday's copy was
in the cache**. Now that copy is used, with a WARN line saying why and from
which day. With `--fresh` it still fails, as that option asks for the registry
only. Without a cache it fails as before.
- Both requests now also limit how long the response body may take
(`sendAsync` + `get(timeout)`), as #29804 did for GitHub:
`HttpRequest.timeout()` only covers the headers, so a server that stalled after
the headers hung the command. This is part of item 3, for these two requests.
## Tests
- `ExampleHelperDownloadTest` (new, local `HttpServer`):
- every file is downloaded
- a 404 fails the download and leaves no folder behind
- a 429 says it's a rate limit
- a stalled body times out
- `QuarkusHelperTest`, 4 new tests:
- the stale cache is used on an HTTP 500
- the stale cache is used on a connection reset
- without a cache it still fails
- `--fresh` doesn't use the stale cache
The two stale-cache tests fail on the old code.
- The full `camel-jbang-run` (345) and `camel-jbang-core` (3082 + 269)
suites pass, run through the reactor.
_Claude Code on behalf of Claus Ibsen (davsclaus)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]