Skip to content

Allows stack.yaml files to use !include directives#1

Draft
qxjit wants to merge 1 commit intomasterfrom
add-stack-yaml-includes
Draft

Allows stack.yaml files to use !include directives#1
qxjit wants to merge 1 commit intomasterfrom
add-stack-yaml-includes

Conversation

@qxjit
Copy link
Copy Markdown
Member

@qxjit qxjit commented Apr 7, 2026

This allows projects that maintain multiple stack.yaml files (e.g. for testing against multiple LTS versions) to reduce the duplication between them by using includes to share common parts.

!include may also be used in config.yaml files.

The use of !include interferes with the ability of the config set command to determine where to change a setting that has been read while parsing JSON, so thes makes config set raise error if !include appears in the file being updated.

Note: Fixes for the online documentation of the current Stack release
(https://docs.haskellstack.org/en/stable/) should target the 'stable' branch,
not the 'master' branch.

Please include the following checklist in your pull request:

  • Any changes that could be relevant to users have been recorded in ChangeLog.md.
  • The documentation has been updated, if necessary

Please also shortly describe how you tested your change. Bonus points for added tests!

Integration tests were added!

This allows projects that maintain multiple `stack.yaml` files (e.g.
for testing against multiple LTS versions) to reduce the duplication
between them by using includes to share common parts.

`!include` may also be used in  `config.yaml` files.

The use of `!include` interferes with the ability of the `config set`
command to determine where to change a setting that has been read while
parsing JSON, so thes makes `config set` raise error if `!include`
appears in the file being updated.
@OwenGraves
Copy link
Copy Markdown

OwenGraves commented Apr 7, 2026

I'm assuming this errors out if the include file can't be found right? Not sure if we want this as part of this pr, but I could imagine it being nice to allow an optional file to mimic something like a gitignored docker.compose.override.yaml but for a stack.yaml file, though I haven't thought through the implications much yet

A use case I could think of for this would be easily allowing our flipstone-prelude debug functions locally with the flag (if someone chooses to - I know I've wanted this enabled before for more easily testing certain things) but still always failing them on CI

@qxjit
Copy link
Copy Markdown
Member Author

qxjit commented Apr 8, 2026

@OwenGraves Yes it errors out. The yaml library doesn't have an option for optional includes.

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