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.
Files changed (205) hide show
  1. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/scripts/create_backup.sh +12 -6
  2. aiverify_moonshot-0.4.6/.github/scripts/install_ms_service.sh +52 -0
  3. aiverify_moonshot-0.4.6/.github/scripts/moonshot_env +28 -0
  4. aiverify_moonshot-0.4.6/.github/scripts/moonshot_test_env +7 -0
  5. aiverify_moonshot-0.4.6/.github/scripts/moonshot_ui_env +5 -0
  6. aiverify_moonshot-0.4.6/.github/scripts/run_smoke_test.sh +53 -0
  7. aiverify_moonshot-0.4.6/.github/scripts/start_ms_service.sh +10 -0
  8. aiverify_moonshot-0.4.5/.github/workflows/smoke-test.yaml → aiverify_moonshot-0.4.6/.github/workflows/integration-test.yaml +19 -20
  9. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/nightly-build.yaml +32 -5
  10. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/pre-build-checks.yaml +37 -9
  11. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/pypi-deployment.yaml +2 -3
  12. aiverify_moonshot-0.4.5/.github/workflows/codeql.yaml → aiverify_moonshot-0.4.6/.github/workflows/sast-codeql.yaml +60 -12
  13. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/sca-scan.yaml +13 -3
  14. aiverify_moonshot-0.4.6/.github/workflows/smoke-test.yaml +135 -0
  15. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/workflows/test-pypi-deployment.yaml +0 -9
  16. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/PKG-INFO +3 -2
  17. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/README.md +1 -1
  18. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/cookbook.py +226 -42
  19. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/datasets.py +53 -8
  20. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/metrics.py +48 -7
  21. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/recipe.py +283 -42
  22. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/result.py +73 -30
  23. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/run.py +43 -11
  24. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/runner.py +29 -20
  25. aiverify_moonshot-0.4.6/moonshot/integrations/cli/cli_errors.py +511 -0
  26. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/connectors.py +137 -6
  27. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/dataset.py +66 -13
  28. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/prompt_template.py +38 -2
  29. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/session.py +126 -43
  30. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/app.py +1 -1
  31. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_bookmark.py +6 -6
  32. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/bookmark/bookmark.py +119 -60
  33. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/bookmark/bookmark_arguments.py +10 -0
  34. aiverify_moonshot-0.4.6/moonshot/src/messages_constants.py +40 -0
  35. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runners/runner.py +1 -1
  36. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/pyproject.toml +9 -7
  37. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/requirements.txt +6 -6
  38. aiverify_moonshot-0.4.5/.github/scripts/install_ms_service.sh +0 -28
  39. aiverify_moonshot-0.4.5/.github/scripts/run_smoke_test.sh +0 -35
  40. aiverify_moonshot-0.4.5/.github/scripts/start_ms_service.sh +0 -7
  41. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.coveragerc +0 -0
  42. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.flake8 +0 -0
  43. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.github/pull_request_template.md +0 -0
  44. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.gitignore +0 -0
  45. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/.pre-commit-config.yaml +0 -0
  46. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/AUTHORS.md +0 -0
  47. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/LICENSE.md +0 -0
  48. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/NOTICES.md +0 -0
  49. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/__init__.py +0 -0
  50. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/__main__.py +0 -0
  51. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/api.py +0 -0
  52. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/__init__.py +0 -0
  53. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/__init__.py +0 -0
  54. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/__main__.py +0 -0
  55. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/active_session_cfg.py +0 -0
  56. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/__init__.py +0 -0
  57. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/benchmark/benchmark.py +0 -0
  58. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/cli.py +0 -0
  59. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/__init__.py +0 -0
  60. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/common.py +0 -0
  61. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/common/display_helper.py +0 -0
  62. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/initialisation/__init__.py +0 -0
  63. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/initialisation/initialisation.py +0 -0
  64. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/__init__.py +0 -0
  65. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/attack_module.py +0 -0
  66. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/context_strategy.py +0 -0
  67. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/prompt_template.py +0 -0
  68. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/redteam/redteam.py +0 -0
  69. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/cli/utils/process_data.py +0 -0
  70. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/.env.dev +0 -0
  71. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/__init__.py +0 -0
  72. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/__main__.py +0 -0
  73. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/container.py +0 -0
  74. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/log/.gitkeep +0 -0
  75. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/logging_conf.py +0 -0
  76. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/__init__.py +0 -0
  77. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/attack_modules.py +0 -0
  78. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/benchmark.py +0 -0
  79. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/benchmark_result.py +0 -0
  80. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/bookmark.py +0 -0
  81. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/context_strategy.py +0 -0
  82. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/cookbook.py +0 -0
  83. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/dataset.py +0 -0
  84. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/endpoint.py +0 -0
  85. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/metric.py +0 -0
  86. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/prompt_template.py +0 -0
  87. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/recipe.py +0 -0
  88. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/redteam.py +0 -0
  89. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/routes/runner.py +0 -0
  90. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/__init__.py +0 -0
  91. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/benchmark_runner_dto.py +0 -0
  92. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/bookmark_create_dto.py +0 -0
  93. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/cookbook_create_dto.py +0 -0
  94. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/cookbook_response_model.py +0 -0
  95. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/dataset_create_dto.py +0 -0
  96. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/dataset_response_dto.py +0 -0
  97. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/endpoint_create_dto.py +0 -0
  98. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/endpoint_response_model.py +0 -0
  99. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/prompt_response_model.py +0 -0
  100. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/prompt_template_response_model.py +0 -0
  101. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/recipe_create_dto.py +0 -0
  102. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/recipe_response_model.py +0 -0
  103. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/session_create_dto.py +0 -0
  104. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/session_prompt_dto.py +0 -0
  105. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/schemas/session_response_model.py +0 -0
  106. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/__init__.py +0 -0
  107. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/attack_module_service.py +0 -0
  108. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/auto_red_team_test_manager.py +0 -0
  109. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/auto_red_team_test_state.py +0 -0
  110. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/base_service.py +0 -0
  111. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/benchmark_result_service.py +0 -0
  112. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/benchmark_test_manager.py +0 -0
  113. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/benchmark_test_state.py +0 -0
  114. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/benchmarking_service.py +0 -0
  115. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/bookmark_service.py +0 -0
  116. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/context_strategy_service.py +0 -0
  117. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/cookbook_service.py +0 -0
  118. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/dataset_service.py +0 -0
  119. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/endpoint_service.py +0 -0
  120. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/metric_service.py +0 -0
  121. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/prompt_template_service.py +0 -0
  122. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/recipe_service.py +0 -0
  123. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/runner_service.py +0 -0
  124. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/session_service.py +0 -0
  125. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/utils/exceptions_handler.py +0 -0
  126. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/utils/file_manager.py +0 -0
  127. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/services/utils/results_formatter.py +0 -0
  128. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/status_updater/interface/benchmark_progress_callback.py +0 -0
  129. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/status_updater/interface/redteam_progress_callback.py +0 -0
  130. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/status_updater/moonshot_ui_webhook.py +0 -0
  131. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/temp/.gitkeep +0 -0
  132. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/integrations/web_api/types/types.py +0 -0
  133. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/__init__.py +0 -0
  134. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/__init__.py +0 -0
  135. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_connector.py +0 -0
  136. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_connector_endpoint.py +0 -0
  137. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_context_strategy.py +0 -0
  138. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_cookbook.py +0 -0
  139. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_dataset.py +0 -0
  140. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_environment_variables.py +0 -0
  141. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_metrics.py +0 -0
  142. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_prompt_template.py +0 -0
  143. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_recipe.py +0 -0
  144. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_red_teaming.py +0 -0
  145. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_result.py +0 -0
  146. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_run.py +0 -0
  147. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_runner.py +0 -0
  148. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/api/api_session.py +0 -0
  149. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/configs/__init__.py +0 -0
  150. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/configs/env_variables.py +0 -0
  151. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors/__init__.py +0 -0
  152. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors/connector.py +0 -0
  153. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors/connector_prompt_arguments.py +0 -0
  154. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors_endpoints/__init__.py +0 -0
  155. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors_endpoints/connector_endpoint.py +0 -0
  156. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/connectors_endpoints/connector_endpoint_arguments.py +0 -0
  157. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/cookbooks/__init__.py +0 -0
  158. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/cookbooks/cookbook.py +0 -0
  159. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/cookbooks/cookbook_arguments.py +0 -0
  160. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/datasets/__init__.py +0 -0
  161. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/datasets/dataset.py +0 -0
  162. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/datasets/dataset_arguments.py +0 -0
  163. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/metrics/__init__.py +0 -0
  164. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/metrics/metric.py +0 -0
  165. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/metrics/metric_interface.py +0 -0
  166. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/prompt_templates/__init__.py +0 -0
  167. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/prompt_templates/prompt_template.py +0 -0
  168. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/recipes/__init__.py +0 -0
  169. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/recipes/recipe.py +0 -0
  170. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/recipes/recipe_arguments.py +0 -0
  171. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/__init__.py +0 -0
  172. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/attack/__init__.py +0 -0
  173. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/attack/attack_module.py +0 -0
  174. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/attack/attack_module_arguments.py +0 -0
  175. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/attack/context_strategy.py +0 -0
  176. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/context_strategy/__init__.py +0 -0
  177. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/context_strategy/context_strategy_interface.py +0 -0
  178. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/__init__.py +0 -0
  179. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/chat.py +0 -0
  180. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/red_teaming_progress.py +0 -0
  181. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/red_teaming_type.py +0 -0
  182. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/redteaming/session/session.py +0 -0
  183. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/results/__init__.py +0 -0
  184. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/results/result.py +0 -0
  185. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/results/result_arguments.py +0 -0
  186. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runners/__init__.py +0 -0
  187. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runners/runner_arguments.py +0 -0
  188. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runners/runner_type.py +0 -0
  189. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/__init__.py +0 -0
  190. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/run.py +0 -0
  191. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/run_arguments.py +0 -0
  192. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/run_progress.py +0 -0
  193. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/runs/run_status.py +0 -0
  194. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/storage/__init__.py +0 -0
  195. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/storage/db_interface.py +0 -0
  196. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/storage/io_interface.py +0 -0
  197. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/storage/storage.py +0 -0
  198. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/__init__.py +0 -0
  199. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/find_feature.py +0 -0
  200. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/import_modules.py +0 -0
  201. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/log.py +0 -0
  202. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/pagination.py +0 -0
  203. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/moonshot/src/utils/timeit.py +0 -0
  204. {aiverify_moonshot-0.4.5 → aiverify_moonshot-0.4.6}/third-party/pygments-2.18.0-py3-none-any.whl +0 -0
  205. {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
- # Define the backup directory and the maximum number of backups
4
- BACKUP_DIR=~/moonshot/backups
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 ~/moonshot/moonshot ]; then
9
- echo "Skip backup: ~/moonshot/moonshot dir does not exist."
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 directory to the backup directory with the new backup number
34
- mv ~/moonshot/moonshot $BACKUP_DIR/backup_$new_backup
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,7 @@
1
+ ADDITIONAL_PARAMETERS='{
2
+ "timeout": 300,
3
+ "allow_retries": true,
4
+ "num_of_retries": 3,
5
+ "temperature": 0.5,
6
+ "model": "gpt-4o"
7
+ }'
@@ -0,0 +1,5 @@
1
+ # .env for moonshot-ui SIT
2
+
3
+ HOST=127.0.0.1
4
+ PORT=3100
5
+ MOONSHOT_API_URL=http://0.0.0.0:5100
@@ -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: $?"
@@ -0,0 +1,10 @@
1
+ !/bin/bash
2
+
3
+ BASE_DIR=~/moonshot
4
+ MOONSHOT_SIT=moonshot-sit
5
+
6
+ cd $BASE_DIR/$MOONSHOT_SIT
7
+
8
+ source venv/bin/activate
9
+ python -m moonshot web
10
+
@@ -1,13 +1,12 @@
1
1
  # Smoke Test
