Skip to content

Commit

Permalink
chore: clarify scope of configs in docs (#2976)
Browse files Browse the repository at this point in the history
  • Loading branch information
hspitzley-czi authored Jan 23, 2024
1 parent b91a9f4 commit 27519db
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
8 changes: 5 additions & 3 deletions docs/features/config.md → docs/commands/config.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
parent: Features
parent: Commands
layout: default
has_toc: true
---
Expand All @@ -10,9 +10,11 @@ One of the features of Happy allows you to manage application configuration valu

See `happy config -h` for usage information.

## Hierarchy of Configs
## Scope & Hierarchy of Configs

App configs are defined hierarchically where configs can be set at the environment level or at the stack level. Every stack inherits the configs of its parent environment and can be overridden at the stack level. For example, if you have an environment called `rdev` and a stack called `foo`, the `foo` stack will inherit all the configs of the `rdev` environment. When a config with the same key is defined in both the environment and the stack, the stack's config value will take precedence.
App configs are scoped to an app and environment (and sometimes a stack, see below). This uses the value of `app` from your config.json file and the value passed to the `--env` flag (or the default environment if no `--env` flag is passed). This means that you can have different configs for different environments of the same app, and configs for different apps will not conflict with each other (even when the apps are deployed to the same "happy-env" (as defined by the `happy-env-eks` Terraform module)).

App configs are defined hierarchically where configs can be set at the environment level or at the stack level for your app. Every stack inherits the configs of its parent environment and can be overridden at the stack level. For example, if you have an environment called `rdev` and a stack called `foo`, the `foo` stack will inherit all the configs of the `rdev` environment. When a config with the same key is defined in both the environment and the stack, the stack's config value will take precedence.

## V1

Expand Down
14 changes: 14 additions & 0 deletions docs/commands/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: default
title: Commands
has_children: true
nav_order: 6
---

# Commands

Happy has a number of commands that you can use to manage your application. You can see a list of all the commands by running `happy -h`. You can also get help for a specific command by running `happy <COMMAND> -h`.

For each command, the `.happy/config.json` file is used to determine which app to run the command against. If you do not specify an environment with the `--env` flag, the default environment is used. You can set the default environment by setting the `default_env` field in your `.happy/config.json` file.


13 changes: 0 additions & 13 deletions docs/features/index.md

This file was deleted.

0 comments on commit 27519db

Please sign in to comment.