aiverify-moonshot 0.4.4__tar.gz → 0.4.5__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 (196) hide show
  1. aiverify_moonshot-0.4.5/.github/scripts/create_backup.sh +34 -0
  2. aiverify_moonshot-0.4.5/.github/scripts/install_ms_service.sh +28 -0
  3. aiverify_moonshot-0.4.5/.github/scripts/run_smoke_test.sh +35 -0
  4. aiverify_moonshot-0.4.5/.github/scripts/start_ms_service.sh +7 -0
  5. aiverify_moonshot-0.4.5/.github/workflows/codeql.yaml +109 -0
  6. aiverify_moonshot-0.4.5/.github/workflows/nightly-build.yaml +162 -0
  7. aiverify_moonshot-0.4.5/.github/workflows/pre-build-checks.yaml +155 -0
  8. aiverify_moonshot-0.4.5/.github/workflows/pypi-deployment.yaml +102 -0
  9. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/.github/workflows/smoke-test.yaml +8 -2
  10. aiverify_moonshot-0.4.5/.github/workflows/test-pypi-deployment.yaml +70 -0
  11. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/PKG-INFO +2 -2
  12. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/README.md +1 -1
  13. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/__main__.py +125 -54
  14. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/app.py +1 -1
  15. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/bookmark.py +7 -4
  16. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/configs/env_variables.py +7 -3
  17. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/runs/run.py +7 -0
  18. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/pyproject.toml +2 -2
  19. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/.coveragerc +0 -0
  20. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/.flake8 +0 -0
  21. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/.github/pull_request_template.md +0 -0
  22. /aiverify_moonshot-0.4.4/.github/workflows/sca_scan.yaml → /aiverify_moonshot-0.4.5/.github/workflows/sca-scan.yaml +0 -0
  23. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/.gitignore +0 -0
  24. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/.pre-commit-config.yaml +0 -0
  25. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/AUTHORS.md +0 -0
  26. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/LICENSE.md +0 -0
  27. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/NOTICES.md +0 -0
  28. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/__init__.py +0 -0
  29. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/api.py +0 -0
  30. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/__init__.py +0 -0
  31. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/__init__.py +0 -0
  32. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/__main__.py +0 -0
  33. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/active_session_cfg.py +0 -0
  34. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/benchmark/__init__.py +0 -0
  35. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/benchmark/benchmark.py +0 -0
  36. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/benchmark/cookbook.py +0 -0
  37. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/benchmark/datasets.py +0 -0
  38. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/benchmark/metrics.py +0 -0
  39. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/benchmark/recipe.py +0 -0
  40. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/benchmark/result.py +0 -0
  41. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/benchmark/run.py +0 -0
  42. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/benchmark/runner.py +0 -0
  43. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/cli.py +0 -0
  44. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/common/__init__.py +0 -0
  45. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/common/common.py +0 -0
  46. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/common/connectors.py +0 -0
  47. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/common/dataset.py +0 -0
  48. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/common/display_helper.py +0 -0
  49. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/common/prompt_template.py +0 -0
  50. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/initialisation/__init__.py +0 -0
  51. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/initialisation/initialisation.py +0 -0
  52. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/redteam/__init__.py +0 -0
  53. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/redteam/attack_module.py +0 -0
  54. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/redteam/context_strategy.py +0 -0
  55. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/redteam/prompt_template.py +0 -0
  56. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/redteam/redteam.py +0 -0
  57. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/redteam/session.py +0 -0
  58. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/cli/utils/process_data.py +0 -0
  59. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/.env.dev +0 -0
  60. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/__init__.py +0 -0
  61. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/__main__.py +0 -0
  62. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/container.py +0 -0
  63. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/log/.gitkeep +0 -0
  64. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/logging_conf.py +0 -0
  65. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/__init__.py +0 -0
  66. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/attack_modules.py +0 -0
  67. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/benchmark.py +0 -0
  68. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/benchmark_result.py +0 -0
  69. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/context_strategy.py +0 -0
  70. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/cookbook.py +0 -0
  71. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/dataset.py +0 -0
  72. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/endpoint.py +0 -0
  73. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/metric.py +0 -0
  74. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/prompt_template.py +0 -0
  75. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/recipe.py +0 -0
  76. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/redteam.py +0 -0
  77. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/routes/runner.py +0 -0
  78. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/__init__.py +0 -0
  79. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/benchmark_runner_dto.py +0 -0
  80. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/bookmark_create_dto.py +0 -0
  81. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/cookbook_create_dto.py +0 -0
  82. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/cookbook_response_model.py +0 -0
  83. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/dataset_create_dto.py +0 -0
  84. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/dataset_response_dto.py +0 -0
  85. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/endpoint_create_dto.py +0 -0
  86. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/endpoint_response_model.py +0 -0
  87. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/prompt_response_model.py +0 -0
  88. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/prompt_template_response_model.py +0 -0
  89. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/recipe_create_dto.py +0 -0
  90. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/recipe_response_model.py +0 -0
  91. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/session_create_dto.py +0 -0
  92. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/session_prompt_dto.py +0 -0
  93. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/schemas/session_response_model.py +0 -0
  94. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/__init__.py +0 -0
  95. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/attack_module_service.py +0 -0
  96. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/auto_red_team_test_manager.py +0 -0
  97. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/auto_red_team_test_state.py +0 -0
  98. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/base_service.py +0 -0
  99. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/benchmark_result_service.py +0 -0
  100. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/benchmark_test_manager.py +0 -0
  101. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/benchmark_test_state.py +0 -0
  102. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/benchmarking_service.py +0 -0
  103. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/bookmark_service.py +0 -0
  104. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/context_strategy_service.py +0 -0
  105. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/cookbook_service.py +0 -0
  106. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/dataset_service.py +0 -0
  107. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/endpoint_service.py +0 -0
  108. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/metric_service.py +0 -0
  109. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/prompt_template_service.py +0 -0
  110. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/recipe_service.py +0 -0
  111. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/runner_service.py +0 -0
  112. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/session_service.py +0 -0
  113. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/utils/exceptions_handler.py +0 -0
  114. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/utils/file_manager.py +0 -0
  115. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/services/utils/results_formatter.py +0 -0
  116. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/status_updater/interface/benchmark_progress_callback.py +0 -0
  117. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/status_updater/interface/redteam_progress_callback.py +0 -0
  118. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/status_updater/moonshot_ui_webhook.py +0 -0
  119. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/temp/.gitkeep +0 -0
  120. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/integrations/web_api/types/types.py +0 -0
  121. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/__init__.py +0 -0
  122. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/__init__.py +0 -0
  123. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_bookmark.py +0 -0
  124. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_connector.py +0 -0
  125. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_connector_endpoint.py +0 -0
  126. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_context_strategy.py +0 -0
  127. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_cookbook.py +0 -0
  128. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_dataset.py +0 -0
  129. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_environment_variables.py +0 -0
  130. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_metrics.py +0 -0
  131. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_prompt_template.py +0 -0
  132. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_recipe.py +0 -0
  133. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_red_teaming.py +0 -0
  134. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_result.py +0 -0
  135. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_run.py +0 -0
  136. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_runner.py +0 -0
  137. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/api/api_session.py +0 -0
  138. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/bookmark/bookmark.py +0 -0
  139. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/bookmark/bookmark_arguments.py +0 -0
  140. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/configs/__init__.py +0 -0
  141. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/connectors/__init__.py +0 -0
  142. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/connectors/connector.py +0 -0
  143. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/connectors/connector_prompt_arguments.py +0 -0
  144. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/connectors_endpoints/__init__.py +0 -0
  145. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/connectors_endpoints/connector_endpoint.py +0 -0
  146. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/connectors_endpoints/connector_endpoint_arguments.py +0 -0
  147. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/cookbooks/__init__.py +0 -0
  148. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/cookbooks/cookbook.py +0 -0
  149. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/cookbooks/cookbook_arguments.py +0 -0
  150. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/datasets/__init__.py +0 -0
  151. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/datasets/dataset.py +0 -0
  152. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/datasets/dataset_arguments.py +0 -0
  153. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/metrics/__init__.py +0 -0
  154. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/metrics/metric.py +0 -0
  155. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/metrics/metric_interface.py +0 -0
  156. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/prompt_templates/__init__.py +0 -0
  157. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/prompt_templates/prompt_template.py +0 -0
  158. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/recipes/__init__.py +0 -0
  159. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/recipes/recipe.py +0 -0
  160. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/recipes/recipe_arguments.py +0 -0
  161. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/__init__.py +0 -0
  162. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/attack/__init__.py +0 -0
  163. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/attack/attack_module.py +0 -0
  164. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/attack/attack_module_arguments.py +0 -0
  165. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/attack/context_strategy.py +0 -0
  166. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/context_strategy/__init__.py +0 -0
  167. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/context_strategy/context_strategy_interface.py +0 -0
  168. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/session/__init__.py +0 -0
  169. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/session/chat.py +0 -0
  170. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/session/red_teaming_progress.py +0 -0
  171. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/session/red_teaming_type.py +0 -0
  172. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/redteaming/session/session.py +0 -0
  173. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/results/__init__.py +0 -0
  174. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/results/result.py +0 -0
  175. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/results/result_arguments.py +0 -0
  176. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/runners/__init__.py +0 -0
  177. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/runners/runner.py +0 -0
  178. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/runners/runner_arguments.py +0 -0
  179. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/runners/runner_type.py +0 -0
  180. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/runs/__init__.py +0 -0
  181. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/runs/run_arguments.py +0 -0
  182. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/runs/run_progress.py +0 -0
  183. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/runs/run_status.py +0 -0
  184. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/storage/__init__.py +0 -0
  185. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/storage/db_interface.py +0 -0
  186. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/storage/io_interface.py +0 -0
  187. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/storage/storage.py +0 -0
  188. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/utils/__init__.py +0 -0
  189. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/utils/find_feature.py +0 -0
  190. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/utils/import_modules.py +0 -0
  191. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/utils/log.py +0 -0
  192. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/utils/pagination.py +0 -0
  193. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/moonshot/src/utils/timeit.py +0 -0
  194. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/requirements.txt +0 -0
  195. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/third-party/pygments-2.18.0-py3-none-any.whl +0 -0
  196. {aiverify_moonshot-0.4.4 → aiverify_moonshot-0.4.5}/third-party/text_unidecode-1.3-py2.py3-none-any.whl +0 -0