2
2
 
3
- name: Moonshot Smoke Test
3
+ name: Moonshot Integration Test
4
4
 
5
5
  on:
6
- # Runs on Pull Request
7
- pull_request:
8
- # types: [submitted]
9
- # branches:
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
- smoke-test:
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 == 'pull_request'
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 == 'pull_request'
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 == 'pull_request'
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 Smoke Test
117
+ - name: Checkout Integration Test
119
118
  uses: actions/checkout@v4
120
119
  with:
121
- repository: aiverify-foundation/moonshot-smoke-testing
120
+ repository: aiverify-foundation/moonshot-integration-testing
122
121
  path: moonshot-smoke-testing
123
122
 
124
- - name: Run Smoke Test
123
+ - name: Run Integration Test
125
124
  env:
126
- URI: ${{ secrets.URI }}
127
- TOKEN: ${{ secrets.TOKEN }}
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
- URI="$URI" TOKEN="$TOKEN" ADDITIONAL_PARAMETERS="$ADDITIONAL_PARAMETERS" npx playwright test tests/smoke-test.spec.ts
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
- branch_to_test:
10
- description: 'Branch or tag to build'
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.branch_to_test }}\""]' \
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
- - name: Capture step statuses
136
- if: ${{ ! cancelled() }}
137
- run: |
138
- echo "UNIT_TESTS_STATUS=${{ steps.unit_tests.outcome }}" >> $GITHUB_ENV
139
- echo "CODE_QUALITY_STATUS=${{ steps.code_quality.outcome }}" >> $GITHUB_ENV
140
- echo "DEPENDENCY_ANALYSIS_STATUS=${{ steps.dependency_analysis.outcome }}" >> $GITHUB_ENV
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 }} - ${{ github.workflow }} - ${{ env.PR_NUM }}",
177
+ "workflow": "${{ github.repository }} | ${{ github.workflow }} | ${{ env.PR_NUM }}",
150
178
  "status": "${{ job.status }}",
151
- "details": "Unit Tests: ${{ env.UNIT_TESTS_STATUS }}, Code Quality: ${{ env.CODE_QUALITY_STATUS }}, Dependency Analysis: ${{ env.DEPENDENCY_ANALYSIS_STATUS }}",
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.x"
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/<package-name> # Replace <package-name> with your PyPI project name
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 (SAST)"
12
+ name: "SAST - CodeQL"
13
13
 
14
14
  on:
15
- # push:
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
- # Trigger every Friday at 10:05pm (14:05 UTC)
27
- # cron: min hr day-of-mth mth day-of-week
28
- schedule:
29
- - cron: "5 14 * * 5"
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
- - name: Checkout repository
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: Capture step statuses
130
+ - name: Generate CodeQL Analysis Summary
131
+ id: codeql_summary
106
132
  if: ${{ ! cancelled() }}
107
133
  run: |
108
- echo "CODEQL_ANALYSIS=${{ steps.codeql_analysis.outcome }}" >> $GITHUB_ENV
109
- echo "CodeQL Analysis Status: $CODEQL_ANALYSIS"
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
- # if: github.event_name == 'pull_request'
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
- # if: github.event_name == 'pull_request'
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