You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "andrzej-kaczmarek (via GitHub)" <gi...@apache.org> on 2026/10/18 17:40:16 UTC

[PR] newt: Add support for project.local.yml [mynewt-newt]

andrzej-kaczmarek opened a new pull request, #640:
URL: https://github.com/apache/mynewt-newt/pull/640

   This PR adds support for an optional `project.local.yml` file next to `project.yml`. It lets project settings be overridden locally without modifying `project.yml`, e.g. to use a feature branch or a fork of a repository. The file is meant to be kept out of version control (added to `.gitignore`). When it is present, newt prints `Using local project overrides from project.local.yml`.
   
   ### Syntax
   
   `project.local.yml` uses the same syntax as `project.yml` and is applied after it. Settings without a suffix are merged into the ones from `project.yml`:
   
   - maps (e.g. `repository.<name>`) are merged per key,
   - sequences (e.g. `project.repositories.allowed`) are appended to,
   - other values are replaced.
   
   One of the following suffixes can be appended to a setting name to change this:
   
   - `<setting>.$replace` replaces the whole value instead of merging into it,
   - `<setting>.$remove` removes the listed items from a sequence (exact string match, not regex),
   - `<setting>.$delete: true` deletes the setting.
   
   `$remove` and a plain setting can be used together on the same sequence. Items are always removed first. `$replace` and `$delete` cannot be combined with other operations on the same setting. Removing an item or deleting a setting that does not exist only results in a warning. The suffixes are supported only in `project.local.yml` itself, not in files it imports with `$import`.
   
   ### Example
   
   ```yaml
   repository.apache-mynewt-core:
       vers: 0.0.0
       branch: my-feature
   
   repository.mcuboot.$replace:
       type: git
       vers: 0.0.0
       url: https://example.com/mcuboot.git
   
   repository.apache-mynewt-nffs.$delete: true
   
   project.repositories.allowed.$remove:
       - apache-mynewt-nimble
   project.repositories.allowed:
       - my-private-repo
   ```
   
   Deleting a repository only removes its definition from `project.yml`. A repository pulled in as a dependency of another one is still added. To exclude it completely, add it to `project.repositories.ignored`.
   
   The feature is documented in `docs/index.rst`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] newt: Add support for local.project.yml [mynewt-newt]

Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc commented on code in PR #640:
URL: https://github.com/apache/mynewt-newt/pull/640#discussion_r4313504689


##########
docs/index.rst:
##########
@@ -204,6 +204,65 @@ the build system to look in the base directory of repos/apache-mynewt-core for t
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/sys/console/full"
 
+Local Project Overrides
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Settings from project.yml can be overridden locally, without modifying the file itself, by creating a
+``local.project.yml`` file next to it. The file is intended to be kept out of version control (e.g. added to
+``.gitignore``) and is always loaded after project.yml. When it is present, newt prints
+``Using local project overrides from local.project.yml``.
+
+The file uses the same syntax as project.yml. By default, each setting is merged into the corresponding setting from
+project.yml:
+
+* maps (e.g. ``repository.<name>``) are merged per key, so only the specified fields are added or replaced,
+* sequences (e.g. ``project.repositories.allowed``) are appended to,
+* other values are replaced.
+
+A setting that does not exist in project.yml is simply added. To change this behavior, one of the following suffixes
+can be appended to a setting name:
+
+* ``<setting>.OVERWRITE`` - replaces the whole value instead of merging into it, the same way as in other YAML

Review Comment:
   would be good to emphasize in docs that those options are available only in local.yaml



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] newt: Add support for local.project.yml [mynewt-newt]

Posted by "andrzej-kaczmarek (via GitHub)" <gi...@apache.org>.
andrzej-kaczmarek merged PR #640:
URL: https://github.com/apache/mynewt-newt/pull/640


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org