@@ -0,0 +1,34 @@
1
+ #!/bin/bash
2
+
3
+ # Define the backup directory and the maximum number of backups
4
+ BACKUP_DIR=~/moonshot/backups
5
+ MAX_BACKUPS=5
6
+
7
+ # Check if the moonshot directory exists
8
+ if [ ! -d ~/moonshot/moonshot ]; then
9
+ echo "Skip backup: ~/moonshot/moonshot dir does not exist."
10
+ exit 0
11
+ fi
12
+
13
+ # Create the backup directory if it doesn't exist
14
+ mkdir -p $BACKUP_DIR
15
+
16
+ # Find the highest existing backup number
17
+ highest_backup=$(ls $BACKUP_DIR | grep -oP 'backup_\d+' | grep -oP '\d+' | sort -n | tail -1)
18
+ highest_backup=${highest_backup:-0}
19
+
20
+ # If the number of backups is less than the maximum, increment the highest backup number
21
+ if [ $(ls $BACKUP_DIR | wc -l) -lt $MAX_BACKUPS ]; then
22
+ new_backup=$((highest_backup + 1))
23
+ else
24
+ # If the number of backups is equal to the maximum, delete the oldest backup and shift the remaining backups
25
+ oldest_backup=$(ls $BACKUP_DIR | grep -oP 'backup_\d+' | grep -oP '\d+' | sort -n | head -1)
26
+ rm -rf $BACKUP_DIR/backup_$oldest_backup
27
+ for i in $(seq $((oldest_backup + 1)) $highest_backup); do
28
+ mv $BACKUP_DIR/backup_$i $BACKUP_DIR/backup_$((i - 1))
29
+ done
30
+ new_backup=$highest_backup
31
+ fi
32
+
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
@@ -0,0 +1,28 @@
1
+ !/bin/bash
2
+
3
+ # Check if branch name is provided, default to dev_main if not
4
+ BRANCH_NAME=${1:-dev_main}
5
+
6
+ # Install moonshot from GitHub
7
+
8
+ cd ~/moonshot
9
+
10
+ # Clone the repositories from the specified branch
11
+ git clone --branch $BRANCH_NAME https://github.com/aiverify-foundation/moonshot.git
12
+ cd moonshot
13
+ git clone --branch $BRANCH_NAME https://github.com/aiverify-foundation/moonshot-data.git
14
+ git clone --branch $BRANCH_NAME https://github.com/aiverify-foundation/moonshot-ui.git
15
+ cp ~/scripts/.env .
16
+
17
+ python3 -m venv venv
18
+ source venv/bin/activate
19
+
20
+ # Install Python dependencies
21
+ pip install -r requirements.txt
22
+ cd moonshot-data
23
+ pip install -r requirements.txt
24
+
25
+ # Install Node.js dependencies and build the UI
26
+ cd ../moonshot-ui
27
+ npm install
28
+ npm run build
@@ -0,0 +1,35 @@
1
+ #!/bin/bash
2
+
3
+ # Check if branch name is provided, default to dev_main if not
4
+ BRANCH_NAME=${1:-main}
5
+
6
+ cd ~/moonshot
7
+
8
+ if [ -d "moonshot-smoke-testing" ]; then
9
+ echo "Removing existing moonshot-smoke-testing directory..."
10
+ rm -rf moonshot-smoke-testing
11
+ fi
12
+
13
+ # Clone the smoke test repo from the specified branch
14
+ echo "Cloning moonshot-smoke-testing repo from branch $BRANCH_NAME..."
15
+ git clone --branch $BRANCH_NAME https://github.com/aiverify-foundation/moonshot-smoke-testing.git
16
+ cd moonshot-smoke-testing
17
+ npm ci
18
+
19
+ # Install Playwright (if needed)
20
+ #sudo npx playwright install-deps
21
+ ### If the above didn't work, try the following:
22
+ ##sudo apt-get install libatk1.0-0\
23
+ ## libatk-bridge2.0-0\
24
+ ## libxkbcommon0\
25
+ ## libatspi2.0-0\
26
+ ## libxcomposite1\
27
+ ## libxdamage1\
28
+ ## libxfixes3\
29
+ ## libxrandr2\
30
+ ## libgbml
31
+
32
+ echo "Running smoke test..."
33
+ npx playwright test tests/main-page.spec.ts --reporter=list
34
+
35
+ #echo "Exit code: $?"
@@ -0,0 +1,7 @@
1
+ !/bin/bash
2
+
3
+ cd ~/moonshot/moonshot
4
+
5
+ source venv/bin/activate
6
+ python -m moonshot web
7
+
@@ -0,0 +1,109 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL (SAST)"
13
+
14
+ on:
15
+ # push:
16
+ # branches: [ "main" ]
17
+ pull_request:
18
+ branches: [ "main" ]
19
+ workflow_dispatch:
20
+ inputs:
21
+ branch_to_test:
22
+ description: 'Branch or tag to run test'
23
+ required: true
24
+ default: 'dev_main'
25
+ 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"
30
+
31
+ jobs:
32
+ analyze:
33
+ name: Analyze (${{ matrix.language }})
34
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
35
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
36
+ # - https://gh.io/supported-runners-and-hardware-resources
37
+ # - https://gh.io/using-larger-runners (GitHub.com only)
38
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
39
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
40
+ timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
41
+ permissions:
42
+ # required for all workflows
43
+ security-events: write
44
+
45
+ # required to fetch internal or private CodeQL packs
46
+ packages: read
47
+
48
+ # only required for workflows in private repositories
49
+ actions: read
50
+ contents: read
51
+
52
+ strategy:
53
+ fail-fast: false
54
+ matrix:
55
+ include:
56
+ - language: python
57
+ build-mode: none
58
+ # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
59
+ # Use `c-cpp` to analyze code written in C, C++ or both
60
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
61
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
62
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
63
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
64
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
65
+ # 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
+ steps:
67
+ - name: Checkout repository
68
+ uses: actions/checkout@v4
69
+
70
+ # Initializes the CodeQL tools for scanning.
71
+ - name: Initialize CodeQL
72
+ uses: github/codeql-action/init@v3
73
+ with:
74
+ languages: ${{ matrix.language }}
75
+ build-mode: ${{ matrix.build-mode }}
76
+ # If you wish to specify custom queries, you can do so here or in a config file.
77
+ # By default, queries listed here will override any specified in a config file.
78
+ # Prefix the list here with "+" to use these queries and those in the config file.
79
+
80
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
81
+ # queries: security-extended,security-and-quality
82
+
83
+ # If the analyze step fails for one of the languages you are analyzing with
84
+ # "We were unable to automatically build your code", modify the matrix above
85
+ # to set the build mode to "manual" for that language. Then modify this step
86
+ # to build your code.
87
+ # ℹ️ Command-line programs to run using the OS shell.
88
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
89
+ - if: matrix.build-mode == 'manual'
90
+ shell: bash
91
+ run: |
92
+ echo 'If you are using a "manual" build mode for one or more of the' \
93
+ 'languages you are analyzing, replace this with the commands to build' \
94
+ 'your code, for example:'
95
+ echo ' make bootstrap'
96
+ echo ' make release'
97
+ exit 1
98
+
99
+ - name: Perform CodeQL Analysis
100
+ id: codeql_analysis
101
+ uses: github/codeql-action/analyze@v3
102
+ with:
103
+ category: "/language:${{matrix.language}}"
104
+
105
+ - name: Capture step statuses
106
+ if: ${{ ! cancelled() }}
107
+ run: |
108
+ echo "CODEQL_ANALYSIS=${{ steps.codeql_analysis.outcome }}" >> $GITHUB_ENV
109
+ echo "CodeQL Analysis Status: $CODEQL_ANALYSIS"
@@ -0,0 +1,162 @@
1
+
2
+ name: Nightly Build
3
+
4
+ on:
5
+
6
+ # Run this workflow manually from Actions tab
7
+ workflow_dispatch:
8
+ inputs:
9
+ branch_to_test:
10
+ description: 'Branch or tag to build'
11
+ required: true
12
+ default: 'dev_main'
13
+ type: string
14
+
15
+ # Allow one concurrent deployment
16
+ concurrency:
17
+ group: ${{ github.repository }}-${{ github.workflow }}
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+
22
+ nightly-build:
23
+
24
+ runs-on: ubuntu-latest
25
+ timeout-minutes: 40
26
+ permissions:
27
+ id-token: write
28
+ contents: read
29
+
30
+ steps:
31
+ - name: Configure AWS credentials
32
+ uses: aws-actions/configure-aws-credentials@v4
33
+ with:
34
+ role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
35
+ aws-region: ap-southeast-1
36
+
37
+ # - name: S3 test
38
+ # run: |
39
+ # aws s3 ls ${{ vars.AWS_S3_PATH }}
40
+ # echo "This job's status is ${{ job.status }}."
41
+
42
+ # Deploy moonshot
43
+
44
+ - name: Backup current install
45
+ run: |
46
+ command_id=$(aws ssm send-command \
47
+ --instance-ids "${{ vars.AWS_SIT_INSTANCE_ID }}" \
48
+ --document-name "AWS-RunShellScript" \
49
+ --comment "Backup current install" \
50
+ --parameters 'commands=["sudo su - ubuntu -c \". ~/scripts/create_backup.sh\""]' \
51
+ --query "Command.CommandId" \
52
+ --output text)
53
+ aws ssm wait command-executed \
54
+ --command-id "$command_id" \
55
+ --instance-id "${{ vars.AWS_SIT_INSTANCE_ID }}"
56
+ status=$(aws ssm list-command-invocations \
57
+ --command-id "$command_id" \
58
+ --details \
59
+ --query "CommandInvocations[0].Status" \
60
+ --output text)
61
+ echo "Command status: $status"
62
+
63
+ - name: Install moonshot
64
+ timeout-minutes: 30
65
+ run: |
66
+ command_id=$(aws ssm send-command \
67
+ --instance-ids "${{ vars.AWS_SIT_INSTANCE_ID }}" \
68
+ --document-name "AWS-RunShellScript" \
69
+ --comment "Install moonshot" \
70
+ --parameters 'commands=["sudo su - ubuntu -c \". ~/scripts/install_ms_service.sh ${{ inputs.branch_to_test }}\""]' \
71
+ --query "Command.CommandId" \
72
+ --output text)
73
+
74
+ max_attempts=20
75
+ delay=60
76
+ attempts=0
77
+ while [ $attempts -lt $max_attempts ]; do
78
+ status=$(aws ssm list-command-invocations \
79
+ --command-id "$command_id" \
80
+ --instance-id "${{ vars.AWS_SIT_INSTANCE_ID }}" \
81
+ --query "CommandInvocations[0].Status" \
82
+ --output text)
83
+ if [ "$status" == "Success" ]; then
84
+ echo "Command status: $status"
85
+ exit 0
86
+ elif [ "$status" == "InProgress" ]; then
87
+ echo "Command status: $status, waiting..."
88
+ sleep $delay
89
+ attempts=$((attempts + 1))
90
+ else
91
+ echo "Command status: $status"
92
+ exit 1
93
+ fi
94
+ done
95
+ echo "Max attempts reached, exiting."
96
+ exit 1
97
+
98
+ - name: Start moonshot web
99
+ run: |
100
+ command_id=$(aws ssm send-command \
101
+ --instance-ids "${{ vars.AWS_SIT_INSTANCE_ID }}" \
102
+ --document-name "AWS-RunShellScript" \
103
+ --comment "Start moonshot web" \
104
+ --parameters 'commands=["sudo systemctl restart moonshot-service"]' \
105
+ --query "Command.CommandId" \
106
+ --output text)
107
+ aws ssm wait command-executed \
108
+ --command-id "$command_id" \
109
+ --instance-id "${{ vars.AWS_SIT_INSTANCE_ID }}"
110
+ status=$(aws ssm list-command-invocations \
111
+ --command-id "$command_id" \
112
+ --details \
113
+ --query "CommandInvocations[0].Status" \
114
+ --output text)
115
+ echo "Command status: $status"
116
+
117
+ - name: Run smoke test
118
+ run: |
119
+ command_id=$(aws ssm send-command \
120
+ --instance-ids "${{ vars.AWS_SIT_INSTANCE_ID }}" \
121
+ --document-name "AWS-RunShellScript" \
122
+ --comment "Run smoke test" \
123
+ --parameters 'commands=["sudo su - ubuntu -c \". ~/scripts/run_smoke_test.sh\""]' \
124
+ --query "Command.CommandId" \
125
+ --output text)
126
+
127
+ max_attempts=20
128
+ delay=60
129
+ attempts=0
130
+
131
+ while [ $attempts -lt $max_attempts ]; do
132
+ status=$(aws ssm list-command-invocations \
133
+ --command-id "$command_id" \
134
+ --instance-id "${{ vars.AWS_SIT_INSTANCE_ID }}" \
135
+ --query "CommandInvocations[0].Status" \
136
+ --output text)
137
+
138
+ if [ "$status" == "Success" ] || [ "$status" == "Failed" ]; then
139
+ output=$(aws ssm get-command-invocation \
140
+ --command-id "$command_id" \
141
+ --instance-id "${{ vars.AWS_SIT_INSTANCE_ID }}" \
142
+ --query "StandardOutputContent" \
143
+ --output text)
144
+ echo "Smoke test output: $output"
145
+ echo "Command status: $status"
146
+ if [ "$status" == "Success" ]; then
147
+ exit 0
148
+ else
149
+ exit 1
150
+ fi
151
+ elif [ "$status" == "InProgress" ]; then
152
+ echo "Command status: $status, waiting..."
153
+ sleep $delay
154
+ attempts=$((attempts + 1))
155
+ else
156
+ echo "Unexpected command status: $status"
157
+ exit 1
158
+ fi
159
+ done
160
+
161
+ echo "Max attempts reached, exiting."
162
+ exit 1
@@ -0,0 +1,155 @@
1
+ # Pre-build Checks (for moonshot)
2
+ # 1. Unit tests with code coverage (pytest)
3
+ # 2. Code quality analysis (flake8)
4
+ # 3. Dependency analysis (vulnerabilities)
5
+ # 4. Dependency analysis (undesirable licenses)
6
+ # 5. Deploy reports generated from the above to GitHub Pages
7
+
8
+ name: Pre-Build Checks
9
+
10
+ on:
11
+ # Runs when a pull request to main is being assigned
12
+ pull_request:
13
+ types: [ assigned, synchronize ]
14
+ branches:
15
+ - 'dev_main'
16
+
17
+ # Run this workflow manually from Actions tab
18
+ workflow_dispatch:
19
+ inputs:
20
+ branch_to_test:
21
+ description: 'Branch or tag to run test'
22
+ required: true
23
+ default: 'dev_main'
24
+ type: string
25
+
26
+ # Allow one concurrent deployment
27
+ concurrency:
28
+ group: ${{ github.repository }}-${{ github.workflow }}
29
+ cancel-in-progress: true
30
+
31
+ jobs:
32
+
33
+ pre-build-checks:
34
+ # Run only when PR is assigned, even on subsequent commits (i.e. synchronize)
35
+ if: (github.event_name == 'pull_request' && github.event.pull_request.assignee != null) || github.event_name == 'workflow_dispatch'
36
+
37
+ runs-on: ubuntu-latest
38
+ timeout-minutes: 40
39
+
40
+ steps:
41
+
42
+ - name: Set branch variable (pull_request)
43
+ if: github.event_name == 'pull_request'
44
+ run: |
45
+ echo "MS_BRANCH=${{ github.event.pull_request.head.ref }}" >> "$GITHUB_ENV"
46
+ echo "MS_DATA_BRANCH=dev_main" >> "$GITHUB_ENV"
47
+ echo "PR_NUM=#${{ github.event.pull_request.number }}" >> "$GITHUB_ENV"
48
+
49
+ - name: Set branch variable (workflow_dispatch)
50
+ if: github.event_name == 'workflow_dispatch'
51
+ run: |
52
+ echo "MS_BRANCH=${{ inputs.branch_to_test }}" >> "$GITHUB_ENV"
53
+ echo "MS_DATA_BRANCH=${{ inputs.branch_to_test }}" >> "$GITHUB_ENV"
54
+ echo "PR_NUM=#0" >> "$GITHUB_ENV"
55
+
56
+ # Checkout moonshot code
57
+ - name: Checkout code (moonshot)
58
+ uses: actions/checkout@v3
59
+ with:
60
+ ref: ${{ env.MS_BRANCH }}
61
+ submodules: recursive
62
+
63
+ - name: Setup python 3.11
64
+ uses: actions/setup-python@v5
65
+ with:
66
+ python-version: "3.11"
67
+
68
+ # Checkout moonshot-data code
69
+ - name: Checkout code (moonshot-data)
70
+ uses: actions/checkout@v3
71
+ with:
72
+ repository: aiverify-foundation/moonshot-data
73
+ ref: ${{ env.MS_DATA_BRANCH }}
74
+ submodules: recursive
75
+ path: moonshot-data
76
+
77
+ # Install dependencies
78
+ - name: Install dependencies
79
+ run: |
80
+ pip install -r requirements.txt
81
+ pip install -r moonshot-data/requirements.txt
82
+ pip install pytest pytest-mock pytest-html pytest-json pytest-cov coverage httpx anybadge
83
+ pip install flake8 flake8-html
84
+
85
+ # Setup .env file
86
+ - name: Setup env file
87
+ run: |
88
+ echo "# For Data
89
+ ATTACK_MODULES=\"./moonshot-data/attack-modules\"
90
+ BOOKMARKS=\"./moonshot-data/generated-outputs/bookmarks\"
91
+ CONNECTORS=\"./moonshot-data/connectors\"
92
+ CONNECTORS_ENDPOINTS=\"./moonshot-data/connectors-endpoints\"
93
+ CONTEXT_STRATEGY=\"./moonshot-data/context-strategy\"
94
+ COOKBOOKS=\"./moonshot-data/cookbooks\"
95
+ DATABASES=\"./moonshot-data/generated-outputs/databases\"
96
+ DATABASES_MODULES=\"./moonshot-data/databases-modules\"
97
+ DATASETS=\"./moonshot-data/datasets\"
98
+ IO_MODULES=\"./moonshot-data/io-modules\"
99
+ METRICS=\"./moonshot-data/metrics\"
100
+ PROMPT_TEMPLATES=\"./moonshot-data/prompt-templates\"
101
+ RECIPES=\"./moonshot-data/recipes\"
102
+ RESULTS=\"./moonshot-data/generated-outputs/results\"
103
+ RESULTS_MODULES=\"./moonshot-data/results-modules\"
104
+ RUNNERS=\"./moonshot-data/generated-outputs/runners\"
105
+ RUNNERS_MODULES=\"./moonshot-data/runners-modules\"
106
+ TOKENIZERS_PARALLELISM=false
107
+
108
+ # For Web API
109
+ HOST_ADDRESS=127.0.0.1
110
+ HOST_PORT=5000" > .env
111
+ cat .env
112
+
113
+ # Unit tests & coverage
114
+ - name: Unit tests with coverage
115
+ id: unit_tests
116
+ if: ${{ ! cancelled() }}
117
+ timeout-minutes: 30
118
+ run: |
119
+ bash ci/run-test.sh
120
+
121
+ # Code quality analysis (flake8)
122
+ - name: Code quality analysis (flake8)
123
+ id: code_quality
124
+ if: ${{ ! cancelled() }}
125
+ run: |
126
+ bash ci/run-flake8.sh
127
+
128
+ # pip-audit
129
+ - name: Dependency analysis (vulnerabilities & licenses)
130
+ id: dependency_analysis
131
+ if: ${{ ! cancelled() }}
132
+ run: |
133
+ 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
141
+
142
+ # Send slack notification
143
+ - name: Send slack notification
144
+ if: ${{ ! cancelled() }}
145
+ uses: slackapi/slack-github-action@v1.26.0
146
+ with:
147
+ payload: |
148
+ {
149
+ "workflow": "${{ github.repository }} - ${{ github.workflow }} - ${{ env.PR_NUM }}",
150
+ "status": "${{ job.status }}",
151
+ "details": "Unit Tests: ${{ env.UNIT_TESTS_STATUS }}, Code Quality: ${{ env.CODE_QUALITY_STATUS }}, Dependency Analysis: ${{ env.DEPENDENCY_ANALYSIS_STATUS }}",
152
+ "ref": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
153
+ }
154
+ env:
155
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
@@ -0,0 +1,102 @@
1
+ # PyPi
2
+ name: PyPi Deployment
3
+
4
+ on:
5
+
6
+ # Run this workflow manually from Actions tab
7
+ workflow_dispatch:
8
+
9
+ # Allow one concurrent deployment
10
+ concurrency:
11
+ group: ${{ github.repository }}-${{ github.workflow }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ build:
16
+ name: Build distribution 📦
17
+ runs-on: ubuntu-latest
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.x"
25
+ - name: Install pypa/build
26
+ run: >-
27
+ python3 -m
28
+ pip install
29
+ build
30
+ --user
31
+ - name: Build a binary wheel and a source tarball
32
+ run: python3 -m build
33
+ - name: Store the distribution packages
34
+ uses: actions/upload-artifact@v3
35
+ with:
36
+ name: python-package-distributions
37
+ path: dist/
38
+
39
+ publish-to-pypi:
40
+ name: >-
41
+ Publish Python 🐍 distribution 📦 to PyPI
42
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
43
+ needs:
44
+ - build
45
+ runs-on: ubuntu-latest
46
+ environment:
47
+ name: pypi
48
+ url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
49
+ permissions:
50
+ id-token: write # IMPORTANT: mandatory for trusted publishing
51
+
52
+ steps:
53
+ - name: Download all the dists
54
+ uses: actions/download-artifact@v3
55
+ with:
56
+ name: python-package-distributions
57
+ path: dist/
58
+ - name: Publish distribution 📦 to PyPI
59
+ uses: pypa/gh-action-pypi-publish@release/v1
60
+
61
+ github-release:
62
+ name: >-
63
+ Sign the Python 🐍 distribution 📦 with Sigstore
64
+ and upload them to GitHub Release
65
+ needs:
66
+ - publish-to-pypi
67
+ runs-on: ubuntu-latest
68
+
69
+ permissions:
70
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
71
+ id-token: write # IMPORTANT: mandatory for sigstore
72
+
73
+ steps:
74
+ - name: Download all the dists
75
+ uses: actions/download-artifact@v3
76
+ with:
77
+ name: python-package-distributions
78
+ path: dist/
79
+ - name: Sign the dists with Sigstore
80
+ uses: sigstore/gh-action-sigstore-python@v2.1.1
81
+ with:
82
+ inputs: >-
83
+ ./dist/*.tar.gz
84
+ ./dist/*.whl
85
+ - name: Create GitHub Release
86
+ env:
87
+ GITHUB_TOKEN: ${{ github.token }}
88
+ run: >-
89
+ gh release create
90
+ '${{ github.ref_name }}'
91
+ --repo '${{ github.repository }}'
92
+ --notes ""
93
+ - name: Upload artifact signatures to GitHub Release
94
+ env:
95
+ GITHUB_TOKEN: ${{ github.token }}
96
+ # Upload to GitHub Release using the `gh` CLI.
97
+ # `dist/` contains the built packages, and the
98
+ # sigstore-produced signatures and certificates.
99
+ run: >-
100
+ gh release upload
101
+ '${{ github.ref_name }}' dist/**
102
+ --repo '${{ github.repository }}'
@@ -52,7 +52,7 @@ jobs:
52
52
  if: github.event_name == 'workflow_dispatch'
53
53
  uses: actions/checkout@v4
54
54
  with:
55
- repository: aiverify-foundation/moonshot-data
55
+ repository: aiverify-foundation/moonshot
56
56
  ref: ${{ inputs.moonshot_branch }}
57
57
 
58
58
  - name: Setup Python 3.11
@@ -65,6 +65,8 @@ jobs:
65
65
  python -m venv venv
66
66
  source venv/bin/activate
67
67
  pip install -r requirements.txt
68
+ touch .env
69
+ echo "${{ vars.ENVIRONMENT_VARS }}" >> .env
68
70
 
69
71
  - name: Checkout Moonshot Data (Pull Request)
70
72
  if: github.event_name == 'pull_request'
@@ -120,8 +122,12 @@ jobs:
120
122
  path: moonshot-smoke-testing
121
123
 
122
124
  - name: Run Smoke Test
125
+ env:
126
+ URI: ${{ secrets.URI }}
127
+ TOKEN: ${{ secrets.TOKEN }}
128
+ ADDITIONAL_PARAMETERS: ${{ vars.ADDITIONAL_PARAMETERS }}
123
129
  run: |
124
130
  cd moonshot-smoke-testing
125
131
  npm ci
126
132
  npx playwright install --with-deps
127
- npx playwright test tests/main-page.spec.ts
133
+ URI="$URI" TOKEN="$TOKEN" ADDITIONAL_PARAMETERS="$ADDITIONAL_PARAMETERS" npx playwright test tests/smoke-test.spec.ts