Skip to content

docs(cf-env): add Spring Boot 4.x test coverage and improve docs#1341

Open
stokpop wants to merge 3 commits into
cloudfoundry:mainfrom
stokpop:fix/cf-env-spring-boot-4x
Open

docs(cf-env): add Spring Boot 4.x test coverage and improve docs#1341
stokpop wants to merge 3 commits into
cloudfoundry:mainfrom
stokpop:fix/cf-env-spring-boot-4x

Conversation

@stokpop

@stokpop stokpop commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds missing test coverage, improves docs, and fixes a misleading log line. No functional code changes to the cf-env detection or installation logic.

Changes

Tests

  • Add detection tests for Spring Boot 4.1 across all layouts (BOOT-INF/lib, lib/, WEB-INF/lib, META-INF/MANIFEST.MF)
  • Condense Spring Boot 3.x tests — layout variants now covered by 4.x tests

Docs (docs/framework-java-cfenv.md)

  • Update detection criterion to cover both SB 3.x and 4.x
  • Add version mapping table: SB 3.x → cfenv 3.x, SB 4.x → cfenv 4.x
  • Clarify cloud Spring profile is activated by the java-cfenv library at runtime, not the buildpack
  • Add JBP_CONFIG_JAVA_CF_ENV configuration section with enable/disable/unset examples and when to disable

Logging fix (src/java/supply/supply.go)

  • frameworkVersionSuffix now shows (default: X.Y.Z) instead of (X.Y.Z), making clear this is the manifest default version — not necessarily what gets installed (relevant for java-cfenv which selects 3.x or 4.x based on detected Spring Boot version)

Before:

Installing Java CF Env (3.5.1)

After:

Installing Java CF Env (default: 3.5.1)

Please review if complete or must be extended.

stokpop added 2 commits July 1, 2026 09:42
- Add detection tests for SB 4.0 and 4.1 (BOOT-INF/lib, lib/, WEB-INF/lib, MANIFEST.MF)
- Update detection criterion to cover both SB 3.x and 4.x
- Add version mapping table: SB 3.x → cfenv 3.x, SB 4.x → cfenv 4.x
- Clarify cloud profile is activated by the library at runtime, not the buildpack
- Add JBP_CONFIG_JAVA_CF_ENV configuration section with enable/disable examples
- Document when to disable (manual VCAP_SERVICES handling, unwanted cloud profile, conflicts)
… log

- frameworkVersionSuffix now shows '(default: X.Y.Z)' instead of '(X.Y.Z)'
  making clear this is the manifest default, not necessarily the installed version
- Reverts java-cfenv DependencyIdentifier back to 'java-cfenv' (no hack needed)
- Removes extra Info log from JavaCfEnvFramework.Supply()
Result: single 'Installing Java CF Env (default: 3.5.1)' line; actual
installed version visible from libbuildpack install line

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Java CF Env framework documentation and tests to explicitly cover Spring Boot 4.x detection scenarios, and tweaks framework install logging to clarify that the printed version is the manifest default (not necessarily the resolved/installed version).

Changes:

  • Add/shift detection tests to cover Spring Boot 4.1.x across common layouts (BOOT-INF/lib, WEB-INF/lib, lib/, manifest).
  • Improve framework-java-cfenv.md to document Spring Boot 3.x/4.x support, version mapping, and JBP_CONFIG_JAVA_CF_ENV usage.
  • Adjust framework install log suffix to display (default: X.Y.Z) instead of (X.Y.Z).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/java/supply/supply.go Clarifies install log output by labeling the manifest version as the default.
src/java/frameworks/java_cf_env.go Minor whitespace cleanup in supply logic.
src/java/frameworks/java_cf_env_test.go Updates/extends detection tests to cover Spring Boot 4.1.x layouts and adds a DependencyIdentifier assertion.
docs/framework-java-cfenv.md Documents SB 3.x/4.x support, version mapping, profile behavior, and configuration examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/framework-java-cfenv.md Outdated
Comment thread docs/framework-java-cfenv.md
Comment thread docs/framework-java-cfenv.md
- Add cf restage to set-env/unset-env examples; buildpack only
  re-reads JBP_CONFIG_JAVA_CF_ENV during staging
- Fix CloudFoundry -> Cloud Foundry, detail -> details
- Add trailing newline

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread src/java/supply/supply.go
}

return fmt.Sprintf(" (%s)", dependency.Version)
return fmt.Sprintf(" (default: %s)", dependency.Version)
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.

2 participants