diff --git a/MANIFEST.in b/MANIFEST.in index 362b495..0a1b71c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ -include README.md LICENSE requirements.txt main.py +include README.md LICENSE requirements.txt +recursive-include src/raven_cycode/library *.yml recursive-include tests *.py -recursive-include src * \ No newline at end of file +recursive-include src/raven_cycode * diff --git a/deployment/test.dockerfile b/deployment/test.dockerfile index bb1e469..5ab8cb1 100644 --- a/deployment/test.dockerfile +++ b/deployment/test.dockerfile @@ -9,11 +9,10 @@ RUN mkdir -p /raven/tests WORKDIR /raven COPY Makefile requirements.txt /raven/ COPY src /raven/src -COPY library /raven/library COPY tests /raven/tests # Install any needed packages specified in requirements.txt RUN pip3 install -r requirements.txt # Run RAVEN tests -CMD ["make", "test-run"] \ No newline at end of file +CMD ["make", "test-run"] diff --git a/main.py b/main.py index a07bb36..efc42c5 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,6 @@ -from src.cmdline import execute +import sys +sys.path.insert(0, "src") +from raven_cycode.cmdline import execute def main(): diff --git a/setup.py b/setup.py index e6f0189..72d05c7 100644 --- a/setup.py +++ b/setup.py @@ -43,6 +43,8 @@ "Topic :: Security", ], install_requires=REQUIRMENTS, - packages=find_packages(exclude=("tests", "tests.*")), - entry_points={"console_scripts": ["raven = src.cmdline:execute"]}, + packages=find_packages(where="src", exclude=("tests", "tests.*")), + package_dir={"": "src"}, + entry_points={"console_scripts": ["raven = raven_cycode.cmdline:execute"]}, + include_package_data=True, ) diff --git a/src/__init__.py b/src/__init__.py deleted file mode 100644 index f865f68..0000000 --- a/src/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from src.common.ignore_warnings import ignore_warnings - -ignore_warnings() diff --git a/src/raven_cycode/__init__.py b/src/raven_cycode/__init__.py new file mode 100644 index 0000000..7a415a3 --- /dev/null +++ b/src/raven_cycode/__init__.py @@ -0,0 +1,3 @@ +from raven_cycode.common.ignore_warnings import ignore_warnings + +ignore_warnings() diff --git a/src/cmdline.py b/src/raven_cycode/cmdline.py similarity index 95% rename from src/cmdline.py rename to src/raven_cycode/cmdline.py index aed8c03..4180be5 100644 --- a/src/cmdline.py +++ b/src/raven_cycode/cmdline.py @@ -1,18 +1,18 @@ import argparse -import src.logger.log as log -from src.common.utils import validate_query_ids -from src.downloader.download import ( +import raven_cycode.logger.log as log +from raven_cycode.common.utils import validate_query_ids +from raven_cycode.downloader.download import ( download_all_workflows_and_actions, download_account_workflows_and_actions, ) -from src.indexer.index import index_downloaded_workflows_and_actions -from src.reporter.report import generate -from src.config.config import ( +from raven_cycode.indexer.index import index_downloaded_workflows_and_actions +from raven_cycode.reporter.report import generate +from raven_cycode.config.config import ( load_downloader_config, load_indexer_config, load_reporter_config, ) -from src.config.config import ( +from raven_cycode.config.config import ( DEBUG_DEFAULT, MIN_STARS_DEFAULT, NEO4J_CLEAN_DEFAULT, diff --git a/src/common/__init__.py b/src/raven_cycode/common/__init__.py similarity index 100% rename from src/common/__init__.py rename to src/raven_cycode/common/__init__.py diff --git a/src/common/ignore_warnings.py b/src/raven_cycode/common/ignore_warnings.py similarity index 100% rename from src/common/ignore_warnings.py rename to src/raven_cycode/common/ignore_warnings.py diff --git a/src/common/utils.py b/src/raven_cycode/common/utils.py similarity index 96% rename from src/common/utils.py rename to src/raven_cycode/common/utils.py index dc20a94..b5a686a 100644 --- a/src/common/utils.py +++ b/src/raven_cycode/common/utils.py @@ -6,9 +6,9 @@ import yaml from py2neo.data import Node -from src.storage.redis_connection import RedisConnection -from src.config.config import Config, QUERY_IDS -import src.logger.log as log +from raven_cycode.storage.redis_connection import RedisConnection +from raven_cycode.config.config import Config, QUERY_IDS +import raven_cycode.logger.log as log from urllib.parse import urlparse, parse_qs diff --git a/src/config/__init__.py b/src/raven_cycode/config/__init__.py similarity index 100% rename from src/config/__init__.py rename to src/raven_cycode/config/__init__.py diff --git a/src/config/config.py b/src/raven_cycode/config/config.py similarity index 93% rename from src/config/config.py rename to src/raven_cycode/config/config.py index 713fa6a..b241c79 100644 --- a/src/config/config.py +++ b/src/raven_cycode/config/config.py @@ -1,11 +1,13 @@ -from src.storage.neo4j_graph import GraphDb +from raven_cycode.storage.neo4j_graph import GraphDb +from pathlib import Path +import raven_cycode # Default Values DEBUG_DEFAULT = False MIN_STARS_DEFAULT = 1000 REDIS_CLEAN_DEFAULT = False NEO4J_CLEAN_DEFAULT = False -QUERIES_PATH_DEFAULT = "library" +QUERIES_PATH_DEFAULT = Path(raven_cycode.__file__).resolve().parent / "library" REPORT_RAW_FORMAT = "raw" REPORT_JSON_FORMAT = "json" SLACK_REPORTER = "slack" @@ -77,7 +79,7 @@ def load_downloader_config(args) -> None: load_redis_config(args) if Config.clean_redis: - from src.storage.redis_utils import clean_redis_db + from raven_cycode.storage.redis_utils import clean_redis_db clean_redis_db() @@ -95,8 +97,8 @@ def load_indexer_config(args) -> None: load_reporter_config(args) if Config.clean_neo4j or Config.graph.is_graph_empty(): - from src.storage.redis_utils import clean_index - from src.storage.neo4j_utils import clean_graph + from raven_cycode.storage.redis_utils import clean_index + from raven_cycode.storage.neo4j_utils import clean_graph clean_graph() clean_index() diff --git a/src/downloader/__init__.py b/src/raven_cycode/downloader/__init__.py similarity index 100% rename from src/downloader/__init__.py rename to src/raven_cycode/downloader/__init__.py diff --git a/src/downloader/download.py b/src/raven_cycode/downloader/download.py similarity index 96% rename from src/downloader/download.py rename to src/raven_cycode/downloader/download.py index 796f66c..e4c3a96 100644 --- a/src/downloader/download.py +++ b/src/raven_cycode/downloader/download.py @@ -1,12 +1,12 @@ from requests import get -from src.config.config import Config -from src.storage.redis_connection import RedisConnection -from src.downloader.utils import ( +from raven_cycode.config.config import Config +from raven_cycode.storage.redis_connection import RedisConnection +from raven_cycode.downloader.utils import ( insert_workflow_or_action_to_redis, add_ref_pointer_to_redis, ) -from src.downloader.gh_api import ( +from raven_cycode.downloader.gh_api import ( get_account_generator, get_personal_account_generator, get_repository_generator, @@ -14,15 +14,15 @@ get_repository_composite_action, get_repository_reusable_workflow, ) -from src.common.utils import ( +from raven_cycode.common.utils import ( find_uses_strings, convert_workflow_to_unix_path, get_repo_name_from_path, convert_raw_github_url_to_github_com_url, is_url_contains_a_token, ) -from src.workflow_components.dependency import UsesString, UsesStringType -import src.logger.log as log +from raven_cycode.workflow_components.dependency import UsesString, UsesStringType +import raven_cycode.logger.log as log def download_account_workflows_and_actions() -> None: diff --git a/src/downloader/gh_api.py b/src/raven_cycode/downloader/gh_api.py similarity index 99% rename from src/downloader/gh_api.py rename to src/raven_cycode/downloader/gh_api.py index 6009907..b77a657 100644 --- a/src/downloader/gh_api.py +++ b/src/raven_cycode/downloader/gh_api.py @@ -3,8 +3,8 @@ from requests import get from typing import Dict, Any, Optional, Iterator, Optional from http import HTTPStatus -from src.config.config import Config -import src.logger.log as log +from raven_cycode.config.config import Config +import raven_cycode.logger.log as log """ Current rate limiting: diff --git a/src/downloader/utils.py b/src/raven_cycode/downloader/utils.py similarity index 93% rename from src/downloader/utils.py rename to src/raven_cycode/downloader/utils.py index 2c4cf0a..dfd6932 100644 --- a/src/downloader/utils.py +++ b/src/raven_cycode/downloader/utils.py @@ -1,5 +1,5 @@ -from src.config.config import Config -from src.storage.redis_connection import RedisConnection +from raven_cycode.config.config import Config +from raven_cycode.storage.redis_connection import RedisConnection def insert_workflow_or_action_to_redis( diff --git a/src/indexer/__init__.py b/src/raven_cycode/indexer/__init__.py similarity index 100% rename from src/indexer/__init__.py rename to src/raven_cycode/indexer/__init__.py diff --git a/src/indexer/index.py b/src/raven_cycode/indexer/index.py similarity index 94% rename from src/indexer/index.py rename to src/raven_cycode/indexer/index.py index 4864b90..34ff423 100644 --- a/src/indexer/index.py +++ b/src/raven_cycode/indexer/index.py @@ -3,13 +3,13 @@ import yaml from yaml.constructor import Constructor -from src.storage.redis_connection import RedisConnection -from src.config.config import Config -from src.workflow_components.workflow import Workflow -from src.workflow_components.composite_action import CompositeAction +from raven_cycode.storage.redis_connection import RedisConnection +from raven_cycode.config.config import Config +from raven_cycode.workflow_components.workflow import Workflow +from raven_cycode.workflow_components.composite_action import CompositeAction from tqdm import tqdm -import src.logger.log as log -from src.common.utils import str_to_bool +import raven_cycode.logger.log as log +from raven_cycode.common.utils import str_to_bool # A hack to deny PyYAML to convert "on" tags into Python boolean values. diff --git a/library/query_body_context_injection.yml b/src/raven_cycode/library/query_body_context_injection.yml similarity index 100% rename from library/query_body_context_injection.yml rename to src/raven_cycode/library/query_body_context_injection.yml diff --git a/library/query_build_artifact_leaks_the_github_token.yml b/src/raven_cycode/library/query_build_artifact_leaks_the_github_token.yml similarity index 100% rename from library/query_build_artifact_leaks_the_github_token.yml rename to src/raven_cycode/library/query_build_artifact_leaks_the_github_token.yml diff --git a/library/query_checkout_on_issue.yml b/src/raven_cycode/library/query_checkout_on_issue.yml similarity index 100% rename from library/query_checkout_on_issue.yml rename to src/raven_cycode/library/query_checkout_on_issue.yml diff --git a/library/query_codesee_injection.yml b/src/raven_cycode/library/query_codesee_injection.yml similarity index 100% rename from library/query_codesee_injection.yml rename to src/raven_cycode/library/query_codesee_injection.yml diff --git a/library/query_email_context_injection.yml b/src/raven_cycode/library/query_email_context_injection.yml similarity index 100% rename from library/query_email_context_injection.yml rename to src/raven_cycode/library/query_email_context_injection.yml diff --git a/library/query_enterprise_github_server.yml b/src/raven_cycode/library/query_enterprise_github_server.yml similarity index 100% rename from library/query_enterprise_github_server.yml rename to src/raven_cycode/library/query_enterprise_github_server.yml diff --git a/library/query_injectable_context_composite_action.yml b/src/raven_cycode/library/query_injectable_context_composite_action.yml similarity index 100% rename from library/query_injectable_context_composite_action.yml rename to src/raven_cycode/library/query_injectable_context_composite_action.yml diff --git a/library/query_injectable_input_composite_action.yml b/src/raven_cycode/library/query_injectable_input_composite_action.yml similarity index 100% rename from library/query_injectable_input_composite_action.yml rename to src/raven_cycode/library/query_injectable_input_composite_action.yml diff --git a/library/query_label_context_injection.yml b/src/raven_cycode/library/query_label_context_injection.yml similarity index 100% rename from library/query_label_context_injection.yml rename to src/raven_cycode/library/query_label_context_injection.yml diff --git a/library/query_message_context_injection.yml b/src/raven_cycode/library/query_message_context_injection.yml similarity index 100% rename from library/query_message_context_injection.yml rename to src/raven_cycode/library/query_message_context_injection.yml diff --git a/library/query_priv_esc_workflow_run.yml b/src/raven_cycode/library/query_priv_esc_workflow_run.yml similarity index 100% rename from library/query_priv_esc_workflow_run.yml rename to src/raven_cycode/library/query_priv_esc_workflow_run.yml diff --git a/library/query_pull_request_target_injection.yml b/src/raven_cycode/library/query_pull_request_target_injection.yml similarity index 100% rename from library/query_pull_request_target_injection.yml rename to src/raven_cycode/library/query_pull_request_target_injection.yml diff --git a/library/query_ref_context_injection.yml b/src/raven_cycode/library/query_ref_context_injection.yml similarity index 100% rename from library/query_ref_context_injection.yml rename to src/raven_cycode/library/query_ref_context_injection.yml diff --git a/library/query_self_hosted_workflow.yml b/src/raven_cycode/library/query_self_hosted_workflow.yml similarity index 100% rename from library/query_self_hosted_workflow.yml rename to src/raven_cycode/library/query_self_hosted_workflow.yml diff --git a/library/query_title_context_injection.yml b/src/raven_cycode/library/query_title_context_injection.yml similarity index 100% rename from library/query_title_context_injection.yml rename to src/raven_cycode/library/query_title_context_injection.yml diff --git a/library/query_unpinnable_action.yml b/src/raven_cycode/library/query_unpinnable_action.yml similarity index 100% rename from library/query_unpinnable_action.yml rename to src/raven_cycode/library/query_unpinnable_action.yml diff --git a/library/query_usage_of_outdated_node.yml b/src/raven_cycode/library/query_usage_of_outdated_node.yml similarity index 100% rename from library/query_usage_of_outdated_node.yml rename to src/raven_cycode/library/query_usage_of_outdated_node.yml diff --git a/src/logger/__init__.py b/src/raven_cycode/logger/__init__.py similarity index 100% rename from src/logger/__init__.py rename to src/raven_cycode/logger/__init__.py diff --git a/src/logger/log.py b/src/raven_cycode/logger/log.py similarity index 89% rename from src/logger/log.py rename to src/raven_cycode/logger/log.py index 31675ec..2e27f4f 100644 --- a/src/logger/log.py +++ b/src/raven_cycode/logger/log.py @@ -15,7 +15,7 @@ def info(msg: str) -> None: def debug(msg: str) -> None: - from src.config.config import Config + from raven_cycode.config.config import Config if Config.debug: logger.debug(msg) @@ -30,7 +30,7 @@ def warning(msg: str) -> None: def catch_exit() -> None: - from src.config.config import Config + from raven_cycode.config.config import Config if Config.github_token: print("""\n[x] Index results with: raven index""") diff --git a/src/queries/__init__.py b/src/raven_cycode/queries/__init__.py similarity index 97% rename from src/queries/__init__.py rename to src/raven_cycode/queries/__init__.py index aeb234f..4a61f9a 100644 --- a/src/queries/__init__.py +++ b/src/raven_cycode/queries/__init__.py @@ -1,4 +1,4 @@ -from src.config.config import Config, SEVERITY_LEVELS +from raven_cycode.config.config import Config, SEVERITY_LEVELS import json from colorama import Fore, Style, init import textwrap diff --git a/src/reporter/__init__.py b/src/raven_cycode/reporter/__init__.py similarity index 100% rename from src/reporter/__init__.py rename to src/raven_cycode/reporter/__init__.py diff --git a/src/reporter/report.py b/src/raven_cycode/reporter/report.py similarity index 91% rename from src/reporter/report.py rename to src/raven_cycode/reporter/report.py index 2dbe09e..98e5ce2 100644 --- a/src/reporter/report.py +++ b/src/raven_cycode/reporter/report.py @@ -1,16 +1,16 @@ -from src.config.config import ( +from raven_cycode.config.config import ( Config, REPORT_RAW_FORMAT, REPORT_JSON_FORMAT, SLACK_REPORTER, ) -from src.reporter import slack_reporter -from src.logger.log import success_exit +from raven_cycode.reporter import slack_reporter +from raven_cycode.logger.log import success_exit from os import listdir from os.path import join import yaml import json -from src.queries import Query +from raven_cycode.queries import Query from typing import List diff --git a/src/reporter/slack_reporter.py b/src/raven_cycode/reporter/slack_reporter.py similarity index 100% rename from src/reporter/slack_reporter.py rename to src/raven_cycode/reporter/slack_reporter.py diff --git a/src/storage/__init__.py b/src/raven_cycode/storage/__init__.py similarity index 100% rename from src/storage/__init__.py rename to src/raven_cycode/storage/__init__.py diff --git a/src/storage/neo4j_graph.py b/src/raven_cycode/storage/neo4j_graph.py similarity index 97% rename from src/storage/neo4j_graph.py rename to src/raven_cycode/storage/neo4j_graph.py index dcc5fdd..82ac5db 100644 --- a/src/storage/neo4j_graph.py +++ b/src/raven_cycode/storage/neo4j_graph.py @@ -2,7 +2,7 @@ from py2neo.ogm import GraphObject from py2neo.data import Node from typing import List, Tuple, Optional -import src.logger.log as log +import raven_cycode.logger.log as log class GraphDb(object): diff --git a/src/storage/neo4j_utils.py b/src/raven_cycode/storage/neo4j_utils.py similarity index 53% rename from src/storage/neo4j_utils.py rename to src/raven_cycode/storage/neo4j_utils.py index 7320f7e..8a5a0fd 100644 --- a/src/storage/neo4j_utils.py +++ b/src/raven_cycode/storage/neo4j_utils.py @@ -1,4 +1,4 @@ -from src.config.config import Config +from raven_cycode.config.config import Config def clean_graph(): diff --git a/src/storage/redis_connection.py b/src/raven_cycode/storage/redis_connection.py similarity index 96% rename from src/storage/redis_connection.py rename to src/raven_cycode/storage/redis_connection.py index c95dabb..c5aa423 100644 --- a/src/storage/redis_connection.py +++ b/src/raven_cycode/storage/redis_connection.py @@ -1,8 +1,8 @@ from __future__ import annotations import redis -from src.config.config import Config -import src.logger.log as log +from raven_cycode.config.config import Config +import raven_cycode.logger.log as log class RedisConnection: diff --git a/src/storage/redis_utils.py b/src/raven_cycode/storage/redis_utils.py similarity index 81% rename from src/storage/redis_utils.py rename to src/raven_cycode/storage/redis_utils.py index 29306a2..7717f6f 100644 --- a/src/storage/redis_utils.py +++ b/src/raven_cycode/storage/redis_utils.py @@ -1,5 +1,5 @@ -from src.storage.redis_connection import RedisConnection -from src.config.config import Config +from raven_cycode.storage.redis_connection import RedisConnection +from raven_cycode.config.config import Config def clean_redis_db() -> None: diff --git a/src/workflow_components/__init__.py b/src/raven_cycode/workflow_components/__init__.py similarity index 100% rename from src/workflow_components/__init__.py rename to src/raven_cycode/workflow_components/__init__.py diff --git a/src/workflow_components/composite_action.py b/src/raven_cycode/workflow_components/composite_action.py similarity index 95% rename from src/workflow_components/composite_action.py rename to src/raven_cycode/workflow_components/composite_action.py index 7691366..7e922e5 100644 --- a/src/workflow_components/composite_action.py +++ b/src/raven_cycode/workflow_components/composite_action.py @@ -3,14 +3,14 @@ from py2neo.ogm import GraphObject, RelatedTo, Property -import src.workflow_components.workflow as workflow -from src.config.config import Config -from src.common.utils import ( +import raven_cycode.workflow_components.workflow as workflow +from raven_cycode.config.config import Config +from raven_cycode.common.utils import ( get_dependencies_in_code, convert_dict_to_list, raw_str_to_bool, ) -from src.workflow_components.dependency import UsesString, UsesStringType +from raven_cycode.workflow_components.dependency import UsesString, UsesStringType def get_or_create_composite_action(path: str) -> "CompositeAction": diff --git a/src/workflow_components/dependency.py b/src/raven_cycode/workflow_components/dependency.py similarity index 97% rename from src/workflow_components/dependency.py rename to src/raven_cycode/workflow_components/dependency.py index c5c7213..b1713d3 100644 --- a/src/workflow_components/dependency.py +++ b/src/raven_cycode/workflow_components/dependency.py @@ -1,7 +1,7 @@ import os from enum import Enum -from src.common.utils import get_repo_name_from_path +from raven_cycode.common.utils import get_repo_name_from_path class UsesStringType(Enum): diff --git a/src/workflow_components/parsing_utils.py b/src/raven_cycode/workflow_components/parsing_utils.py similarity index 100% rename from src/workflow_components/parsing_utils.py rename to src/raven_cycode/workflow_components/parsing_utils.py diff --git a/src/workflow_components/workflow.py b/src/raven_cycode/workflow_components/workflow.py similarity index 95% rename from src/workflow_components/workflow.py rename to src/raven_cycode/workflow_components/workflow.py index 4eb2b49..5081193 100644 --- a/src/workflow_components/workflow.py +++ b/src/raven_cycode/workflow_components/workflow.py @@ -2,20 +2,20 @@ from hashlib import md5 from py2neo.ogm import GraphObject, RelatedTo, RelatedFrom, Property -from src.config.config import Config -from src.common.utils import ( +from raven_cycode.config.config import Config +from raven_cycode.common.utils import ( get_dependencies_in_code, get_repo_name_from_path, convert_dict_to_list, find_workflow_by_name, raw_str_to_bool, ) -from src.workflow_components.parsing_utils import ( +from raven_cycode.workflow_components.parsing_utils import ( parse_workflow_trigger, parse_job_machine, ) -from src.workflow_components.dependency import UsesString, UsesStringType -import src.logger.log as log +from raven_cycode.workflow_components.dependency import UsesString, UsesStringType +import raven_cycode.logger.log as log def get_or_create_workflow(path: str) -> "Workflow": @@ -59,7 +59,7 @@ class Step(GraphObject): with_prop = Property("with") url = Property() - action = RelatedTo("src.workflow_components.composite_action.CompositeAction") + action = RelatedTo("raven_cycode.workflow_components.composite_action.CompositeAction") reusable_workflow = RelatedTo("Workflow") using_param = RelatedTo("StepCodeDependency") @@ -87,7 +87,7 @@ def from_dict(obj_dict) -> "Step": uses_string_obj = UsesString.analyze(uses_string=s.uses) if uses_string_obj.type == UsesStringType.ACTION: # Avoiding circular imports. - import src.workflow_components.composite_action as composite_action + import raven_cycode.workflow_components.composite_action as composite_action obj = composite_action.get_or_create_composite_action( uses_string_obj.get_full_path(s.path) diff --git a/tests/tests_init.py b/tests/tests_init.py index b864e5e..d0ddcea 100644 --- a/tests/tests_init.py +++ b/tests/tests_init.py @@ -1,7 +1,7 @@ from os import getenv -from src.config.config import load_downloader_config, load_indexer_config -from src.downloader.download import download_account_workflows_and_actions -from src.indexer.index import index_downloaded_workflows_and_actions +from raven_cycode.config.config import load_downloader_config, load_indexer_config +from raven_cycode.downloader.download import download_account_workflows_and_actions +from raven_cycode.indexer.index import index_downloaded_workflows_and_actions def init_integration_env(): diff --git a/tests/unit/test_composite_action.py b/tests/unit/test_composite_action.py index 1ac0259..8bb39d8 100644 --- a/tests/unit/test_composite_action.py +++ b/tests/unit/test_composite_action.py @@ -1,4 +1,4 @@ -import src.workflow_components.composite_action as composite_action +import raven_cycode.workflow_components.composite_action as composite_action from tests.utils import load_test_config, assert_action_inputs load_test_config() diff --git a/tests/unit/test_dependency.py b/tests/unit/test_dependency.py index 9b7eb67..95e1509 100644 --- a/tests/unit/test_dependency.py +++ b/tests/unit/test_dependency.py @@ -1,5 +1,5 @@ from tests.utils import load_test_config -import src.workflow_components.dependency as dependency +import raven_cycode.workflow_components.dependency as dependency load_test_config() diff --git a/tests/unit/test_parsing_utils.py b/tests/unit/test_parsing_utils.py index a066a98..ab861de 100644 --- a/tests/unit/test_parsing_utils.py +++ b/tests/unit/test_parsing_utils.py @@ -1,4 +1,4 @@ -from src.workflow_components.parsing_utils import ( +from raven_cycode.workflow_components.parsing_utils import ( parse_workflow_trigger, parse_job_machine, ) diff --git a/tests/unit/test_report.py b/tests/unit/test_report.py index 785cac8..04b0604 100644 --- a/tests/unit/test_report.py +++ b/tests/unit/test_report.py @@ -1,5 +1,5 @@ from pathlib import Path -from src.config.config import LAST_QUERY_ID, QUERIES_PATH_DEFAULT +from raven_cycode.config.config import LAST_QUERY_ID, QUERIES_PATH_DEFAULT from yaml import safe_load query_dir = Path(__file__).parent.parent.parent / QUERIES_PATH_DEFAULT diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 7bd7b94..37e93a2 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -1,5 +1,5 @@ from tests.utils import load_test_config -import src.common.utils as utils +import raven_cycode.common.utils as utils load_test_config() diff --git a/tests/unit/test_workflow.py b/tests/unit/test_workflow.py index da5399d..f5e108f 100644 --- a/tests/unit/test_workflow.py +++ b/tests/unit/test_workflow.py @@ -1,4 +1,4 @@ -import src.workflow_components.workflow as workflow +import raven_cycode.workflow_components.workflow as workflow from tests.utils import load_test_config, assert_reusable_workflow_inputs load_test_config() diff --git a/tests/utils.py b/tests/utils.py index b0724dc..0619d8e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,11 +1,11 @@ from py2neo.ogm import GraphObject import json -from src.config.config import Config -from src.workflow_components.composite_action import CompositeAction -from src.workflow_components.workflow import Workflow +from raven_cycode.config.config import Config +from raven_cycode.workflow_components.composite_action import CompositeAction +from raven_cycode.workflow_components.workflow import Workflow from typing import Tuple, List, Dict, Optional from tests.integration.integration_consts import START_NODE_INDEX, DEST_NODE_INDEX -from src.common.utils import raw_str_to_bool +from raven_cycode.common.utils import raw_str_to_bool from hashlib import md5