manifest: Support --active-only argument for --resolve/--freeze#808
Conversation
4359950 to
a9c4e84
Compare
|
Thank you @pdgendt. This fixes both of the issues I was seeing where:
Error before pulling in the change: $ west manifest --freeze
. . .
RuntimeError: cannot freeze; project canopennode is unclonedWith this change, both are correctly reporting cloned repos without any errors. Discussion in |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #808 +/- ##
==========================================
+ Coverage 83.99% 84.06% +0.07%
==========================================
Files 11 11
Lines 3342 3345 +3
==========================================
+ Hits 2807 2812 +5
+ Misses 535 533 -2
🚀 New features to boost your workflow:
|
9f8bd6a to
c749dda
Compare
I don't think that would work? The |
Yes my bad, ignore. Sorry for the noise. |
|
This was already discussed in #491, #667 and probably others. At the time, a new command was suggested instead of changing the semantic of the existing one[*]. Please review past discussions before proceeding with this.
Discord is useful but Discord discussions are not public, please avoid using as a reference (try opening this links in private/incognito mode) [*] Maybe one issue is: different people with different filters get different |
So this never worked in a default or almost default configuration? Whatever happens, it sounds like more test coverage is needed! CodeCov & friends only know so much... |
|
Here is the original bug report from Discord that prompted this change. Bug report from the Discord discussionAny tips on how to get west manifest --freeze to work? When I run it, it complains about the projects in zephyr/submanifests/optional.yaml not being cloned starting with the first in the list of canopennode. Since it is optional software that I am not using, it is not cloned, so the entire freeze operation fails. I am using the "forest" model of west and have a zephyrproject/applications folder which imports the zephyr repo: I was able to update west to skip uncloned projects to get a release out. Would still like to know if this is a west issue or a usage/configuration issue on my part. |
Thanks for pointing to those discussions, will update this PR to have |
c749dda to
a5dd277
Compare
14aa628 to
b3ee9d0
Compare
|
I see nothing wrong but I was never on top of filters and
Partial imports
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces two new command-line arguments—--freeze-active and --resolve-active—for generating a manifest that includes only active projects, leaving the original --freeze and --resolve behaviors unchanged.
- Added new test cases in tests/test_project.py to verify the behavior of active-only manifests.
- Extended the manifest module to support an "active_only" parameter in its as_dict, as_frozen_dict, and YAML output functions.
- Updated the CLI parser and run logic in src/west/app/project.py to recognize and process the new active commands.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_project.py | Introduced tests for --freeze-active and --resolve-active behavior to exclude inactive projects. |
| src/west/manifest.py | Added an "active_only" parameter to as_dict, as_frozen_dict, as_yaml, and related helpers for filtering inactive projects. |
| src/west/app/project.py | Extended argument parsing and command routing to support --freeze-active and --resolve-active options. |
|
@pdgendt Overall this looks great, but just a question from myself. Why not have something like |
I see, I personally would rather see a new |
b3ee9d0 to
cdee9f2
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces the new "--active-only" argument for the manifest commands used in both resolve and freeze operations. Key changes include:
- Adding new test cases to verify that inactive projects are correctly filtered using the active-only flag.
- Updating manifest representation methods (as_dict, as_frozen_dict, as_yaml) to accept an optional active_only parameter that applies a project filter.
- Modifying the project command argument parsing to conditionally disable extra validations when active-only is enabled.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/test_project.py | Added tests to verify behavior with the new active-only flag. |
| src/west/manifest.py | Integrated the 'active_only' parameter into manifest methods. |
| src/west/app/project.py | Adjusted command handling for resolve and freeze with active-only. |
Running manifest --freeze or --resolve expects projects to be cloned, add variants that allow for only active projects to be resolved or frozen. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add test cases for commands - manifest --freeze --active-only - manifest --resolve - manifest --resolve --active-only Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
cdee9f2 to
9b8107d
Compare
|
Thank you @pdgendt for pushing this through and taking care of several old issues! |
EDIT: The discussions in #491 and #667 made it clear that
--freezeand--resolveshould not have their behavior changed.Updated the PR to introduce
--active-onlyfor--resolve/--freeze.Runningwest manifest --freezeexpects projects to be cloned, but the purpose of inactive projects is to not clone these explicitly.Currently it's not possible to callwest manifest --freezeon a clean zephyr installment because of theoptionalprojects.