-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add create-cd entrypoint for component definition bootstrapping (…
…#67) * feat(entrypoint): add CreatCDEntrypoint Related issues: PSCE-256 Majority of code generated by chatGPT Signed-off-by: Alex Flom <[email protected]> * feat(entrypoint): add CreatCDEntrypoint Related issues: PSCE-256 Majority of code generated by chatGPT Signed-off-by: Alex Flom <[email protected]> * feat: adds ModelFilter to allow inclusive and exclusive filtering during tasks Replaces skip_model_list with ModelFilter Add ModelFilter to existing tasks Updates CreateCD to use the filter to only process the new compdef BREAKING CHANGE: skip_model_list in tasks have been replace with ModelFilter Signed-off-by: Jennifer Power <[email protected]> * feat: adds profile filtering to create-cd entrypoint Signed-off-by: Jennifer Power <[email protected]> * chore: removes add filter profile and use existing Signed-off-by: Jennifer Power <[email protected]> --------- Signed-off-by: Jennifer Power <[email protected]> Co-authored-by: Alex Flom <[email protected]>
- Loading branch information
Showing
16 changed files
with
372 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/python | ||
|
||
# Copyright 2023 Red Hat, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
"""Test workspace filtering logic.""" | ||
|
||
import pathlib | ||
from typing import List | ||
|
||
import pytest | ||
|
||
from trestlebot.tasks.base_task import ModelFilter | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"skip_list, include_list, model_name, expected", | ||
[ | ||
[["simplified_nist_catalog"], [], "simplified_nist_catalog", True], | ||
[[], ["simplified_nist_catalog"], "simplified_nist_catalog", False], | ||
[["simplified*"], ["."], "simplified_nist_catalog", True], | ||
[ | ||
["simplified_nist_catalog"], | ||
["simplified*"], | ||
"simplified_nist_profile", | ||
False, | ||
], | ||
], | ||
) | ||
def test_is_skipped( | ||
skip_list: List[str], include_list: List[str], model_name: str, expected: str | ||
) -> None: | ||
"""Test skip logic.""" | ||
model_path = pathlib.Path(model_name) | ||
model_filter = ModelFilter(skip_list, include_list) | ||
assert model_filter.is_skipped(model_path) == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,4 @@ | |
YAML_EXTENSION = ".yaml" | ||
|
||
RULES_VIEW_DIR = "rules" | ||
RULE_PREFIX = "rule-" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.