feat: opt into git-driven build root via CHARMCRAFT_EXPERIMENTAL_MONOREPO
Metadata
Current evaluation
Merged. Adds CHARMCRAFT_EXPERIMENTAL_MONOREPO env var to enable a git-driven build root. When set, it configures allow_git_build_root=True, mounting the repository root as the build directory for monorepo support. Fixes CHARMCRAFT-710 and CHARMCRAFT-720.
Suggested action: —
No scores available.
Issue body
## Description
**Part of Stack:**
1. #2840 (`test(store): replace deleted mysql charmlib with operator-libs-linux.apt in store integration tests`)
2. #2835 (`fix(plugins): use part_build_subdir for charm source copy`)
3. #2842 (`chore(deps): update craft-application to ~=7.2 and fix docs build`)
4. **#2836 (this PR: `feat: opt into git-driven build root via CHARMCRAFT_EXPERIMENTAL_MONOREPO`)**
---
When `CHARMCRAFT_EXPERIMENTAL_MONOREPO` is set to a truthy value (e.g. `1`, `true`, `yes`), Charmcraft sets `allow_git_build_root=True` in `APP_METADATA` and the `craft-application` (`~=7.2`) config service mounts the git repository root as the build root. This enables charms residing within a monorepo to access shared dependencies outside the charm's directory (such as `../shared` or `../common`).
## Changes
- Add `const.EXPERIMENTAL_MONOREPO_ENV_VAR = "CHARMCRAFT_EXPERIMENTAL_MONOREPO"`.
- Set `APP_METADATA.allow_git_build_root = True`.
- Add unit tests in `tests/unit/application/test_main.py` verifying `allow_git_build_root` and `CHARMCRAFT_EXPERIMENTAL_MONOREPO` configuration handling.
- Add spread test in `tests/spread/commands/git-build-root/task.yaml` for packaging charms referencing parent monorepo directories.
Fixes CHARMCRAFT-710
Fixes CHARMCRAFT-720
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Adds CHARMCRAFT_EXPERIMENTAL_MONOREPO env var to enable a git-driven build root. When set, it configures allow_git_build_root=True, mounting the repository root as the build directory for monorepo support. Fixes CHARMCRAFT-710 and CHARMCRAFT-720. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
35
Confidence:
90
|
needs review | Adds CHARMCRAFT_EXPERIMENTAL_MONOREPO env var to enable git-driven build roots for monorepos. Sets allow_git_build_root=True in APP_METADATA. Includes unit and spread tests. Approved by 2 reviewers, CI passing, pending spread/snap-store tests. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
30
Confidence:
90
|
needs review | Adds an experimental environment variable to enable git-driven build roots for monorepos, updates craft-application to v7.2, and adds unit and spread tests. Currently approved by one reviewer with passing CI checks. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
25
Confidence:
85
|
needs review | Enables git-driven build roots for monorepo support via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Sets allow_git_build_root=True, adds tests, and fixes CHARMCRAFT-710/720. Currently approved by one reviewer with most CI checks passing and a few pending. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
35
Confidence:
90
|
needs review | Enables opt-in git-driven build root for monorepos via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Sets allow_git_build_root=True in APP_METADATA. Approved by 1 reviewer, CI passing, ready for merge. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
35
Confidence:
90
|
needs review | Introduces experimental monorepo support by enabling allow_git_build_root via the CHARMCRAFT_EXPERIMENTAL_MONOREPO environment variable. Includes unit and spread tests. Currently pending maintainer review with two unresolved comments and pending snap tests. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
40
Confidence:
90
|
needs review | Enables git-driven build roots for monorepos via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Sets allow_git_build_root in app metadata, adds unit and spread tests. Currently pending maintainer review with 2 unresolved comments and pending snap CI checks. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
45
Confidence:
85
|
needs review | Enables git-driven build roots for monorepos via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Sets allow_git_build_root metadata, adds unit and spread tests. Currently pending maintainer review with CI passing. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
25
Confidence:
85
|
needs review | Enables git-driven build roots for monorepos via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Sets allow_git_build_root=True in APP_METADATA. Includes unit and spread tests. Currently pending maintainer review with 2 unresolved comments and passing CI. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
35
Confidence:
85
|
needs review | Enables monorepo support by allowing git-driven build roots via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Adds config, unit tests, and spread tests. Currently pending maintainer review with 2 unresolved comments and passing CI. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
40
Confidence:
90
|
needs review | Enables git-driven build roots for monorepos via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Sets allow_git_build_root metadata, adds unit and spread tests. Currently pending maintainer review with 2 unresolved comments, all CI checks passing. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
35
Confidence:
85
|
needs review | Enables git-driven build roots for monorepos via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Sets allow_git_build_root in APP_METADATA. Includes unit and spread tests. Currently pending maintainer review with 2 unresolved comments and some CI checks still running. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
35
Confidence:
85
|
needs review | Introduces an experimental environment variable to enable git-driven build roots for monorepo support. Adds configuration handling, unit tests, and spread tests. Currently awaiting maintainer review with passing CI checks. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
0
Complexity:
30
Confidence:
95
|
needs review | Adds opt-in environment variable CHARMCRAFT_EXPERIMENTAL_MONOREPO to enable git-driven build roots for monorepos. Sets allow_git_build_root in APP_METADATA. Includes unit and spread tests. Currently pending maintainer review with passing CI. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
25
Confidence:
80
|
needs review | Introduces CHARMCRAFT_EXPERIMENTAL_MONOREPO env var to enable git-driven build roots for monorepo charms. Currently awaiting maintainer review with CI checks pending. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
45
Confidence:
90
|
needs review | Adds opt-in environment variable to enable git-driven build root for monorepo support. Currently pending maintainer review with unresolved comments and CI checks still running. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
45
Confidence:
85
|
needs review | Enables git-driven build roots for monorepos via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Updates craft-application dependency, adds tests, and sets allow_git_build_root. Currently pending maintainer review with 2 unresolved comments and pending CI checks. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
45
Confidence:
85
|
needs review | Enables git-driven build roots for monorepos via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Updates craft-application dependency and adds tests. Currently pending maintainer review with unresolved comments and failing slow CI checks. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
45
Confidence:
85
|
needs review | Adds environment variable to enable git-driven build roots for monorepo support, updates craft-application dependency, and adds unit/spread tests. Currently pending maintainer review with unresolved comments and CI checks. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
45
Confidence:
80
|
needs review | Adds experimental monorepo support by enabling a git-driven build root via CHARMCRAFT_EXPERIMENTAL_MONOREPO env var. Currently pending maintainer review with 2 unresolved comments and some failing CI checks. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
45
Confidence:
90
|
needs review | Introduces CHARMCRAFT_EXPERIMENTAL_MONOREPO env var to enable git-driven build roots for monorepo support. Updates craft-application dependency, adds unit and spread tests, and resolves internal tickets. Currently pending review with unresolved comments and failing CI checks. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
40
Confidence:
85
|
needs review | Adds CHARMCRAFT_EXPERIMENTAL_MONOREPO env var to opt into git-driven build roots for monorepo support. Currently pending maintainer review with CI checks passing or in progress. |
Update history
| Date | Change |
|---|---|
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1109 feat: opt-in experimental monorepo support | craft-application | merged | Merged experimental monorepo support. Setting allow_git_build_root=True and the APP_NAME_EXPERIMENTAL_MONOREPO env var causes the provider to mount the git root to /root/project. Approved and passed CI. | |
| #2573 Support referencing sibling directories of project root | charmcraft | open | Feature request to build charms from a monorepo by mounting the whole git repo (sibling dirs like shared-lib) instead of only the charmcraft.yaml dir. Triaged, actively discussed; an experimental git-driven build root (CHARMCRAFT_EXPERIMENTAL_MONOREPO) has since landed. | |
| #2761 feat(PROTOTYPE): git build-root for monorepos | charmcraft | closed | Superseded by PR #2836, which merged the git build-root feature for monorepos. This prototype was closed after the functionality was successfully implemented elsewhere. |