Skip to content

feat: install-script SHA-256 verification + Spring Boot starter integration tests#166

Merged
rlaope merged 1 commit into
masterfrom
feat/install-checksum-verify-and-starter-test
May 8, 2026
Merged

feat: install-script SHA-256 verification + Spring Boot starter integration tests#166
rlaope merged 1 commit into
masterfrom
feat/install-checksum-verify-and-starter-test

Conversation

@rlaope
Copy link
Copy Markdown
Owner

@rlaope rlaope commented May 8, 2026

Summary

Two post-release-housekeeping items folded into one PR.

install.sh / install.ps1: SHA-256 verification

PR #164 added a checksums.txt asset to every GitHub Release, but the install scripts were still downloading JARs without integrity checks. Now both scripts:

  1. Try to fetch checksums.txt from the release. If the release pre-dates 1.3.0 the file is missing; that case is handled with a clear "skipping integrity check" warning so legacy versions keep installing.
  2. After each JAR download, compute the local SHA-256 (via sha256sum / shasum / Get-FileHash) and compare against the entry for the corresponding original filename in checksums.txt. On mismatch the partial download is deleted and the installer aborts non-zero.

Spring Boot starter: real Spring-context integration tests

argus-spring-boot-starter previously only had pure-unit tests. New ArgusAutoConfigurationIntegrationTest uses Spring Boot Test's ApplicationContextRunner to assert:

  • @ConfigurationProperties binding from synthetic property sources (buffer-size, server.port, gc.enabled, profiling.interval-ms, contention.threshold-ms, nested metrics.*).
  • argus.enabled=false short-circuits the entire auto-configuration (no ArgusProperties / AgentConfig beans created).
  • The matchIfMissing=true default activates the auto-config when argus.enabled is unset.

To avoid JFR / ArgusServer startup side effects, the binding test loads only @EnableConfigurationProperties(ArgusProperties.class) rather than the full ArgusAutoConfiguration. This addresses the P2 follow-up identified in the v1.2.0 audit (#158).

Verification

  • bash -n install.sh → syntax OK
  • ./gradlew :argus-spring-boot-starter:test → BUILD SUCCESSFUL (3 new tests pass alongside existing 2)

Notes

The ApplicationContextRunner test approach was deliberately chosen over @SpringBootTest. The latter would require disabling the JFR streaming engine and the Argus server bean (which spawn threads on context refresh), and the existing @ConditionalOnProperty wiring at the bean level would need extending. ApplicationContextRunner gives the same Spring-binding coverage without that scope creep.

…ration tests

Two post-release-housekeeping items folded into one PR.

install.sh / install.ps1: SHA-256 verification of release artifacts.
After PR #164 added a checksums.txt asset to every GitHub Release,
the install scripts were still downloading JARs without checking
integrity. Now both scripts:

  1. Try to fetch checksums.txt from the release. If the release
     pre-dates 1.3.0, the file is missing; that case is handled by
     a clear "skipping integrity check" warning so old versions
     keep installing.
  2. After each JAR download (argus-agent.jar, argus-cli.jar),
     compute the local SHA-256 (via sha256sum / shasum / Get-FileHash)
     and compare against the entry for the corresponding original
     filename in checksums.txt. On mismatch the partial download is
     deleted and the installer aborts non-zero.

Spring Boot starter: real-context integration test alongside the
existing pure unit tests (ArgusAutoConfigurationTest /
ArgusPropertiesTest). The new ArgusAutoConfigurationIntegrationTest
uses Spring Boot Test's ApplicationContextRunner to:

  - Verify @ConfigurationProperties binding from synthetic property
    sources covering buffer-size, server.port, gc.enabled,
    profiling.interval-ms, contention.threshold-ms, and the nested
    metrics.* tree.
  - Verify argus.enabled=false short-circuits the entire
    auto-configuration (no ArgusProperties / AgentConfig beans
    created).
  - Verify the matchIfMissing=true default activates the
    auto-configuration when argus.enabled is unset.

To avoid the JFR / ArgusServer startup side effects, the binding
test loads only @EnableConfigurationProperties(ArgusProperties.class)
rather than the full ArgusAutoConfiguration. This addresses the P2
follow-up identified in the v1.2.0 audit (#158).

Build verified: ./gradlew :argus-spring-boot-starter:test → BUILD
SUCCESSFUL.

Signed-off-by: rlaope <piyrw9754@gmail.com>
@rlaope rlaope merged commit 75b0a1b into master May 8, 2026
7 checks passed
@rlaope rlaope deleted the feat/install-checksum-verify-and-starter-test branch May 8, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant