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
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ 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)
* when using -r highlight matched term

### 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
20 changes: 19 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,15 @@ 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
ctx.obj["REGEX_NAME_SEARCH"] = regex_name_search
if (
not search_latest
and not search_all
Expand All @@ -419,6 +436,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