Skip to content

Add git response max length#6190

Merged
pditommaso merged 6 commits intomasterfrom
git-max-length
Jul 6, 2025
Merged

Add git response max length#6190
pditommaso merged 6 commits intomasterfrom
git-max-length

Conversation

@pditommaso
Copy link
Member

@pditommaso pditommaso commented Jun 17, 2025

This pull request introduces a new exception, HttpResponseLengthExceedException, to enforce a maximum allowed HTTP response size in the RepositoryProvider class. It also enhances the SysEnv utility to support retrieving integer and long environment variables, and adds comprehensive unit tests for these changes.

New Exception Handling for HTTP Response Size:

  • New Exception Class: Added HttpResponseLengthExceedException to handle cases where an HTTP response exceeds a configurable maximum size. (modules/nextflow/src/main/groovy/nextflow/exception/HttpResponseLengthExceedException.groovy)
  • Integration in RepositoryProvider:
    • Introduced the checkMaxLength method in RepositoryProvider to validate the Content-Length header of HTTP responses against the environment variable NXF_GIT_RESPONSE_MAX_LENGTH. (modules/nextflow/src/main/groovy/nextflow/scm/RepositoryProvider.groovy) [1] [2]
    • Updated imports to include the new exception. (modules/nextflow/src/main/groovy/nextflow/scm/RepositoryProvider.groovy)

Enhancements to SysEnv Utility:

  • New Methods: Added getInteger and getLong methods to retrieve integer and long values from environment variables with optional default values. (modules/nf-commons/src/main/nextflow/SysEnv.groovy)

Unit Tests:

  • Testing checkMaxLength: Added unit tests to validate the behavior of checkMaxLength under various scenarios, including when the maximum length is disabled, not set, or exceeded. (modules/nextflow/src/test/groovy/nextflow/scm/RepositoryProviderTest.groovy)
  • Testing SysEnv Enhancements: Added unit tests for the new getInteger and getLong methods to ensure correct parsing of environment variables. (modules/nf-commons/src/test/nextflow/SysEnvTest.groovy)

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso
Copy link
Member Author

Tagging @swingingsimian for visibility

@netlify
Copy link

netlify bot commented Jun 17, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit bafeae8
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/686a78b26d4591000846be94

@pditommaso pditommaso marked this pull request as draft June 17, 2025 09:05
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso marked this pull request as ready for review July 6, 2025 13:01
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso
Copy link
Member Author

Documentation for NXF_GIT_RESPONSE_MAX_LENGTH was not added intentionally because it's only meant to be used internally

@pditommaso pditommaso merged commit 098fe84 into master Jul 6, 2025
9 checks passed
@pditommaso pditommaso deleted the git-max-length branch July 6, 2025 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants