Commit b87f1ee
chore(autorag+automl): improvements - S3 timeout error handling + FileExplorer UX (#7219)
* chore(autorag+automl): S3 timeout error handling improvements
Functional changes:
- Add 10s connect/TLS timeout to S3 HTTP client via custom transport
so unreachable endpoints (air-gapped, misconfigured) fail fast
instead of hanging until the OpenShift route 30s gateway timeout.
- Set RetryMaxAttempts=1 on the AWS config to avoid compounding
the timeout on dead endpoints.
- Add isS3ConnectivityError() to classify net.Error timeouts,
net.OpError, and net.DNSError as connectivity failures.
- Add s3ConnectivityErrorMessage() to return a user-facing 503
message explaining the likely cause and remediation steps.
- Wire connectivity error detection into all S3 handlers
(GetS3File, PostS3File, GetS3Files, GetS3FileSchema) so they
return 503 with the actionable message instead of a generic 500.
Test coverage:
- isS3ConnectivityError: 9-case table-driven test covering timeout,
OpError, DNSError, wrapped variants, nil, and non-connectivity
errors (access denied).
- s3ConnectivityErrorMessage: asserts bucket name and key phrases
appear in the message.
- Handler-level 503 tests: GetS3File, GetS3Files, PostS3File
(on key resolution), and PostS3File (on upload) all return 503
with the connectivity error message when the S3 endpoint is
unreachable.
- s3ConnectTimeout constant: asserts the value is 10s.
- NewRealS3Client: verifies client construction succeeds with
the new timeout-aware HTTP transport.
All changes are mirrored across both automl and autorag BFFs.
Generated-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
* chore: Add UI handling + tests
Generated-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
* chore: Add UI fix for view details (minor issue)
Generated-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
* chore: PR feedback
automl: Add TestGetS3FileSchemaHandler_ConnectivityError_Returns503 to
exercise the 503 branch when GetCSVSchema hits an unreachable S3
endpoint. Added GetCSVSchema override to connectivityErrorS3Client.
automl+autorag: Extract buildS3AWSConfig() from NewRealS3Client so
RetryMaxAttempts can be directly asserted in tests. The AWS SDK does
not expose RetryMaxAttempts on the constructed *s3.Client, so the
previous test could only verify client creation — not the config value.
The extracted function returns the raw aws.Config, enabling a real
assertion (cfg.RetryMaxAttempts == 1) without DNS or network
dependencies.
Rename TestNewRealS3Client_SetsRetryMaxAttemptsToOne to
TestNewRealS3Client_CreatesClientWithValidCredentials and switch
endpoint to a literal IP to remove DNS dependency.
Generated-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
* chore: PR feedback
Add net.ErrClosed sentinel check to isS3ConnectivityError() in both
automl and autorag BFFs. A closed keep-alive socket can surface as
net.ErrClosed without a *net.OpError wrapper, causing it to fall
through to a 500 instead of the intended 503. The new check catches
both direct and wrapped net.ErrClosed errors.
Includes unit tests for both direct and wrapped net.ErrClosed cases
in both packages.
Generated-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
* chore: PR feedback
Add per-call context deadlines (s3MetadataTimeout = 15s) on read-only
S3 handler operations to bound the response-header phase. net/http's
WriteTimeout sets a conn deadline but does NOT cancel r.Context(), so
if an S3 endpoint accepts the TCP connection but never sends response
headers, metadata calls could hang indefinitely. File-transfer handlers
(GetObject, UploadObject) are intentionally excluded because legitimate
large payloads can exceed any static timeout.
Handlers protected:
- autorag: GetS3FilesHandler (ListObjects)
- automl: GetS3FilesHandler (ListObjects), GetS3FileSchemaHandler (GetCSVSchema)
Tests added:
- Positive: verify ListObjects/GetCSVSchema receive a deadline-aware context
- Negative: verify GetObject does NOT get a handler-imposed deadline
Generated-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
* chore: Self PR review
Generated-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
* chore: PR feedback
- isS3ConnectivityError: add context.DeadlineExceeded as first check
so metadata timeouts produce 503; narrow net.OpError to dial-only
- PostS3FileHandler: wrap resolveNonCollidingS3Key with s3MetadataTimeout
- client.go: remove dead HTTPClient from buildS3AWSConfig, consolidate
s3ConnectTimeout dial/TLS settings into NewRealS3Client transport
- client_test.go: replace constant self-assertion test with transport
inspection (TestNewRealS3Client_TransportHasConnectTimeout)
- s3_handler_test.go: add DeadlineExceeded and OpError{write} test
cases, update upload mock from Op:"write" to Op:"dial", add
TestPostS3FileHandler_SetsMetadataTimeoutForResolveKey
- autorag s3_handler.go: reorder declarations (constants/types first)
- FileExplorer.spec.tsx: scope dropdown assertions with within() and
role-based queries instead of global screen.queryByText
All changes applied symmetrically to both automl and autorag packages.
Generated-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* chore: PR feedback
Generated-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
* chore: PR feedback
Generated-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
* chore: make fmt
* chore: PR feedback
- Hide "View details" kebab action when file is already being viewed
- Add "Select file"/"Select folder" kebab action for unselected items
- Delegate onRemoveSelection to parent handler to clear filesToView
- Add table row kebab actions test suite (7 tests)
- Fix eye icon test that relied on redundant "View details" click
Generated-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1c9bfb5 commit b87f1ee
16 files changed
Lines changed: 1595 additions & 88 deletions
File tree
- packages
- automl
- bff/internal
- api
- integrations/s3
- frontend/src/app/components/common
- FileExplorer
- __tests__
- S3FileExplorer
- __tests__
- autorag
- bff/internal
- api
- integrations/s3
- frontend/src/app/components/common
- FileExplorer
- __tests__
- S3FileExplorer
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
| |||
170 | 181 | | |
171 | 182 | | |
172 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
173 | 220 | | |
174 | 221 | | |
175 | 222 | | |
| |||
218 | 265 | | |
219 | 266 | | |
220 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
221 | 273 | | |
222 | 274 | | |
223 | 275 | | |
| |||
279 | 331 | | |
280 | 332 | | |
281 | 333 | | |
282 | | - | |
283 | 334 | | |
284 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
285 | 338 | | |
286 | 339 | | |
287 | 340 | | |
288 | 341 | | |
289 | 342 | | |
290 | 343 | | |
291 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
292 | 349 | | |
293 | 350 | | |
294 | 351 | | |
| |||
356 | 413 | | |
357 | 414 | | |
358 | 415 | | |
359 | | - | |
| 416 | + | |
360 | 417 | | |
361 | 418 | | |
362 | 419 | | |
| |||
371 | 428 | | |
372 | 429 | | |
373 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
374 | 435 | | |
375 | 436 | | |
376 | 437 | | |
| |||
560 | 621 | | |
561 | 622 | | |
562 | 623 | | |
563 | | - | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
564 | 627 | | |
565 | 628 | | |
566 | 629 | | |
| |||
595 | 658 | | |
596 | 659 | | |
597 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
598 | 666 | | |
599 | 667 | | |
600 | 668 | | |
| |||
637 | 705 | | |
638 | 706 | | |
639 | 707 | | |
640 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
641 | 711 | | |
642 | 712 | | |
643 | 713 | | |
| |||
657 | 727 | | |
658 | 728 | | |
659 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
660 | 735 | | |
661 | 736 | | |
662 | 737 | | |
| |||
0 commit comments