17 Commits
Author SHA1 Message Date
005f7bef04 fix(build): respect configured deploy input filters (#562)
* Respect configured deploy inputs for config steps

When a config-defined step already has an explicit deploy input, Railpack should not append the implicit deploy output for the entire step. This preserves include filters such as Next.js standalone output selections and avoids copying the full build step into the final image.

Constraint: Config steps without explicit deploy inputs still need the existing implicit deploy output behavior.

Rejected: Change deploy input filter semantics globally | too broad for this bug and risks provider output behavior.

Confidence: medium

Scope-risk: moderate

Tested: go test ./core/generate -run 'TestHasInputForStep|TestGenerateContextKeepsConfiguredDeployInputFilters'

Tested: go test ./core/generate -run TestHasIncludeForStep

Tested: go test ./core/generate

Tested: git diff --check

* fix(generate): respect explicitly configured deploy inputs without implicit steps

- Prevent implicit deploy step outputs from being added when explicit deploy inputs are configured without a spread operator.
- Add comprehensive test coverage for various deploy input and output combinations.

Generated-by: aiautocommit

* feat(examples): respect configured deploy inputs

- Add `/usr/games` to runtime paths to support Debian's cowsay installation location in the config example.
- Assert that unrelated files do not leak through implicit deploy outputs.

Generated-by: aiautocommit

* refactor(generate): check configured deploy inputs for step

Generated-by: aiautocommit

---------

Co-authored-by: Michael Bianco <[email protected]>
2026-07-31 08:17:46 -06:00
652698eecb fix: assert empty stderr, trust mise in app dir (#352)
* test: assert empty stderr on successful integration tests

Add assertion to check that stderr is empty when integration tests pass
successfully. This helps catch unexpected warnings or error messages that
might indicate issues even when the test technically succeeds.

The check is added to runContainerWithTimeout which runs containers that
output expected strings. HTTP check tests are not affected since they
already validate correctness via HTTP requests and separating stderr
from detached containers is more complex.

* fix: add private field to example package.json files

Add "private": true to all example package.json files to suppress
package manager warnings about missing license fields. These are
test/example projects not meant to be published to npm registries.

This prevents stderr warnings like "warning package.json: No license
field" which were causing the new stderr assertion in integration tests
to fail even though the applications were running correctly.

Affected examples:
- All node-yarn-* examples
- node-npm, node-pnpm, node-bun examples
- config-file, mise-config examples
- Other node-based examples

* fix: trust mise config files in app directory

Add MISE_TRUSTED_CONFIG_PATHS=/app to automatically trust mise
configuration files in the application directory during builds.

This prevents trust warnings when MISE_PARANOID mode is enabled:
  "Trust them with \`mise trust\`. See https://mise.jdx.dev/cli/trust.html"

Since the app directory (/app) is the user's code being built,
it's safe to trust mise configuration files located there.

* test: add stderrAllowed option to skip stderr assertion

Add optional "stderrAllowed" field to test.json that defaults to false.
When set to true, skips the stderr empty assertion for tests where
stderr output is expected and normal.

This is useful for applications that log to stderr by default, such as
gunicorn which outputs info logs to stderr:
  [2025-11-18 18:13:50 +0000] [1] [INFO] Starting gunicorn 23.0.0
  [2025-11-18 18:13:50 +0000] [1] [INFO] Listening at: http://0.0.0.0:3333 (1)

Updated python-uv test to set stderrAllowed: true since it uses
gunicorn which logs to stderr.

* test: allow stderr for node-latest-npm-native-deps temporarily

Add stderrAllowed: true to node-latest-npm-native-deps test to handle
the NPM_CONFIG_PRODUCTION deprecation warning:
  "npm warn config production Use \`--omit=dev\` instead"

This is temporary and should be removed once NPM_CONFIG_PRODUCTION is
removed from core/providers/node/node.go:241 in a separate PR.

* test: allow stderr for npm production warning in additional tests

Add stderrAllowed: true to node-prisma, node-remix, and
node-npm-install-in-build test cases to temporarily allow the
npm warning about NPM_CONFIG_PRODUCTION being deprecated.

This is a temporary workaround until NPM_CONFIG_PRODUCTION is
removed from node.go in a separate PR.

* test: allow stderr for Bun console output

Bun routes console.log/console.error to stderr by default in
script mode. Add stderrAllowed: true to all Bun example tests
to allow this expected behavior.

* test: allow stderr for TanStack Start output

TanStack Start outputs to stderr during server startup.
Add stderrAllowed: true to allow this expected behavior.

* test: add approved builds to fix better-sqlite3 error

* test: snapshot update

* test: fix build warning, allow stderr for --omit warning for now

* docs: note that test.json are jsonc for AI

* test: snapshot update

* test: allow stderr for omit usage

---------

Co-authored-by: Hanzo Dev <[email protected]>
2025-11-20 15:33:10 -07:00
Michael BiancoandGitHub 2a3dd6825b fix: hard fail on invalid railpack.json (#226)
* fix: hard fail if railpack.json cannot be parsed

* test: add shouldFail test.json expression

helpful if we expect the build to fail. There shouldn't be too many of these, but we'll need at least
a couple to make sure cases like railpack.json syntax errors hard fail.

* test: bad json syntax failure

* test: config file abs path, relative, and DNE cases

* refactor: move hujson helper into internal helpers

* fix: support abs config file path, fail if config file path does not exist

* fix: document relative config file path, no abs config file support

* fix: invalid config json

* test: snapshot update

* test: remove abs file config test

* test: remove custom java config

I know basically nothing about Java and after I fixed the syntax error which was causing this config file to not be picked up, this started failing. The proper Zulu version check which is the main purpose of this is still working fine so I think it's fine to remove these custom commands.

* fix: typo

* test: snapshot update
2025-09-09 19:09:46 -06:00
Jake RunzerandGitHub d8f31b4589 Custom config step deploy outputs (#118)
* rename plan inputs to layers and use deploy base layer

* runtime deps installed

* step builders can create multiple steps

* support config step deploy outputs

* optimize when we merge vs copy layers

* update snapshots

* validate the deploy layers

* fix tests

* dont add mise if no packages

* fix pruning for php

* update layer merging and snapshot tests

* dont include mise commands or variables if no packages

* update docs

* update snapshots and normalization

* add guide for adding custom steps

* support .node-version file

* fix compile errors

* update snapshot tests
2025-04-01 13:33:30 -04:00
Jake Runzer 6857e41999 warn if the config file is invalid 2025-03-07 18:44:34 -05:00
Jake Runzer 39bd9ce763 update file docs with schema info 2025-03-05 20:12:23 -05:00
Jake Runzer e2028e93bd update examples 2025-03-04 00:42:29 -05:00
Jake Runzer 1e55644f88 slice spreading 2025-03-04 00:39:55 -05:00
Jake Runzer 3d945c0f17 only allow setting a single provider 2025-02-24 10:23:54 -05:00
Jake Runzer cdff6a90ba fix node and config file test 2025-02-23 23:03:46 -05:00
Jake Runzer 95f5da883b fix config file test 2025-02-23 22:29:10 -05:00
Jake Runzer 08fadd3305 support parsing jsonc files with app 2025-02-19 18:54:39 -05:00
Jake Runzer e58f615a06 support custom config file path 2025-02-16 20:12:26 -05:00
Jake Runzer 333fbd7c60 add tests and optimize caches 2025-02-15 19:01:07 -05:00
Jake Runzer 97b1cbff09 provider detect mechanism 2025-01-28 03:20:55 -05:00
Jake Runzer f9103d6bf3 cleanup config merge 2025-01-27 23:24:38 -05:00
Jake Runzer 9c7b3e5844 use railpack.json config file 2025-01-27 23:06:58 -05:00