Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

GRIF-209: refactor products-contains-component output and added --include-container-roots #281

Merged
merged 8 commits into from
Jan 18, 2024
Merged
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Changed
* refactor output format of service products-contain-component (GRIF-209)
* container roots are excluded by default (need to use --include-container-roots)

### Added
* --include-container_roots in service products-contain-component
* --exclude-unreleased in service products-contain-component

## [0.4.2] - 2024-01-14
### Added
* GRIFFON_VERIFY_SSL environment variable
Expand Down
19 changes: 18 additions & 1 deletion griffon/commands/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,20 @@ def retrieve_component_summary(ctx, component_name, strict_name_search, operatio
help="Regex search.",
mutually_exclusive_group=["strict_name_search"],
)
@click.option(
"--include-container-roots",
"include_container_roots",
is_flag=True,
default=get_config_option("default", "include_container_roots", False),
help="Include OCI root components in output.",
)
@click.option(
"--exclude-unreleased",
"exclude_unreleased",
is_flag=True,
default=get_config_option("default", "exclude_unreleased", False),
help="Exclude unreleased components.",
)
@click.pass_context
@progress_bar(is_updatable=True)
def get_product_contain_component(
Expand Down Expand Up @@ -395,12 +409,14 @@ def get_product_contain_component(
verbose,
operation_status,
regex_name_search,
include_container_roots,
exclude_unreleased,
):
# with console_status(ctx) as operation_status:
"""List products of a latest component."""
if verbose:
ctx.obj["VERBOSE"] = verbose

ctx.obj["INCLUDE_CONTAINER_ROOTS"] = include_container_roots
if (
not search_latest
and not search_all
Expand All @@ -419,6 +435,7 @@ def get_product_contain_component(
params.pop("sfm2_flaw_id")
params.pop("flaw_mode")
params.pop("affect_mode")
params.pop("include_container_roots")
if component_name:
q = query_service.invoke(
core_queries.products_containing_component_query, params, status=operation_status
Expand Down
Loading