Skip to content
Open
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
73 changes: 73 additions & 0 deletions birdhouse/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,79 @@ In order to set up the development environment, run the following commands:
# Activate the conda environment
conda activate birdhouse-dev


Development Conventions
^^^^^^^^^^^^^^^^^^^^^^^
Comment on lines +407 to +408
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like all of this should be in https://github.com/bird-house/birdhouse-deploy/blob/master/CONTRIBUTING.rst instead. Cross-referencing to it here should be sufficient.


The aim should be to **avoid** backward **incompatible** changes to decrease manual effort between each
update. When the effort is low, users will be more likey to stay up to date and not "fear" updates.

We should also aim to be **user-friendly** by being consistent with the way we grow the platform and by
requiring as little setup/steps (sensible default values) as possible when spin up a fresh new stack
for onboarding new users.

Adding a new config var to ``env.local``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the long-form "configuration" and "variable"

Here and in all other places in the document.

========================================
* **Default value** should be in a corresponding ``default.env`` so it is easy for the user to find them.
The default value should not be burried in the code. The commented out value in ``env.local.example``
is only an example and can not count as a default value.

* **Documentation** for the new var can be both in ``default.env`` and ``env.local.example`` to be
most user-friendly. If you do not wish to duplicate the info because it is big, you can put in one of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to choose which one we prefer. I would say that we should always prefer env.local.example for variables that are use facing and default.env for the internal-only variables.

Copy link
Member

@fmigneault fmigneault Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have always felt that all default.env variables are also user-facing (as in, they can be overridden, they offer customization options, and are not just internal). They are simply just not as "critical" since reasonable default are provided (as per the above aim / dev conventions).

I consider the env.local.example to be the place where platform-wide non-default/critical variables should be indicated. These include required variables that must either absolutely be set by the developer, and those that are very important to be aware of because of the scope of their impact (eg: basic functionality of components activation).

In order to avoid duplication and making env.local.example more user-friendly (due to overload of variables, we lose the importance distinction between all of them), I purposely omit most of default.env variables. If a user actually cares a lot about a certain component's "control knob options", they should dig into default.env and its respective VARS/OPTIONAL_VARS.

I personally think env.local.example still has too many unnecessary/component-specific variables (eg: don't care about THREDDS, JupyterHub, etc. if they are not enabled), as well as some deprecated components.

the two files and reference in the other file.

* Documenting in ``env.local.example`` is the most user-friendly for new user starting out because they
will have to copy ``env.local.example`` to ``env.local``.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
will have to copy ``env.local.example`` to ``env.local``.
will refer to ``env.local.example`` when writing their local environment file.

(we're trying to distinguish between the "local environment file" and env.local which is the default location of that file)

Comment on lines +427 to +428
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per https://github.com/bird-house/birdhouse-deploy/pull/620/files#r2666114501, I think the overloaded env.local.example actually produces the opposite effect of being too noisy from unnecessary definitions, which makes it less user-friendly and more daunting for new users.

* Documenting in ``default.env`` is more "closer to the source" and more "together" with all other vars
from the same component. Some vars/documentations are "dangerous" so we do not even expose them to
``env.local.example``.
Comment on lines +430 to +431
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from the same component. Some vars/documentations are "dangerous" so we do not even expose them to
``env.local.example``.
from the same component. Some variables are for internal use only and should not be modified by the user. This means we should not document them in ``env.local.example``.


* **Naming convention** should be ``<COMPONENT_NAME>_<VAR_NAME>`` to avoid name clash. For platform vars
that do not belong to any components, use ``BIRDHOUSE`` prefix instead of ``<COMPONENT_NAME>``.

Renaming or deleting an existing config var in ``env.local``
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Renaming or deleting an existing config var in ``env.local``
Renaming or deleting an existing configuration variable

============================================================
* Try to **avoid** this scenario as this is **backward incompatible** with all existing ``env.local`` on
all existing deployments.
Comment on lines +438 to +439
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Try to **avoid** this scenario as this is **backward incompatible** with all existing ``env.local`` on
all existing deployments.
* Try to **avoid** this scenario as this is **backward incompatible** without requiring existing deployments to manually update their local environment files.


* If you must, **soften the blow** by

* adding to the ``BIRDHOUSE_BACKWARDS_COMPATIBLE_VARIABLES`` mapping in ``birdhouse/default.env`` or
* trying to support both names in the code at the same time for a few releases
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also mention that they should add a comment to the documentation that the old variable is now deprecated and suggest that they should update to the new way of doing things.

Comment on lines +443 to +444
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather have the convention of always using BIRDHOUSE_BACKWARDS_COMPATIBLE_VARIABLES, and never have both names in the code. The code should only use the "final / official" name established from that change and consider the deprecated/backward-compatible name as non-existent to make code maintenance easier.


to give time for all users to update all existing ``env.local`` on all existing deployments.

* **Document migration path** clearly in ``CHANGES.md``.

* Bump **minor** version, **not patch** version on release to signal **backward incompatible** change
requiring manual update to all existing ``env.local`` on all existing deployments.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also mention that they should add an entry to docs/source/migration_guide.rst

Comment on lines +450 to +451
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Changing the default value for the expected format of an existing config var in ``env.local``
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by expected format here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, same note about using env.local vs "local environment file"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this section be combined with the one above? Maybe I'm not understanding the difference between them but it seems like the advice for both scenarios is mostly the same.

=============================================================================================
* Try to **avoid** this scenario as this is **backward incompatible** with all existing ``env.local`` on
all existing deployments.
Comment on lines +455 to +456
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Try to **avoid** this scenario as this is **backward incompatible** with all existing ``env.local`` on
all existing deployments.
* Try to **avoid** this scenario as this is **backward incompatible** without requiring existing deployments to manually update their local environment files.


* Changing the format is potentially more disruptive than the default value.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? I'm not sure I understand


* If you must, **soften the blow** by

* supporting both formats in the code at the same time for a few releases or
* creating a new variable for the new format so the older format is still supported by the existing var,
displaying a warning that new features will only come to the new var or
* in the case of default value change, document the previous default value so user can manually set the
previous default value in their ``env.local`` to retain the previous behavior

to give time for all users to update all existing ``env.local`` on all existing deployments.

* **Document migration path** clearly in ``CHANGES.md``. If default value is changed, explain the impact
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and in migration_guide.rst as well please

as user could previously be relying on the default value and not setting the variable explicitly in their
``env.local``. If they understand the impact and wish to retain the previous behavior, they now have to
explicitly set the previous default value in their ``env.local``.

* Bump **minor** version, **not patch** version on release to signal **backward incompatible** change
requiring manual update to all existing ``env.local`` on all existing deployments.
Comment on lines +475 to +476
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cross-ref tagging policy



Framework tests
^^^^^^^^^^^^^^^

Expand Down
Loading