fix: emit task process type in release YAML for cf run-task support#1324
Open
stokpop wants to merge 1 commit into
Open
fix: emit task process type in release YAML for cf run-task support#1324stokpop wants to merge 1 commit into
stokpop wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the finalize phase to emit a task process type in the Cloud Foundry release YAML (alongside web) so cf run-task works without requiring an explicit --command, aligning behavior with other buildpacks.
Changes:
- Emit both
webandtaskunderdefault_process_typeswith identical commands inwriteReleaseYaml(). - Add tests asserting both process types are present and (intended to be) command-identical.
- Add documentation describing CF task usage and the
PropertiesLauncher/-Dloader.mainpattern.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/java/finalize/finalize.go | Adds task to default_process_types in generated release YAML. |
| src/java/finalize/finalize_test.go | Adds/updates tests to validate task emission and command equivalence. |
| docs/container-spring_boot.md | Documents CF task behavior and runtime main-class override guidance for Spring Boot apps. |
| docs/container-java_main.md | Documents CF task behavior and PropertiesLauncher/-Dloader.main override guidance for Java Main container. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ruby buildpack v4 declares both web and task in default_process_types. Go buildpack only declared web, causing cf run-task to fail with "command presence FAILED" when no --command is given. - Add task process type with same command as web, matching Ruby behaviour - Escape single quotes in command (YAML single-quoted scalar requires '') - Add tests: web+task both present, single-quote YAML round-trip (TDD) - Add docs: CF task usage for Spring Boot and Java Main containers, including PropertiesLauncher/-Dloader.main pattern for per-task class Closes cloudfoundry#1323
7615f23 to
22e272d
Compare
rkoster
reviewed
Jun 22, 2026
| // Create META-INF/MANIFEST.MF with corresponding content of a Spring Boot app | ||
| manifestFile := filepath.Join(buildDir, "META-INF", "MANIFEST.MF") | ||
| Expect(os.WriteFile(manifestFile, []byte("Spring-Boot-Version: 3.x.x"), 0644)).To(Succeed()) | ||
| Expect(os.WriteFile(manifestFile, []byte("Spring-Boot-Version: 4.x.x"), 0644)).To(Succeed()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cf run-taskfailed with "command presence FAILED" on Go buildpack v5while working on Ruby buildpack v4.77.0
webprocess type; Ruby declaresboth
webandtaskwith the same commandtasktodefault_process_typesinwriteReleaseYaml()'→''in YAML single-quoted scalar)container-spring_boot.md(with cross-reference)and
container-java_main.md(PropertiesLauncher pattern,--envCF CLI v7+)Test plan
go test ./src/java/...passescf run-taskwithout--commandworks on app staged with Go buildpackcf run-task --env JAVA_OPTS="-Dloader.main=..."works with PropertiesLauncherThe two unchecked items require manual CF verification. The Switchblade
integration test framework has no task API, so these cannot be automated
in the current test suite. The unit test for
writeReleaseYamlverifiesthe YAML output is correct; runtime behavior needs a live CF environment.
Fixes: #1323