diff --git a/tests/trestlebot/entrypoints/test_sync_upstreams.py b/tests/trestlebot/entrypoints/test_sync_upstreams.py index 54a5cc90..e1802de9 100644 --- a/tests/trestlebot/entrypoints/test_sync_upstreams.py +++ b/tests/trestlebot/entrypoints/test_sync_upstreams.py @@ -77,15 +77,15 @@ def test_sync_upstreams( clean(source, None) -def test_with_include_models( +def test_with_include_model_names( tmp_repo: Tuple[str, Repo], valid_args_dict: Dict[str, str] ) -> None: - """Test sync upstreams with include models flag.""" + """Test sync upstreams with include model names flag.""" repo_path, repo = tmp_repo repo.create_remote("origin", url=test_repo_url) args_dict = valid_args_dict - args_dict["include-models"] = test_cat + args_dict["include-model-names"] = test_cat args_dict["working-dir"] = repo_path source: str = prepare_upstream_repo() @@ -108,15 +108,15 @@ def test_with_include_models( clean(source, None) -def test_with_exclude_models( +def test_with_exclude_model_names( tmp_repo: Tuple[str, Repo], valid_args_dict: Dict[str, str] ) -> None: - """Test sync upstreams with exclude models flag.""" + """Test sync upstreams with exclude model names flag.""" repo_path, repo = tmp_repo repo.create_remote("origin", url=test_repo_url) args_dict = valid_args_dict - args_dict["exclude-models"] = test_prof + args_dict["exclude-model-names"] = test_prof args_dict["working-dir"] = repo_path source: str = prepare_upstream_repo() diff --git a/trestlebot/entrypoints/sync_upstreams.py b/trestlebot/entrypoints/sync_upstreams.py index d76e7cfc..c5d0394c 100644 --- a/trestlebot/entrypoints/sync_upstreams.py +++ b/trestlebot/entrypoints/sync_upstreams.py @@ -59,17 +59,17 @@ def setup_sync_upstreams_arguments(self) -> None: of the form @ where ref is a git ref such as a tag or branch.", ) self.parser.add_argument( - "--include-models", + "--include-model-names", type=str, required=False, - help="Comma-separated list of glob patterns for models by name to include when running \ + help="Comma-separated list of glob patterns for model names to include when running \ tasks (e.g. --include-models=component_x,profile_y*)", ) self.parser.add_argument( - "--exclude-models", + "--exclude-model-names", type=str, required=False, - help="Comma-separated list of glob patterns for models by name to exclude when running \ + help="Comma-separated list of glob patterns for model names to exclude when running \ tasks (e.g. --exclude-models=component_x,profile_y*)", ) self.parser.add_argument( @@ -88,13 +88,13 @@ def run(self, args: argparse.Namespace) -> None: "--sources", "Must set at least one source to sync from." ) - # Assume that if exclude_models is not set, then - # skip nothing and if include_models is not set, then include all. + # Assume that if exclude_model_names is not set, then + # skip nothing and if include_model_names is not set, then include all. include_model_list: List[str] = ["*"] - if args.include_models: - include_model_list = comma_sep_to_list(args.include_models) + if args.include_model_names: + include_model_list = comma_sep_to_list(args.include_model_names) model_filter: ModelFilter = ModelFilter( - skip_patterns=comma_sep_to_list(args.exclude_models), + skip_patterns=comma_sep_to_list(args.exclude_model_names), include_patterns=include_model_list, )