aiverify-moonshot 0.4.5__tar.gz → 0.4.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/scripts/create_backup.sh +12 -6
- aiverify_moonshot-0.4.6/.github/scripts/install_ms_service.sh +52 -0
- aiverify_moonshot-0.4.6/.github/scripts/moonshot_env +28 -0
- aiverify_moonshot-0.4.6/.github/scripts/moonshot_test_env +7 -0
- aiverify_moonshot-0.4.6/.github/scripts/moonshot_ui_env +5 -0
- aiverify_moonshot-0.4.6/.github/scripts/run_smoke_test.sh +53 -0
- aiverify_moonshot-0.4.6/.github/scripts/start_ms_service.sh +10 -0
- aiverify_moonshot-0.4.5/.github/workflows/smoke-test.yaml → aiverify_moonshot-0.4.6/.github/workflows/integration-test.yaml +19 -20
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/nightly-build.yaml +32 -5
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/pre-build-checks.yaml +37 -9
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/pypi-deployment.yaml +2 -3
- aiverify_moonshot-0.4.5/.github/workflows/codeql.yaml → aiverify_moonshot-0.4.6/.github/workflows/sast-codeql.yaml +60 -12
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/sca-scan.yaml +13 -3
- aiverify_moonshot-0.4.6/.github/workflows/smoke-test.yaml +135 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/test-pypi-deployment.yaml +0 -9
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/PKG-INFO +3 -2
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/README.md +1 -1
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/cookbook.py +226 -42
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/datasets.py +53 -8
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/metrics.py +48 -7
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/recipe.py +283 -42
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/result.py +73 -30
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/run.py +43 -11
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/runner.py +29 -20
- aiverify_moonshot-0.4.6/moonshot/integrations/cli/cli_errors.py +511 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/connectors.py +137 -6
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/dataset.py +66 -13
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/prompt_template.py +38 -2
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/session.py +126 -43
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/app.py +1 -1
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_bookmark.py +6 -6
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/bookmark/bookmark.py +119 -60
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/bookmark/bookmark_arguments.py +10 -0
- aiverify_moonshot-0.4.6/moonshot/src/messages_constants.py +40 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runners/runner.py +1 -1
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/pyproject.toml +9 -7
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/requirements.txt +6 -6
- aiverify_moonshot-0.4.5/.github/scripts/install_ms_service.sh +0 -28
- aiverify_moonshot-0.4.5/.github/scripts/run_smoke_test.sh +0 -35
- aiverify_moonshot-0.4.5/.github/scripts/start_ms_service.sh +0 -7
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.coveragerc +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.flake8 +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/pull_request_template.md +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.gitignore +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.pre-commit-config.yaml +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/AUTHORS.md +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/LICENSE.md +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/NOTICES.md +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/__main__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/api.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/__main__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/active_session_cfg.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/benchmark.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/cli.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/common.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/display_helper.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/initialisation/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/initialisation/initialisation.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/attack_module.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/context_strategy.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/prompt_template.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/redteam.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/utils/process_data.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/.env.dev +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/__main__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/container.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/log/.gitkeep +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/logging_conf.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/attack_modules.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/benchmark.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/benchmark_result.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/bookmark.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/context_strategy.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/cookbook.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/dataset.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/endpoint.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/metric.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/prompt_template.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/recipe.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/redteam.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/runner.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/benchmark_runner_dto.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/bookmark_create_dto.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/cookbook_create_dto.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/cookbook_response_model.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/dataset_create_dto.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/dataset_response_dto.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/endpoint_create_dto.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/endpoint_response_model.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/prompt_response_model.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/prompt_template_response_model.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/recipe_create_dto.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/recipe_response_model.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/session_create_dto.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/session_prompt_dto.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/session_response_model.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/attack_module_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/auto_red_team_test_manager.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/auto_red_team_test_state.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/base_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/benchmark_result_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/benchmark_test_manager.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/benchmark_test_state.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/benchmarking_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/bookmark_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/context_strategy_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/cookbook_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/dataset_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/endpoint_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/metric_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/prompt_template_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/recipe_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/runner_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/session_service.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/utils/exceptions_handler.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/utils/file_manager.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/utils/results_formatter.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/status_updater/interface/benchmark_progress_callback.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/status_updater/interface/redteam_progress_callback.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/status_updater/moonshot_ui_webhook.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/temp/.gitkeep +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/types/types.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_connector.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_connector_endpoint.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_context_strategy.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_cookbook.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_dataset.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_environment_variables.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_metrics.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_prompt_template.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_recipe.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_red_teaming.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_result.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_run.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_runner.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_session.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/configs/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/configs/env_variables.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors/connector.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors/connector_prompt_arguments.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors_endpoints/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors_endpoints/connector_endpoint.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors_endpoints/connector_endpoint_arguments.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/cookbooks/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/cookbooks/cookbook.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/cookbooks/cookbook_arguments.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/datasets/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/datasets/dataset.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/datasets/dataset_arguments.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/metrics/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/metrics/metric.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/metrics/metric_interface.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/prompt_templates/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/prompt_templates/prompt_template.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/recipes/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/recipes/recipe.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/recipes/recipe_arguments.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/attack/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/attack/attack_module.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/attack/attack_module_arguments.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/attack/context_strategy.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/context_strategy/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/context_strategy/context_strategy_interface.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/chat.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/red_teaming_progress.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/red_teaming_type.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/session.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/results/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/results/result.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/results/result_arguments.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runners/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runners/runner_arguments.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runners/runner_type.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/run.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/run_arguments.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/run_progress.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/run_status.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/storage/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/storage/db_interface.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/storage/io_interface.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/storage/storage.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/__init__.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/find_feature.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/import_modules.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/log.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/pagination.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/timeit.py +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/third-party/pygments-2.18.0-py3-none-any.whl +0 -0
- {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/third-party/text_unidecode-1.3-py2.py3-none-any.whl +0 -0
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
BASE_DIR=~/moonshot
|
|
4
|
+
MOONSHOT_DIR=moonshot-sit
|
|
5
|
+
|
|
6
|
+
# Moonshot SIT dir
|
|
7
|
+
SIT_DIR=$BASE_DIR/$MOONSHOT_DIR
|
|
8
|
+
|
|
9
|
+
# Backup directory and the maximum number of backups
|
|
10
|
+
BACKUP_DIR=$BASE_DIR/backups
|
|
5
11
|
MAX_BACKUPS=5
|
|
6
12
|
|
|
7
13
|
# Check if the moonshot directory exists
|
|
8
|
-
if [ ! -d
|
|
9
|
-
echo "Skip backup:
|
|
14
|
+
if [ ! -d $SIT_DIR ]; then
|
|
15
|
+
echo "Skip backup: $SIT_DIR dir does not exist."
|
|
10
16
|
exit 0
|
|
11
17
|
fi
|
|
12
18
|
|
|
@@ -30,5 +36,5 @@ else
|
|
|
30
36
|
new_backup=$highest_backup
|
|
31
37
|
fi
|
|
32
38
|
|
|
33
|
-
# Create a new backup by moving the moonshot
|
|
34
|
-
mv
|
|
39
|
+
# Create a new backup by moving the moonshot dir to the backup dir with the new backup number
|
|
40
|
+
mv $SIT_DIR $BACKUP_DIR/backup_$new_backup
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Arguments for branches, default to dev_main if not provided.
|
|
4
|
+
MOONSHOT_BRANCH=${1:-dev_main}
|
|
5
|
+
MOONSHOT_DATA_BRANCH=${2:-dev_main}
|
|
6
|
+
MOONSHOT_UI_BRANCH=${3:-dev_main}
|
|
7
|
+
|
|
8
|
+
BASE_DIR=~/moonshot
|
|
9
|
+
SCRIPTS_DIR=~/scripts
|
|
10
|
+
#BASE_DIR=./moonshot-test
|
|
11
|
+
#SCRIPTS_DIR=./.github/scripts
|
|
12
|
+
|
|
13
|
+
MOONSHOT_SIT=moonshot-sit
|
|
14
|
+
|
|
15
|
+
# Install moonshot from GitHub
|
|
16
|
+
|
|
17
|
+
# Create BASE_DIR if it does not
|
|
18
|
+
if [ ! -d "$BASE_DIR" ]; then
|
|
19
|
+
mkdir -p "$BASE_DIR"
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
cd $BASE_DIR
|
|
23
|
+
|
|
24
|
+
# Clone the repositories from the specified branches
|
|
25
|
+
echo "Cloning moonshot from branch $MOONSHOT_BRANCH"
|
|
26
|
+
echo "Cloning moonshot-data from branch $MOONSHOT_DATA_BRANCH"
|
|
27
|
+
echo "Cloning moonshot-ui from branch $MOONSHOT_UI_BRANCH"
|
|
28
|
+
git clone --branch $MOONSHOT_BRANCH https://github.com/aiverify-foundation/moonshot.git $MOONSHOT_SIT
|
|
29
|
+
cd $MOONSHOT_SIT
|
|
30
|
+
git clone --branch $MOONSHOT_DATA_BRANCH https://github.com/aiverify-foundation/moonshot-data.git
|
|
31
|
+
git clone --branch $MOONSHOT_UI_BRANCH https://github.com/aiverify-foundation/moonshot-ui.git
|
|
32
|
+
cp $SCRIPTS_DIR/moonshot_env .env
|
|
33
|
+
|
|
34
|
+
python3 -m venv venv
|
|
35
|
+
source venv/bin/activate
|
|
36
|
+
|
|
37
|
+
# Install Python dependencies
|
|
38
|
+
pip install -r requirements.txt
|
|
39
|
+
cd moonshot-data
|
|
40
|
+
pip install -r requirements.txt
|
|
41
|
+
|
|
42
|
+
# Install Node.js dependencies and build the UI
|
|
43
|
+
cd ../moonshot-ui
|
|
44
|
+
rm .env.local
|
|
45
|
+
cp $SCRIPTS_DIR/moonshot_ui_env .env.local
|
|
46
|
+
npm install
|
|
47
|
+
|
|
48
|
+
# Modify the start script in package.json
|
|
49
|
+
sudo apt-get install -y jq
|
|
50
|
+
jq '.scripts.start = "next start -H 0.0.0.0 -p 3100"' package.json > package.tmp.json && mv package.tmp.json package.json
|
|
51
|
+
|
|
52
|
+
npm run build
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# .env for moonshot SIT
|
|
2
|
+
|
|
3
|
+
# For Data
|
|
4
|
+
ATTACK_MODULES="./moonshot-data/attack-modules"
|
|
5
|
+
BOOKMARKS="./moonshot-data/generated-outputs/bookmarks"
|
|
6
|
+
CONNECTORS="./moonshot-data/connectors"
|
|
7
|
+
CONNECTORS_ENDPOINTS="./moonshot-data/connectors-endpoints"
|
|
8
|
+
CONTEXT_STRATEGY="./moonshot-data/context-strategy"
|
|
9
|
+
COOKBOOKS="./moonshot-data/cookbooks"
|
|
10
|
+
DATABASES="./moonshot-data/generated-outputs/databases"
|
|
11
|
+
DATABASES_MODULES="./moonshot-data/databases-modules"
|
|
12
|
+
DATASETS="./moonshot-data/datasets"
|
|
13
|
+
IO_MODULES="./moonshot-data/io-modules"
|
|
14
|
+
METRICS="./moonshot-data/metrics"
|
|
15
|
+
PROMPT_TEMPLATES="./moonshot-data/prompt-templates"
|
|
16
|
+
RECIPES="./moonshot-data/recipes"
|
|
17
|
+
RESULTS="./moonshot-data/generated-outputs/results"
|
|
18
|
+
RESULTS_MODULES="./moonshot-data/results-modules"
|
|
19
|
+
RUNNERS="./moonshot-data/generated-outputs/runners"
|
|
20
|
+
RUNNERS_MODULES="./moonshot-data/runners-modules"
|
|
21
|
+
TOKENIZERS_PARALLELISM = false
|
|
22
|
+
|
|
23
|
+
# For Web API
|
|
24
|
+
HOST_ADDRESS=127.0.0.1 # The interface the server will bind to
|
|
25
|
+
HOST_PORT=5100
|
|
26
|
+
|
|
27
|
+
# URI of the Web UI webhook
|
|
28
|
+
MOONSHOT_UI_CALLBACK_URL=http://localhost:3100/api/v1/benchmarks/status
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
AZURE_OPENAI_API_KEY=$1
|
|
4
|
+
AZURE_OPENAI_ENDPOINT=$2
|
|
5
|
+
TEST_BRANCH_NAME=${3:-main}
|
|
6
|
+
|
|
7
|
+
BASE_DIR=~/moonshot
|
|
8
|
+
SCRIPTS_DIR=~/scripts
|
|
9
|
+
|
|
10
|
+
# Export the env variables for smoke test to use
|
|
11
|
+
export AZURE_OPENAI_TOKEN=$AZURE_OPENAI_API_KEY
|
|
12
|
+
export AZURE_OPENAI_URI=$AZURE_OPENAI_ENDPOINT
|
|
13
|
+
export MOONSHOT_URL="http://127.0.0.1"
|
|
14
|
+
export MOONSHOT_PORT_NUMBER="3100"
|
|
15
|
+
export ADDITIONAL_PARAMETERS="{
|
|
16
|
+
\"timeout\": 300,
|
|
17
|
+
\"allow_retries\": true,
|
|
18
|
+
\"num_of_retries\": 3,
|
|
19
|
+
\"temperature\": 0.5,
|
|
20
|
+
\"model\": \"gpt-4o\"
|
|
21
|
+
}"
|
|
22
|
+
|
|
23
|
+
cd $BASE_DIR
|
|
24
|
+
|
|
25
|
+
if [ -d "moonshot-smoke-testing" ]; then
|
|
26
|
+
echo "Removing existing moonshot-smoke-testing directory..."
|
|
27
|
+
rm -rf moonshot-smoke-testing
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# Clone the smoke test repo from the specified branch
|
|
31
|
+
echo "Cloning moonshot-smoke-testing repo from branch $BRANCH_NAME..."
|
|
32
|
+
git clone --branch $TEST_BRANCH_NAME https://github.com/aiverify-foundation/moonshot-smoke-testing.git
|
|
33
|
+
cd moonshot-smoke-testing
|
|
34
|
+
npm ci
|
|
35
|
+
cp $SCRIPTS_DIR/moonshot_test_env .env
|
|
36
|
+
|
|
37
|
+
# Install Playwright (if needed)
|
|
38
|
+
#sudo npx playwright install-deps
|
|
39
|
+
### If the above didn't work, try the following:
|
|
40
|
+
##sudo apt-get install libatk1.0-0\
|
|
41
|
+
## libatk-bridge2.0-0\
|
|
42
|
+
## libxkbcommon0\
|
|
43
|
+
## libatspi2.0-0\
|
|
44
|
+
## libxcomposite1\
|
|
45
|
+
## libxdamage1\
|
|
46
|
+
## libxfixes3\
|
|
47
|
+
## libxrandr2\
|
|
48
|
+
## libgbml
|
|
49
|
+
|
|
50
|
+
echo "Running smoke test..."
|
|
51
|
+
npx playwright test tests/smoke-test.spec.ts --reporter=list
|
|
52
|
+
|
|
53
|
+
#echo "Exit code: $?"
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# Smoke Test
|
|
2
2
|
|
|
3
|
-
name: Moonshot
|
|
3
|
+
name: Moonshot Integration Test
|
|
4
4
|
|
|
5
5
|
on:
|
|
6
|
-
# Runs on Pull Request
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# - 'main'
|
|
6
|
+
# Runs on Pull Request Review
|
|
7
|
+
pull_request_review:
|
|
8
|
+
branches:
|
|
9
|
+
- 'main'
|
|
11
10
|
|
|
12
11
|
# Run this workflow manually from Actions tab
|
|
13
12
|
workflow_dispatch:
|
|
@@ -34,15 +33,15 @@ concurrency:
|
|
|
34
33
|
cancel-in-progress: true
|
|
35
34
|
|
|
36
35
|
jobs:
|
|
37
|
-
|
|
36
|
+
integration-test:
|
|
38
37
|
|
|
39
38
|
runs-on: ubuntu-latest
|
|
40
39
|
timeout-minutes: 20
|
|
41
40
|
|
|
42
41
|
steps:
|
|
43
42
|
|
|
44
|
-
- name: Checkout Moonshot (Pull Request)
|
|
45
|
-
if: github.event_name == '
|
|
43
|
+
- name: Checkout Moonshot (Pull Request Review)
|
|
44
|
+
if: github.event_name == 'pull_request_review'
|
|
46
45
|
uses: actions/checkout@v4
|
|
47
46
|
with:
|
|
48
47
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
@@ -68,8 +67,8 @@ jobs:
|
|
|
68
67
|
touch .env
|
|
69
68
|
echo "${{ vars.ENVIRONMENT_VARS }}" >> .env
|
|
70
69
|
|
|
71
|
-
- name: Checkout Moonshot Data (Pull Request)
|
|
72
|
-
if: github.event_name == '
|
|
70
|
+
- name: Checkout Moonshot Data (Pull Request Review)
|
|
71
|
+
if: github.event_name == 'pull_request_review'
|
|
73
72
|
uses: actions/checkout@v4
|
|
74
73
|
with:
|
|
75
74
|
repository: aiverify-foundation/moonshot-data
|
|
@@ -90,8 +89,8 @@ jobs:
|
|
|
90
89
|
cd moonshot-data
|
|
91
90
|
pip install -r requirements.txt
|
|
92
91
|
|
|
93
|
-
- name: Checkout Moonshot UI (Pull Request)
|
|
94
|
-
if: github.event_name == '
|
|
92
|
+
- name: Checkout Moonshot UI (Pull Request Review)
|
|
93
|
+
if: github.event_name == 'pull_request_review'
|
|
95
94
|
uses: actions/checkout@v4
|
|
96
95
|
with:
|
|
97
96
|
repository: aiverify-foundation/moonshot-ui
|
|
@@ -115,19 +114,19 @@ jobs:
|
|
|
115
114
|
source venv/bin/activate
|
|
116
115
|
python -m moonshot web &
|
|
117
116
|
|
|
118
|
-
- name: Checkout
|
|
117
|
+
- name: Checkout Integration Test
|
|
119
118
|
uses: actions/checkout@v4
|
|
120
119
|
with:
|
|
121
|
-
repository: aiverify-foundation/moonshot-
|
|
120
|
+
repository: aiverify-foundation/moonshot-integration-testing
|
|
122
121
|
path: moonshot-smoke-testing
|
|
123
122
|
|
|
124
|
-
- name: Run
|
|
123
|
+
- name: Run Integration Test
|
|
125
124
|
env:
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
AZURE_OPENAI_URI: ${{ secrets.AZURE_OPENAI_URI }}
|
|
126
|
+
AZURE_OPENAI_TOKEN: ${{ secrets.AZURE_OPENAI_TOKEN }}
|
|
128
127
|
ADDITIONAL_PARAMETERS: ${{ vars.ADDITIONAL_PARAMETERS }}
|
|
129
128
|
run: |
|
|
130
|
-
cd moonshot-smoke-testing
|
|
129
|
+
cd moonshot-smoke-testing/ui-integration-testing
|
|
131
130
|
npm ci
|
|
132
131
|
npx playwright install --with-deps
|
|
133
|
-
|
|
132
|
+
AZURE_OPENAI_URI="$AZURE_OPENAI_URI" AZURE_OPENAI_TOKEN="$AZURE_OPENAI_TOKEN" ADDITIONAL_PARAMETERS="$ADDITIONAL_PARAMETERS" npx playwright test
|
|
@@ -6,11 +6,22 @@ on:
|
|
|
6
6
|
# Run this workflow manually from Actions tab
|
|
7
7
|
workflow_dispatch:
|
|
8
8
|
inputs:
|
|
9
|
-
|
|
10
|
-
description: '
|
|
9
|
+
branch_moonshot:
|
|
10
|
+
description: 'moonshot branch or tag'
|
|
11
11
|
required: true
|
|
12
12
|
default: 'dev_main'
|
|
13
13
|
type: string
|
|
14
|
+
branch_moonshot_data:
|
|
15
|
+
description: 'moonshot-data branch or tag'
|
|
16
|
+
required: true
|
|
17
|
+
default: 'dev_main'
|
|
18
|
+
type: string
|
|
19
|
+
branch_moonshot_ui:
|
|
20
|
+
description: 'moonshot-ui branch or tag'
|
|
21
|
+
required: true
|
|
22
|
+
default: 'dev_main'
|
|
23
|
+
type: string
|
|
24
|
+
|
|
14
25
|
|
|
15
26
|
# Allow one concurrent deployment
|
|
16
27
|
concurrency:
|
|
@@ -67,7 +78,7 @@ jobs:
|
|
|
67
78
|
--instance-ids "${{ vars.AWS_SIT_INSTANCE_ID }}" \
|
|
68
79
|
--document-name "AWS-RunShellScript" \
|
|
69
80
|
--comment "Install moonshot" \
|
|
70
|
-
--parameters 'commands=["sudo su - ubuntu -c \". ~/scripts/install_ms_service.sh ${{ inputs.
|
|
81
|
+
--parameters 'commands=["sudo su - ubuntu -c \". ~/scripts/install_ms_service.sh ${{ inputs.branch_moonshot }} ${{ inputs.branch_moonshot_data }} ${{ inputs.branch_moonshot_ui }}\""]' \
|
|
71
82
|
--query "Command.CommandId" \
|
|
72
83
|
--output text)
|
|
73
84
|
|
|
@@ -120,7 +131,7 @@ jobs:
|
|
|
120
131
|
--instance-ids "${{ vars.AWS_SIT_INSTANCE_ID }}" \
|
|
121
132
|
--document-name "AWS-RunShellScript" \
|
|
122
133
|
--comment "Run smoke test" \
|
|
123
|
-
--parameters 'commands=["sudo su - ubuntu -c \". ~/scripts/run_smoke_test.sh\""]' \
|
|
134
|
+
--parameters 'commands=["sudo su - ubuntu -c \". ~/scripts/run_smoke_test.sh ${{ secrets.AZURE_OPENAI_TOKEN }} ${{ secrets.AZURE_OPENAI_URI }} \""]' \
|
|
124
135
|
--query "Command.CommandId" \
|
|
125
136
|
--output text)
|
|
126
137
|
|
|
@@ -141,6 +152,7 @@ jobs:
|
|
|
141
152
|
--instance-id "${{ vars.AWS_SIT_INSTANCE_ID }}" \
|
|
142
153
|
--query "StandardOutputContent" \
|
|
143
154
|
--output text)
|
|
155
|
+
echo "SMOKE_TEST_STATUS=$output" >> $GITHUB_ENV
|
|
144
156
|
echo "Smoke test output: $output"
|
|
145
157
|
echo "Command status: $status"
|
|
146
158
|
if [ "$status" == "Success" ]; then
|
|
@@ -159,4 +171,19 @@ jobs:
|
|
|
159
171
|
done
|
|
160
172
|
|
|
161
173
|
echo "Max attempts reached, exiting."
|
|
162
|
-
exit 1
|
|
174
|
+
exit 1
|
|
175
|
+
|
|
176
|
+
# Send slack notification
|
|
177
|
+
- name: Send slack notification
|
|
178
|
+
if: ${{ ! cancelled() }}
|
|
179
|
+
uses: slackapi/slack-github-action@v1.26.0
|
|
180
|
+
with:
|
|
181
|
+
payload: |
|
|
182
|
+
{
|
|
183
|
+
"workflow": "${{ github.repository }} | ${{ github.workflow }}",
|
|
184
|
+
"status": "${{ job.status }}",
|
|
185
|
+
"details": "${{ env.SMOKE_TEST_STATUS }}",
|
|
186
|
+
"ref": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
187
|
+
}
|
|
188
|
+
env:
|
|
189
|
+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
@@ -116,28 +116,56 @@ jobs:
|
|
|
116
116
|
if: ${{ ! cancelled() }}
|
|
117
117
|
timeout-minutes: 30
|
|
118
118
|
run: |
|
|
119
|
+
set +e
|
|
119
120
|
bash ci/run-test.sh
|
|
121
|
+
source ci/gen_pre_build_summ.sh test
|
|
122
|
+
test_status=$?
|
|
123
|
+
source ci/gen_pre_build_summ.sh coverage
|
|
124
|
+
coverage_status=$?
|
|
125
|
+
echo "UNIT_TESTS_STATUS=$UNITTEST_SUMMARY" >> $GITHUB_ENV
|
|
126
|
+
echo "CODE_COVERAGE_STATUS=$COVERAGE_SUMMARY" >> $GITHUB_ENV
|
|
127
|
+
set -e
|
|
128
|
+
if [ $test_status -ne 0 ] || [ $coverage_status -ne 0 ]; then
|
|
129
|
+
exit 1
|
|
130
|
+
fi
|
|
120
131
|
|
|
121
132
|
# Code quality analysis (flake8)
|
|
122
133
|
- name: Code quality analysis (flake8)
|
|
123
134
|
id: code_quality
|
|
124
135
|
if: ${{ ! cancelled() }}
|
|
125
136
|
run: |
|
|
137
|
+
set +e
|
|
126
138
|
bash ci/run-flake8.sh
|
|
139
|
+
source ci/gen_pre_build_summ.sh lint
|
|
140
|
+
lint_status=$?
|
|
141
|
+
echo "CODE_QUALITY_STATUS=$LINT_SUMMARY" >> $GITHUB_ENV
|
|
142
|
+
set -e
|
|
143
|
+
exit $lint_status
|
|
127
144
|
|
|
128
145
|
# pip-audit
|
|
129
146
|
- name: Dependency analysis (vulnerabilities & licenses)
|
|
130
147
|
id: dependency_analysis
|
|
131
148
|
if: ${{ ! cancelled() }}
|
|
132
149
|
run: |
|
|
150
|
+
set +e
|
|
133
151
|
bash ci/run-pip-audit.sh
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
echo "
|
|
139
|
-
echo "
|
|
140
|
-
|
|
152
|
+
source ci/gen_pre_build_summ.sh dependency
|
|
153
|
+
dep_status=$?
|
|
154
|
+
source ci/gen_pre_build_summ.sh license
|
|
155
|
+
lic_status=$?
|
|
156
|
+
echo "DEPENDENCY_STATUS=$DEPENDENCY_SUMMARY" >> $GITHUB_ENV
|
|
157
|
+
echo "LICENSE_STATUS=$LICENSE_SUMMARY" >> $GITHUB_ENV
|
|
158
|
+
set -e
|
|
159
|
+
if [ $dep_status -ne 0 ] || [ $lic_status -ne 0 ]; then
|
|
160
|
+
exit 1
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
# - name: Capture step statuses
|
|
164
|
+
# if: ${{ ! cancelled() }}
|
|
165
|
+
# run: |
|
|
166
|
+
# echo "UNIT_TESTS_STATUS=${{ steps.unit_tests.outcome }}" >> $GITHUB_ENV
|
|
167
|
+
# echo "CODE_QUALITY_STATUS=${{ steps.code_quality.outcome }}" >> $GITHUB_ENV
|
|
168
|
+
# echo "DEPENDENCY_ANALYSIS_STATUS=${{ steps.dependency_analysis.outcome }}" >> $GITHUB_ENV
|
|
141
169
|
|
|
142
170
|
# Send slack notification
|
|
143
171
|
- name: Send slack notification
|
|
@@ -146,9 +174,9 @@ jobs:
|
|
|
146
174
|
with:
|
|
147
175
|
payload: |
|
|
148
176
|
{
|
|
149
|
-
"workflow": "${{ github.repository }}
|
|
177
|
+
"workflow": "${{ github.repository }} | ${{ github.workflow }} | ${{ env.PR_NUM }}",
|
|
150
178
|
"status": "${{ job.status }}",
|
|
151
|
-
"details": "
|
|
179
|
+
"details": "${{ env.UNIT_TESTS_STATUS }} | ${{ env.CODE_COVERAGE_STATUS }} | ${{ env.CODE_QUALITY_STATUS }} | ${{ env.DEPENDENCY_STATUS }} | ${{ env.LICENSE_STATUS }}",
|
|
152
180
|
"ref": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
153
181
|
}
|
|
154
182
|
env:
|
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
- name: Set up Python
|
|
22
22
|
uses: actions/setup-python@v5
|
|
23
23
|
with:
|
|
24
|
-
python-version: "3.
|
|
24
|
+
python-version: "3.11.6"
|
|
25
25
|
- name: Install pypa/build
|
|
26
26
|
run: >-
|
|
27
27
|
python3 -m
|
|
@@ -39,13 +39,12 @@ jobs:
|
|
|
39
39
|
publish-to-pypi:
|
|
40
40
|
name: >-
|
|
41
41
|
Publish Python 🐍 distribution 📦 to PyPI
|
|
42
|
-
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
|
|
43
42
|
needs:
|
|
44
43
|
- build
|
|
45
44
|
runs-on: ubuntu-latest
|
|
46
45
|
environment:
|
|
47
46
|
name: pypi
|
|
48
|
-
url: https://pypi.org/p
|
|
47
|
+
url: https://pypi.org/p/aiverify-moonshot
|
|
49
48
|
permissions:
|
|
50
49
|
id-token: write # IMPORTANT: mandatory for trusted publishing
|
|
51
50
|
|
|
@@ -9,13 +9,18 @@
|
|
|
9
9
|
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
10
|
# supported CodeQL languages.
|
|
11
11
|
#
|
|
12
|
-
name: "CodeQL
|
|
12
|
+
name: "SAST - CodeQL"
|
|
13
13
|
|
|
14
14
|
on:
|
|
15
|
-
|
|
16
|
-
# branches: [ "main" ]
|
|
17
|
-
pull_request:
|
|
15
|
+
push:
|
|
18
16
|
branches: [ "main" ]
|
|
17
|
+
pull_request:
|
|
18
|
+
branches: [ "dev_main" ]
|
|
19
|
+
# # Trigger every Friday at 10:05pm (14:05 UTC)
|
|
20
|
+
# # cron: min hr day-of-mth mth day-of-week
|
|
21
|
+
# schedule:
|
|
22
|
+
# - cron: "5 14 * * 5"
|
|
23
|
+
|
|
19
24
|
workflow_dispatch:
|
|
20
25
|
inputs:
|
|
21
26
|
branch_to_test:
|
|
@@ -23,10 +28,14 @@ on:
|
|
|
23
28
|
required: true
|
|
24
29
|
default: 'dev_main'
|
|
25
30
|
type: string
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
|
|
32
|
+
workflow_call:
|
|
33
|
+
inputs:
|
|
34
|
+
branch_to_test:
|
|
35
|
+
description: 'Branch or tag to run test'
|
|
36
|
+
required: true
|
|
37
|
+
default: 'dev_main'
|
|
38
|
+
type: string
|
|
30
39
|
|
|
31
40
|
jobs:
|
|
32
41
|
analyze:
|
|
@@ -64,8 +73,24 @@ jobs:
|
|
|
64
73
|
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
|
65
74
|
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
|
66
75
|
steps:
|
|
67
|
-
|
|
76
|
+
|
|
77
|
+
- name: Set branch variable (pull_request)
|
|
78
|
+
if: github.event_name == 'pull_request'
|
|
79
|
+
run: |
|
|
80
|
+
echo "BRANCH=${{ github.event.pull_request.head.ref }}" >> "$GITHUB_ENV"
|
|
81
|
+
echo "PR_NUM=#${{ github.event.pull_request.number }}" >> "$GITHUB_ENV"
|
|
82
|
+
|
|
83
|
+
- name: Set branch variable (workflow_dispatch)
|
|
84
|
+
if: github.event_name == 'workflow_dispatch'
|
|
85
|
+
run: |
|
|
86
|
+
echo "BRANCH=${{ inputs.branch_to_test }}" >> "$GITHUB_ENV"
|
|
87
|
+
echo "PR_NUM=#0" >> "$GITHUB_ENV"
|
|
88
|
+
|
|
89
|
+
- name: Checkout Code
|
|
68
90
|
uses: actions/checkout@v4
|
|
91
|
+
with:
|
|
92
|
+
ref: ${{ env.BRANCH }}
|
|
93
|
+
submodules: recursive
|
|
69
94
|
|
|
70
95
|
# Initializes the CodeQL tools for scanning.
|
|
71
96
|
- name: Initialize CodeQL
|
|
@@ -102,8 +127,31 @@ jobs:
|
|
|
102
127
|
with:
|
|
103
128
|
category: "/language:${{matrix.language}}"
|
|
104
129
|
|
|
105
|
-
- name:
|
|
130
|
+
- name: Generate CodeQL Analysis Summary
|
|
131
|
+
id: codeql_summary
|
|
106
132
|
if: ${{ ! cancelled() }}
|
|
107
133
|
run: |
|
|
108
|
-
|
|
109
|
-
|
|
134
|
+
set +e
|
|
135
|
+
source ci/run-codeql-summ.sh
|
|
136
|
+
exit_code=$?
|
|
137
|
+
set -e
|
|
138
|
+
echo "CODEQL_SUMMARY=$CODEQL_SUMMARY" >> $GITHUB_ENV
|
|
139
|
+
exit $exit_code
|
|
140
|
+
env:
|
|
141
|
+
GH_TOKEN: ${{ github.token }}
|
|
142
|
+
|
|
143
|
+
# Send slack notification
|
|
144
|
+
- name: Send slack notification
|
|
145
|
+
if: ${{ ! cancelled() }}
|
|
146
|
+
uses: slackapi/slack-github-action@v1.26.0
|
|
147
|
+
with:
|
|
148
|
+
payload: |
|
|
149
|
+
{
|
|
150
|
+
"workflow": "${{ github.repository }} - ${{ github.workflow }} - ${{ env.PR_NUM }}",
|
|
151
|
+
"status": "SAST: ${{ steps.codeql_summary.outcome }}",
|
|
152
|
+
"details": "${{ env.CODEQL_SUMMARY }}",
|
|
153
|
+
"ref": "${{ github.server_url }}/${{ github.repository }}/security/code-scanning"
|
|
154
|
+
}
|
|
155
|
+
env:
|
|
156
|
+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
157
|
+
|
|
@@ -27,7 +27,7 @@ jobs:
|
|
|
27
27
|
steps:
|
|
28
28
|
|
|
29
29
|
- name: Checkout Code (Pull_Request)
|
|
30
|
-
|
|
30
|
+
if: github.event_name == 'pull_request'
|
|
31
31
|
uses: actions/checkout@v3
|
|
32
32
|
with:
|
|
33
33
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
@@ -41,7 +41,7 @@ jobs:
|
|
|
41
41
|
ref: ${{ inputs.branch_to_test }}
|
|
42
42
|
|
|
43
43
|
- name: Set Branch Variable (Pull_Request)
|
|
44
|
-
|
|
44
|
+
if: github.event_name == 'pull_request'
|
|
45
45
|
run: |
|
|
46
46
|
echo "BRANCH=branch" >> "$GITHUB_ENV"
|
|
47
47
|
|
|
@@ -55,7 +55,17 @@ jobs:
|
|
|
55
55
|
with:
|
|
56
56
|
python-version: "3.11"
|
|
57
57
|
|
|
58
|
-
- name: Install & Scan MOONSHOT
|
|
58
|
+
- name: Install & Scan MOONSHOT (Pull_Request)
|
|
59
|
+
if: github.event_name == 'pull_request'
|
|
60
|
+
run: |
|
|
61
|
+
python -m venv venv
|
|
62
|
+
source venv/bin/activate
|
|
63
|
+
pip install -r requirements.txt
|
|
64
|
+
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=aiverify-moonshot --detect.project.version.name=$BRANCH --detect.source.path=. --detect.code.location.name="aiverify-moonshot_$BRANCH" --detect.excluded.directories=/tests --blackduck.trust.cert=true --detect.excluded.detector.types=POETRY --detect.blackduck.scan.mode=RAPID
|
|
65
|
+
cd ../
|
|
66
|
+
|
|
67
|
+
- name: Install & Scan MOONSHOT (Workflow_Dispatch)
|
|
68
|
+
if: github.event_name == 'workflow_dispatch'
|
|
59
69
|
run: |
|
|
60
70
|
python -m venv venv
|
|
61
71
|
source venv/bin/activate
|