Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 16 additions & 51 deletions RUBY_VS_GO_BUILDPACK_COMPARISON.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,9 @@ cf set-env myapp JBP_CONFIG_TOMCAT '{tomcat: {version: 10.1.+}}'
cf set-env myapp JBP_CONFIG_TOMCAT '{external_configuration_enabled: true, external_configuration: {version: "1.0.0"}}'
```

#### External Configuration: Different Approaches
#### External Configuration:

**Ruby Buildpack**: Runtime repository_root override ✅
Both buildpacks support repository_root override ✅

```bash
# ✅ Works: Specify custom repository at runtime
Expand All @@ -566,37 +566,6 @@ cf set-env myapp JBP_CONFIG_TOMCAT '{
}'
```

**Implementation**:
```ruby
# Ruby buildpack fetches index.yml from repository_root at staging time
def compile
download(@version, @uri) { |file| expand file } # Downloads from repository_root
end
```

**Go Buildpack**: Manifest-only configuration ⚠️

```bash
# ❌ DOES NOT WORK: repository_root via environment variable not supported
cf set-env myapp JBP_CONFIG_TOMCAT '{external_configuration_enabled: true, ...}'
```

**Required approach**:
1. Fork buildpack
2. Add external configuration to `manifest.yml`:
```yaml
dependencies:
- name: tomcat-external-configuration
version: 1.0.0
uri: https://my-repo.example.com/tomcat-config-1.0.0.tar.gz
sha256: abc123...
cf_stacks:
- cflinuxfs4
```
3. Package and upload custom buildpack

**Why the difference**: Go buildpack prioritizes security (mandatory SHA256 verification) and reproducibility (same manifest = same configs) over runtime flexibility.

### 2A.5 Access Logging Configuration

#### Default Behavior: Disabled (Parity)
Expand Down Expand Up @@ -1241,13 +1210,13 @@ func (s *SpringBootCLIContainer) Detect() (string, error) {

### 3.1 Cloud Foundry API Versions

| Aspect | Ruby (V2 API) | Go (V3 API) |
|--------|---------------|-------------|
| **Phases** | detect → compile → release | detect → supply → finalize |
| **Multi-buildpack** | Not supported (needs workarounds) | Native support (multiple supply phases) |
| Aspect | Ruby (V2 API) | Go (V3 API) |
|--------|---------------|--------------------------------------------|
| **Phases** | detect → compile → release | detect → supply → finalize -> release |
| **Multi-buildpack** | Not supported (needs workarounds) | Native support (multiple supply phases) |
| **Entrypoints** | `bin/detect`, `bin/compile`, `bin/release` | `bin/detect`, `bin/supply`, `bin/finalize` |
| **State Management** | Droplet object (in-memory) | Files in `/deps/<idx>/` (persistent) |
| **Caching** | `$CF_BUILDPACK_BUILDPACK_CACHE` | Same + `/deps/<idx>/` for dependencies |
| **State Management** | Droplet object (in-memory) | Files in `/deps/<idx>/` (persistent) |
| **Caching** | `$CF_BUILDPACK_BUILDPACK_CACHE` | Same + `/deps/<idx>/` for dependencies |

### 3.2 Phase Responsibilities

Expand Down Expand Up @@ -1723,8 +1692,6 @@ func (t *Tomcat) Supply() error {

**Key difference**: The Go buildpack **initially forgot to use strip_components**, requiring helper functions like `findTomcatHome()`. The correct approach is to use `crush.Extract()` with `strip=1` parameter (similar to Ruby's `--strip 1`).

See detailed analysis: `/ruby_vs_go_buildpack_comparison.md` (the OLD document focuses on this specific issue).

### 5.3 Caching Strategies

| Aspect | Ruby Buildpack | Go Buildpack |
Expand All @@ -1741,13 +1708,13 @@ See detailed analysis: `/ruby_vs_go_buildpack_comparison.md` (the OLD document f

### 6.1 Test Framework Comparison

| Aspect | Ruby Buildpack | Go Buildpack |
|--------|---------------|--------------|
| **Unit Test Framework** | RSpec | Go testing + Gomega assertions |
| **Integration Tests** | Separate repo (java-buildpack-system-test) | In-tree (src/integration/) |
| **Test Runner** | Rake tasks | Switchblade framework |
| **Platforms** | Cloud Foundry only | CF + Docker (with GitHub token) |
| **Total Tests** | ~300+ specs | ~100+ integration tests |
| Aspect | Ruby Buildpack | Go Buildpack |
|--------|---------------|---------------------------------------|
| **Unit Test Framework** | RSpec | Go testing + Gomega assertions |
| **Integration Tests** | Separate repo (java-buildpack-system-test) | In-tree (src/integration/) |
| **Test Runner** | Rake tasks | Switchblade framework |
| **Platforms** | Cloud Foundry only | CF + Docker (with GitHub token) |
| **Total Tests** | ~300+ specs | ~800+ integration tests |
| **Test Apps** | External repo (java-test-applications) | Embedded in src/integration/testdata/ |

### 6.2 Test Organization
Expand Down Expand Up @@ -2313,8 +2280,6 @@ The Go-based Java buildpack is a **production-ready, feature-complete** migratio
## Appendix B: Further Reading

- **ARCHITECTURE.md** - Detailed Go buildpack architecture
- **comparison.md** - Component-by-component feature parity analysis
- **ruby_vs_go_buildpack_comparison.md** - OLD document (focused on dependency extraction only, outdated)
- **docs/custom-jre-usage.md** - Guide for custom JRE repositories in Go buildpack
- **docs/DEVELOPING.md** - Development workflow and testing
- **docs/IMPLEMENTING_FRAMEWORKS.md** - Framework implementation guide
Expand All @@ -2323,5 +2288,5 @@ The Go-based Java buildpack is a **production-ready, feature-complete** migratio
---

**Document Version**: 1.0
**Last Updated**: January 5, 2026
**Last Updated**: May 20, 2026
**Authors**: Cloud Foundry Java Buildpack Team
7 changes: 4 additions & 3 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ dependencies:
sha256: e024103719ffa99a011607942ecddfd91c5681113e6cea27f5514bc9fa172875
cf_stacks:
- cflinuxfs4
- cflinuxfs5
- name: mariadb-jdbc
version: 3.5.8
uri: https://buildpacks.cloudfoundry.org/dependencies/mariadb-jdbc/mariadb-jdbc_3.5.8_linux_noarch_any-stack_6127dc78.jar
Expand Down Expand Up @@ -592,7 +593,7 @@ dependencies:
sha256: b3452d5ffbf0652e0f44958a5cb306a961906280102e5fa1a15840d2ddb6bcc1
cf_stacks:
- cflinuxfs4
- cflinuxfs3
- cflinuxfs5
source: https://repo1.maven.org/maven2/org/cloudfoundry/tomcat-access-logging-support/3.4.0.RELEASE/tomcat-access-logging-support-3.4.0.RELEASE.jar
source_sha256: b3452d5ffbf0652e0f44958a5cb306a961906280102e5fa1a15840d2ddb6bcc1
- name: tomcat-lifecycle-support
Expand All @@ -601,7 +602,7 @@ dependencies:
sha256: 3861d32a91b58302fa936d6f84354e1874f71e59dd97b003efcc992a5a6f3c47
cf_stacks:
- cflinuxfs4
- cflinuxfs3
- cflinuxfs5
source: https://repo1.maven.org/maven2/org/cloudfoundry/tomcat-lifecycle-support/3.4.0.RELEASE/tomcat-lifecycle-support-3.4.0.RELEASE.jar
source_sha256: 3861d32a91b58302fa936d6f84354e1874f71e59dd97b003efcc992a5a6f3c47
- name: tomcat-logging-support
Expand All @@ -610,7 +611,7 @@ dependencies:
sha256: 07de9efe8dda4c67dec6183ec1d59953abf1372cd71fe276fc4598739bd70667
cf_stacks:
- cflinuxfs4
- cflinuxfs3
- cflinuxfs5
source: https://repo1.maven.org/maven2/org/cloudfoundry/tomcat-logging-support/3.4.0.RELEASE/tomcat-logging-support-3.4.0.RELEASE.jar
source_sha256: 07de9efe8dda4c67dec6183ec1d59953abf1372cd71fe276fc4598739bd70667
- name: your-kit-profiler
Expand Down