Skip to content

Commit 7c98576

Browse files
committed
Make download size checks more permissive to rely on checksums
- Reduce Node.js minimum size from 15MB to 1MB (fixes Node.js 4.2.0 download) - Reduce Java minimum size from 100MB to 10MB for better compatibility - Reduce default minimum size from 1MB to 100KB - Size checks were causing false failures when checksums provide better validation - Checksums detect any corruption while size checks can have false positives - Magic byte validation already catches format issues (HTML, JSON responses) This fixes CI failures where older Node.js versions are smaller than expected.
1 parent 708d88f commit 7c98576

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

pkg/tools/base_tool.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ func (b *BaseTool) GetDefaultDownloadOptions() DownloadOptions {
389389
return DownloadOptions{
390390
FileExtension: ".tar.gz",
391391
ExpectedType: "application",
392-
MinSize: 1 * 1024 * 1024, // 1MB
393-
MaxSize: 100 * 1024 * 1024, // 100MB
392+
MinSize: 100 * 1024, // 100KB (very permissive, rely on checksums)
393+
MaxSize: 500 * 1024 * 1024, // 500MB (generous upper bound)
394394
ArchiveType: "tar.gz",
395395
}
396396
}

pkg/tools/constants.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import "time"
44

55
// Download Configuration Constants
66
const (
7-
// File size limits
8-
DefaultMinFileSize = 1024 // 1KB minimum file size
7+
// File size limits - very permissive since we rely on checksums for validation
8+
DefaultMinFileSize = 1024 // 1KB minimum file size (just to catch empty files)
99
DefaultMaxFileSize = 2147483648 // 2GB maximum file size
1010

1111
// Timeout defaults

pkg/tools/java.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ func (j *JavaTool) GetDownloadOptions() DownloadOptions {
409409
return DownloadOptions{
410410
FileExtension: ".tar.gz",
411411
ExpectedType: "application",
412-
MinSize: 100 * 1024 * 1024, // 100MB
413-
MaxSize: 500 * 1024 * 1024, // 500MB
412+
MinSize: 10 * 1024 * 1024, // 10MB (very permissive, rely on checksums)
413+
MaxSize: 800 * 1024 * 1024, // 800MB (generous upper bound)
414414
ArchiveType: "tar.gz",
415415
}
416416
}

pkg/tools/node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ func (n *NodeTool) GetDownloadOptions() DownloadOptions {
7777
return DownloadOptions{
7878
FileExtension: ".tar.xz",
7979
ExpectedType: "application",
80-
MinSize: 15 * 1024 * 1024, // 15MB (Node.js 18.17.0 is ~19.5MB)
81-
MaxSize: 80 * 1024 * 1024, // 80MB
80+
MinSize: 1 * 1024 * 1024, // 1MB (very permissive, rely on checksums)
81+
MaxSize: 200 * 1024 * 1024, // 200MB (generous upper bound)
8282
ArchiveType: "tar.xz",
8383
}
8484
}

0 commit comments

Comments
 (0)