RepoAuditor 0.2.83__tar.gz → 0.3.0__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 (203) hide show
  1. {repoauditor-0.2.83 → repoauditor-0.3.0}/PKG-INFO +1 -1
  2. repoauditor-0.3.0/docs/config_file.md +52 -0
  3. {repoauditor-0.2.83 → repoauditor-0.3.0}/mkdocs.yml +5 -0
  4. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/LicenseFile.py +1 -1
  5. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/Protected.py +1 -1
  6. repoauditor-0.3.0/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +34 -0
  7. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRequirementImpl.py +1 -1
  8. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Impl/ValueRequirementImpl.py +1 -1
  9. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Private.py +1 -1
  10. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/__init__.py +1 -1
  11. repoauditor-0.2.83/tests/Plugins/CommunityStandards/GitHubCommunityStandards_UnitTest.py → repoauditor-0.3.0/tests/Plugins/CommunityStandards/CommunityStandards_UnitTest.py +1 -1
  12. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/CommunityStandards_EndToEndTest.py +1 -1
  13. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals_UnitTest.py +0 -13
  14. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/EnsureStatusChecks_UnitTest.py +0 -13
  15. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush_UnitTest.py +0 -13
  16. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovals_UnitTest.py +0 -13
  17. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireCodeOwnerReview_UnitTest.py +0 -13
  18. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireUpToDateBranches_UnitTest.py +0 -14
  19. {repoauditor-0.2.83/tests/Plugins/GitHubModule/DefaultBranchQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/DefaultBranchRequirements}/Protected_UnitTest.py +0 -10
  20. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/AllowMainlineForcePushesRule_UnitTest.py +53 -0
  21. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/DismissStalePullRequestApprovalsRule_UnitTest.py +73 -0
  22. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/EnsureStatusChecksRule_UnitTest.py +73 -0
  23. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireApprovalMostRecentPushRule_UnitTest.py +73 -0
  24. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireApprovalsRule_UnitTest.py +71 -0
  25. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireCodeOwnerReviewRule_UnitTest.py +73 -0
  26. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireConversationResolutionRule_UnitTest.py +73 -0
  27. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequirePullRequests_UnitTest.py +71 -0
  28. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireSignedCommits_UnitTest.py +71 -0
  29. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireStatusChecksToPassRule_UnitTest.py +58 -0
  30. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireUpToDateBranchesRule_UnitTest.py +73 -0
  31. repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/__init__.py +23 -0
  32. {repoauditor-0.2.83/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/DependabotSecurityUpdates_UnitTest.py +0 -14
  33. {repoauditor-0.2.83/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/Description_UnitTest.py +0 -10
  34. {repoauditor-0.2.83/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/License_UnitTest.py +0 -12
  35. {repoauditor-0.2.83/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/MergeCommitMessage_UnitTest.py +0 -11
  36. {repoauditor-0.2.83/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/Private_UnitTest.py +0 -10
  37. {repoauditor-0.2.83/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/SecretScanningPushProtection_UnitTest.py +0 -14
  38. {repoauditor-0.2.83/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/SecretScanning_UnitTest.py +0 -14
  39. {repoauditor-0.2.83/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/SquashMergeCommitMessage_UnitTest.py +0 -11
  40. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ValueRequrementImpl_UnitTest.py +1 -1
  41. repoauditor-0.3.0/tests/Plugins/GitHubModule/fixtures.py +78 -0
  42. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr +22 -22
  43. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/conftest.py +2 -2
  44. repoauditor-0.2.83/docs/config_file.md +0 -10
  45. repoauditor-0.2.83/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +0 -18
  46. repoauditor-0.2.83/tests/Plugins/GitHubModule/RulesetRequirements_UnitTest.py +0 -688
  47. repoauditor-0.2.83/tests/Plugins/GitHubModule/fixtures.py +0 -28
  48. {repoauditor-0.2.83 → repoauditor-0.3.0}/.copier-answers.yml +0 -0
  49. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/CODEOWNERS +0 -0
  50. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  51. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  52. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/ISSUE_TEMPLATE/custom.md +0 -0
  53. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  54. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/actions/release_impl/action.yml +0 -0
  55. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/pull_request_template.md +0 -0
  56. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/release_sources.yaml +0 -0
  57. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/workflows/CICD.yml +0 -0
  58. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/workflows/CICD_impl.yml +0 -0
  59. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/workflows/EndToEnd.yml +0 -0
  60. {repoauditor-0.2.83 → repoauditor-0.3.0}/.github/workflows/codeql.yml +0 -0
  61. {repoauditor-0.2.83 → repoauditor-0.3.0}/.gitignore +0 -0
  62. {repoauditor-0.2.83 → repoauditor-0.3.0}/.pre-commit-config.yaml +0 -0
  63. {repoauditor-0.2.83 → repoauditor-0.3.0}/.python-version +0 -0
  64. {repoauditor-0.2.83 → repoauditor-0.3.0}/CODE_OF_CONDUCT.md +0 -0
  65. {repoauditor-0.2.83 → repoauditor-0.3.0}/GOVERNANCE.md +0 -0
  66. {repoauditor-0.2.83 → repoauditor-0.3.0}/LICENSE +0 -0
  67. {repoauditor-0.2.83 → repoauditor-0.3.0}/MAINTAINERS.md +0 -0
  68. {repoauditor-0.2.83 → repoauditor-0.3.0}/README.md +0 -0
  69. {repoauditor-0.2.83 → repoauditor-0.3.0}/SECURITY.md +0 -0
  70. {repoauditor-0.2.83 → repoauditor-0.3.0}/default_config.yaml +0 -0
  71. {repoauditor-0.2.83 → repoauditor-0.3.0}/docs/CONTRIBUTING.md +0 -0
  72. {repoauditor-0.2.83 → repoauditor-0.3.0}/docs/DEVELOPMENT.md +0 -0
  73. {repoauditor-0.2.83 → repoauditor-0.3.0}/docs/PAT.md +0 -0
  74. {repoauditor-0.2.83 → repoauditor-0.3.0}/docs/index.md +0 -0
  75. {repoauditor-0.2.83 → repoauditor-0.3.0}/docs/troubleshooting.md +0 -0
  76. {repoauditor-0.2.83 → repoauditor-0.3.0}/docs/usage.md +0 -0
  77. {repoauditor-0.2.83 → repoauditor-0.3.0}/minisign_key.pub +0 -0
  78. {repoauditor-0.2.83 → repoauditor-0.3.0}/pyproject.toml +0 -0
  79. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/AutoGitSemVer.yaml +0 -0
  80. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/CommandLineProcessor.py +0 -0
  81. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Display.py +0 -0
  82. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/EntryPoint.py +0 -0
  83. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/ExecuteModules.py +0 -0
  84. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py +0 -0
  85. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Impl/__init__.py +0 -0
  86. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Module.py +0 -0
  87. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugin.py +0 -0
  88. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/CommunityStandardsQuery.py +0 -0
  89. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Impl/ExistsRequirementImpl.py +0 -0
  90. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Impl/__init__.py +0 -0
  91. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Module.py +0 -0
  92. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOfConduct.py +0 -0
  93. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOwners.py +0 -0
  94. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/Contributing.py +0 -0
  95. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/IssueTemplates.py +0 -0
  96. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/PullRequestTemplates.py +0 -0
  97. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/ReadMe.py +0 -0
  98. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/SecurityPolicy.py +0 -0
  99. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/__init__.py +0 -0
  100. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/__init__.py +0 -0
  101. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandardsPlugin.py +0 -0
  102. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionQuery.py +0 -0
  103. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowDeletions.py +0 -0
  104. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowMainlineForcePushes.py +0 -0
  105. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals.py +0 -0
  106. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DoNotAllowBypassSettings.py +0 -0
  107. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/EnsureStatusChecks.py +0 -0
  108. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicEnableRequirementImpl.py +0 -0
  109. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicValueRequirementImpl.py +0 -0
  110. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/__init__.py +0 -0
  111. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush.py +0 -0
  112. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovals.py +0 -0
  113. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireCodeOwnerReview.py +0 -0
  114. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireConversationResolution.py +0 -0
  115. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireLinearHistory.py +0 -0
  116. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequirePullRequests.py +0 -0
  117. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireSignedCommits.py +0 -0
  118. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireStatusChecksToPass.py +0 -0
  119. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireUpToDateBranches.py +0 -0
  120. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/__init__.py +0 -0
  121. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQuery.py +0 -0
  122. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/__init__.py +0 -0
  123. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRulesetRequirementImpl.py +0 -0
  124. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Impl/__init__.py +0 -0
  125. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Module.py +0 -0
  126. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetQuery.py +0 -0
  127. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/AllowMainlineForcePushes.py +0 -0
  128. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/DismissStalePullRequestApprovals.py +0 -0
  129. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/EnsureStatusChecks.py +0 -0
  130. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireApprovalMostRecentPush.py +0 -0
  131. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireApprovals.py +0 -0
  132. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireCodeOwnerReview.py +0 -0
  133. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireCodeScanningResults.py +0 -0
  134. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireConversationResolution.py +0 -0
  135. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireLinearHistory.py +0 -0
  136. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequirePullRequests.py +0 -0
  137. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireSignedCommits.py +0 -0
  138. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireStatusChecksToPass.py +0 -0
  139. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireSuccessfulDeployments.py +0 -0
  140. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireUpToDateBranches.py +0 -0
  141. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RestrictCreations.py +0 -0
  142. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RestrictDeletions.py +0 -0
  143. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RestrictUpdates.py +0 -0
  144. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/__init__.py +0 -0
  145. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +0 -0
  146. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/AutoMerge.py +0 -0
  147. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DefaultBranch.py +0 -0
  148. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DeleteHeadBranches.py +0 -0
  149. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DependabotSecurityUpdates.py +0 -0
  150. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Description.py +0 -0
  151. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardEnableRequirementImpl.py +0 -0
  152. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardValueRequirementImpl.py +0 -0
  153. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/__init__.py +0 -0
  154. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/License.py +0 -0
  155. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommit.py +0 -0
  156. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommitMessage.py +0 -0
  157. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/RebaseMergeCommit.py +0 -0
  158. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanning.py +0 -0
  159. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanningPushProtection.py +0 -0
  160. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashCommitMerge.py +0 -0
  161. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashMergeCommitMessage.py +0 -0
  162. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SuggestUpdatingPullRequestBranches.py +0 -0
  163. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportDiscussions.py +0 -0
  164. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportIssues.py +0 -0
  165. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportProjects.py +0 -0
  166. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportWikis.py +0 -0
  167. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/TemplateRepository.py +0 -0
  168. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/WebCommitSignoff.py +0 -0
  169. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/__init__.py +0 -0
  170. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/__init__.py +0 -0
  171. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHubBase/Module.py +0 -0
  172. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHubBase/__init__.py +0 -0
  173. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHubPlugin.py +0 -0
  174. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/__init__.py +0 -0
  175. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Query.py +0 -0
  176. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/Requirement.py +0 -0
  177. {repoauditor-0.2.83 → repoauditor-0.3.0}/src/RepoAuditor/py.typed +0 -0
  178. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/CommandLineProcessor_UnitTest.py +0 -0
  179. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/EntryPoint_UnitTest.py +0 -0
  180. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/ExecuteModules_UnitTest.py +0 -0
  181. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Module_UnitTest.py +0 -0
  182. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugin_UnitTest.py +0 -0
  183. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/CommunityStandards/CommunityStandardsQuery_UnitTest.py +0 -0
  184. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/CommunityStandards/ExistsRequirementImpl_UnitTest.py +0 -0
  185. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubEnterprise_EndToEndTest.py +0 -0
  186. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionQuery_UnitTest.py +0 -0
  187. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicValueRequirementImpl_UnitTest.py +0 -0
  188. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/DefaultBranchQuery_UnitTest.py +0 -0
  189. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/EnableRulesetRequirementImpl_UnitTest.py +0 -0
  190. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/GitHubModule_UnitTest.py +0 -0
  191. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/GitHubSession_UnitTest.py +0 -0
  192. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/RulsesetQuery_UnitTest.py +0 -0
  193. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/StandardQuery_UnitTest.py +0 -0
  194. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/GitHub_EndToEndTest.py +0 -0
  195. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/__snapshots__/CommunityStandards_EndToEndTest.ambr +0 -0
  196. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/__snapshots__/GitHubEnterprise_EndToEndTest.ambr +0 -0
  197. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Plugins/utilities.py +0 -0
  198. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Query_UnitTest.py +0 -0
  199. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/Requirement_UnitTest.py +0 -0
  200. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/__init__.py +0 -0
  201. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/__snapshots__/ExecuteModules_UnitTest.ambr +0 -0
  202. {repoauditor-0.2.83 → repoauditor-0.3.0}/tests/conftest.py +0 -0
  203. {repoauditor-0.2.83 → repoauditor-0.3.0}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RepoAuditor
3
- Version: 0.2.83
3
+ Version: 0.3.0
4
4
  Summary: Add your description here
5
5
  Project-URL: Homepage, https://github.com/gt-sse-center/RepoAuditor
6
6
  Project-URL: Documentation, https://github.com/gt-sse-center/RepoAuditor
@@ -0,0 +1,52 @@
1
+ # Configuration File
2
+
3
+ `RepoAuditor` accepts both a set of flags as well as a configuration YAML file.
4
+
5
+ The configuration (or config) file can make usage easier by recording preferences as well as facilitating sharing of enforced requirements within an organization.
6
+ We have provided a sample configuration file called [default_config.yaml](https://github.com/gt-sse-center/RepoAuditor/blob/main/default_config.yaml), which can be used as:
7
+
8
+ ```sh
9
+ uvx RepoAuditor --config default_config.yaml
10
+ ```
11
+
12
+ ## Key Differences
13
+
14
+ There are some differences between the flags used in the CLI and the options provided in the config file.
15
+
16
+ ### Multiple Values
17
+
18
+ For example, to include multiple module on the CLI, the user would use the `--include` multiple times.
19
+
20
+ ```sh
21
+ uvx RepoAuditor --include CommunityStandards --include GitHub
22
+ ```
23
+
24
+ However, since the config file accepts a list of values, the corresponding option is `includes` (which is plural).
25
+
26
+ ```yaml
27
+ includes: ["GitHub", "CommunityStandards"]
28
+ ```
29
+
30
+ This is similarly the case for `--exclude` on the CLI and `excludes` in the config file.
31
+
32
+ ### Boolean Flags
33
+
34
+ On the CLI, the existence of a boolean flag, e.g. `--GitHub-Description-allow-empty` is sufficient to indicate that we want this setting to be enabled.
35
+
36
+ However since YAML files expect key-value pairs, in the config file, you will have to specify the same flag as:
37
+
38
+ ```yaml
39
+ GitHub-Description-allow-empty: true
40
+ ```
41
+
42
+ Similarly for the case where we wish to check a setting is turned off, we specify e.g. `--GitHub-no-MergeCommit` on the CLI, but in the config file, it would be
43
+
44
+ ```yaml
45
+ GitHub-no-MergeCommit: true
46
+ ```
47
+
48
+ Remember, to deactive a check, we have to add the `Module-Requirement` to the `excludes` list,
49
+
50
+ ```yaml
51
+ excludes: ["GitHub-MergeCommit"]
52
+ ```
@@ -10,6 +10,11 @@ nav:
10
10
  - Troubleshooting: troubleshooting.md
11
11
  theme:
12
12
  name: material
13
+ palette:
14
+ scheme: slate
15
+ primary: teal
16
+ accent: lime
17
+
13
18
 
14
19
  # Extensions to render emojis
15
20
  markdown_extensions:
@@ -14,7 +14,7 @@ from RepoAuditor.Plugins.CommunityStandards.Impl.ExistsRequirementImpl import (
14
14
 
15
15
 
16
16
  class LicenseFile(ExistsRequirementImpl):
17
- """Validates that a CODE_OF_CONDUCT file is configured."""
17
+ """Validates that a file with licensing information is present."""
18
18
 
19
19
  def __init__(self) -> None:
20
20
  super().__init__(
@@ -76,7 +76,7 @@ class Protected(Requirement):
76
76
  ) -> Requirement.EvaluateImplResult:
77
77
  is_protected = query_data["default_branch_data"].get("protected", None)
78
78
  if is_protected is None:
79
- return CreateIncompleteDataResult()
79
+ return CreateIncompleteDataResult(query_data["pat"] is not None)
80
80
 
81
81
  if requirement_args["no"]:
82
82
  expected_value = False
@@ -0,0 +1,34 @@
1
+ # -------------------------------------------------------------------------------
2
+ # |
3
+ # | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
4
+ # | Distributed under the MIT License.
5
+ # |
6
+ # -------------------------------------------------------------------------------
7
+ """Contains common functionality that is used across different components."""
8
+
9
+ from RepoAuditor.Requirement import EvaluateResult, Requirement
10
+
11
+
12
+ # ----------------------------------------------------------------------
13
+ def CreateIncompleteDataResult(pat_value_exists: bool) -> Requirement.EvaluateImplResult: # noqa: FBT001
14
+ """Create an incomplete data result.
15
+
16
+ Checks if the PAT value is `None` to generate additional message info.
17
+
18
+ Args:
19
+ pat_value_exists (bool): The value of the Personal Access Token.
20
+
21
+ Returns:
22
+ Requirement.EvaluateImplResult: A warning result notifying the user of an incomplete result.
23
+
24
+ """
25
+ error_message = "Incomplete data was encountered."
26
+ if pat_value_exists:
27
+ error_message += "\nPlease update the permissions of the GitHub PAT."
28
+ else:
29
+ error_message += "\nGitHub PAT was not provided. Please provide the PAT."
30
+
31
+ return Requirement.EvaluateImplResult(
32
+ EvaluateResult.Warning,
33
+ error_message,
34
+ )
@@ -103,7 +103,7 @@ class EnableRequirementImpl(Requirement):
103
103
  )
104
104
 
105
105
  if self.missing_value_is_warning:
106
- return CreateIncompleteDataResult()
106
+ return CreateIncompleteDataResult(query_data["pat"] is not None)
107
107
 
108
108
  return Requirement.EvaluateImplResult(EvaluateResult.DoesNotApply, None)
109
109
 
@@ -90,7 +90,7 @@ class ValueRequirementImpl(Requirement):
90
90
  result = self.get_configuration_value_func(query_data)
91
91
  if result is None:
92
92
  if self.missing_value_is_warning:
93
- return CreateIncompleteDataResult()
93
+ return CreateIncompleteDataResult(query_data["pat"] is not None)
94
94
 
95
95
  return Requirement.EvaluateImplResult(EvaluateResult.DoesNotApply, None)
96
96
 
@@ -77,7 +77,7 @@ class Private(Requirement):
77
77
  result = query_data["standard"].get("private", None)
78
78
 
79
79
  if result is None:
80
- return CreateIncompleteDataResult()
80
+ return CreateIncompleteDataResult(query_data["pat"] is not None)
81
81
 
82
82
  if result != expect_private:
83
83
  return Requirement.EvaluateImplResult(
@@ -2,4 +2,4 @@ APP_NAME = "RepoAuditor"
2
2
 
3
3
  # Note that the default value below will be used until the value
4
4
  # here is explicitly updated by the Continuous Integration system.
5
- __version__ = "0.2.83"
5
+ __version__ = "0.3.0"
@@ -4,7 +4,7 @@
4
4
  # | Distributed under the MIT License.
5
5
  # |
6
6
  # -------------------------------------------------------------------------------
7
- """Unit tests for the GitHub Community Standards Plugin"""
7
+ """Unit tests for the Community Standards Plugin"""
8
8
 
9
9
  import sys
10
10
  from pathlib import Path
@@ -165,7 +165,7 @@ class TestCommunityStandards:
165
165
  @patch.object(
166
166
  CommunityStandardsQuery,
167
167
  "GetData",
168
- GetDataFunctional("CONTRIBUTING.md"),
168
+ GetDataFunctional("docs/CONTRIBUTING.md"),
169
169
  )
170
170
  def test_NoContributing(self, pat_args, snapshot):
171
171
  """Test if a CONTRIBUTING file does not exist in the repository."""
@@ -14,19 +14,6 @@ from RepoAuditor.Plugins.GitHub.ClassicBranchProtectionRequirements.DismissStale
14
14
  from RepoAuditor.Requirement import EvaluateResult
15
15
 
16
16
 
17
- @pytest.fixture(name="query_data")
18
- def query_data_fixture(session):
19
- return {
20
- "session": session,
21
- "branch": "main",
22
- "branch_protection_data": {
23
- "required_pull_request_reviews": {
24
- "dismiss_stale_reviews": True,
25
- },
26
- },
27
- }
28
-
29
-
30
17
  @pytest.fixture(name="requirement")
31
18
  def requirement_fixture():
32
19
  return DismissStalePullRequestApprovals()
@@ -14,19 +14,6 @@ from RepoAuditor.Plugins.GitHub.ClassicBranchProtectionRequirements.EnsureStatus
14
14
  from RepoAuditor.Requirement import EvaluateResult
15
15
 
16
16
 
17
- @pytest.fixture(name="query_data")
18
- def query_data_fixture(session):
19
- return {
20
- "session": session,
21
- "branch": "main",
22
- "branch_protection_data": {
23
- "required_status_checks": {
24
- "checks": ["check1", "check2"],
25
- },
26
- },
27
- }
28
-
29
-
30
17
  @pytest.fixture(name="requirement")
31
18
  def requirement_fixture():
32
19
  return EnsureStatusChecks()
@@ -14,19 +14,6 @@ from RepoAuditor.Plugins.GitHub.ClassicBranchProtectionRequirements.RequireAppro
14
14
  from RepoAuditor.Requirement import EvaluateResult
15
15
 
16
16
 
17
- @pytest.fixture(name="query_data")
18
- def query_data_fixture(session):
19
- return {
20
- "session": session,
21
- "branch": "main",
22
- "branch_protection_data": {
23
- "required_pull_request_reviews": {
24
- "require_last_push_approval": True,
25
- },
26
- },
27
- }
28
-
29
-
30
17
  @pytest.fixture(name="requirement")
31
18
  def requirement_fixture():
32
19
  return RequireApprovalMostRecentPush()
@@ -12,19 +12,6 @@ from RepoAuditor.Plugins.GitHub.ClassicBranchProtectionRequirements.RequireAppro
12
12
  from RepoAuditor.Requirement import EvaluateResult
13
13
 
14
14
 
15
- @pytest.fixture(name="query_data")
16
- def query_data_fixture(session):
17
- return {
18
- "session": session,
19
- "branch": "main",
20
- "branch_protection_data": {
21
- "required_pull_request_reviews": {
22
- "required_approving_review_count": "1",
23
- },
24
- },
25
- }
26
-
27
-
28
15
  @pytest.fixture(name="requirement")
29
16
  def requirement_fixture():
30
17
  return RequireApprovals()
@@ -14,19 +14,6 @@ from RepoAuditor.Plugins.GitHub.ClassicBranchProtectionRequirements.RequireCodeO
14
14
  from RepoAuditor.Requirement import EvaluateResult
15
15
 
16
16
 
17
- @pytest.fixture(name="query_data")
18
- def query_data_fixture(session):
19
- return {
20
- "session": session,
21
- "branch": "main",
22
- "branch_protection_data": {
23
- "required_pull_request_reviews": {
24
- "require_code_owner_reviews": False,
25
- },
26
- },
27
- }
28
-
29
-
30
17
  @pytest.fixture(name="requirement")
31
18
  def requirement_fixture():
32
19
  return RequireCodeOwnerReview()
@@ -14,20 +14,6 @@ from RepoAuditor.Plugins.GitHub.ClassicBranchProtectionRequirements.RequireUpToD
14
14
  from RepoAuditor.Requirement import EvaluateResult
15
15
 
16
16
 
17
- @pytest.fixture(name="query_data")
18
- def query_data_fixture(session):
19
- """Sample query data fixture."""
20
- return {
21
- "session": session,
22
- "branch": "main",
23
- "branch_protection_data": {
24
- "required_status_checks": {
25
- "strict": False,
26
- },
27
- },
28
- }
29
-
30
-
31
17
  @pytest.fixture(name="requirement")
32
18
  def requirement_fixture():
33
19
  """RequireUpToDateBranches requirement fixture."""
@@ -12,16 +12,6 @@ from RepoAuditor.Plugins.GitHub.DefaultBranchRequirements.Protected import Prote
12
12
  from RepoAuditor.Requirement import EvaluateResult
13
13
 
14
14
 
15
- @pytest.fixture(name="query_data")
16
- def query_data_fixture(session):
17
- return {
18
- "session": session,
19
- "default_branch_data": {
20
- "protected": True,
21
- },
22
- }
23
-
24
-
25
15
  @pytest.fixture(name="requirement")
26
16
  def requirement_fixture():
27
17
  return Protected()
@@ -0,0 +1,53 @@
1
+ # -------------------------------------------------------------------------------
2
+ # |
3
+ # | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
4
+ # | Distributed under the MIT License.
5
+ # |
6
+ # -------------------------------------------------------------------------------
7
+ """Unit tests for AllowMainlineForcePushesRule.py"""
8
+
9
+ from RepoAuditor.Plugins.GitHub.RulesetRequirements.AllowMainlineForcePushes import (
10
+ AllowMainlineForcePushesRule,
11
+ )
12
+ from RepoAuditor.Requirement import EvaluateResult
13
+
14
+ from . import create_rule
15
+
16
+
17
+ class TestAllowMainlineForcePushesRule:
18
+ """Unit tests for the AllowMainlineForcePushesRule requirement."""
19
+
20
+ def test_Enabled(self, query_data):
21
+ """Test if the rule is enabled on the main branch."""
22
+ requirement = AllowMainlineForcePushesRule()
23
+
24
+ query_data["rules"].append(
25
+ create_rule(
26
+ name="main",
27
+ rule_type="non_fast_forward",
28
+ ruleset_name="main",
29
+ parameters={},
30
+ )
31
+ )
32
+
33
+ result = requirement.Evaluate(query_data, {"yes": True})
34
+ assert result.result == EvaluateResult.Success
35
+ assert f"{requirement.github_settings_value} is enabled" in result.context
36
+
37
+ def test_Disabled(self, query_data):
38
+ """Test if the rule is disabled by not providing the appropriate rule within the ruleset."""
39
+ requirement = AllowMainlineForcePushesRule()
40
+
41
+ query_data["rules"].append(
42
+ create_rule(
43
+ name="Random Rule",
44
+ # Wrong rule type
45
+ rule_type="push_request",
46
+ ruleset_name="main",
47
+ parameters={},
48
+ )
49
+ )
50
+
51
+ result = requirement.Evaluate(query_data, {"yes": True})
52
+ assert result.result == EvaluateResult.Error
53
+ assert f"No active branch ruleset with {requirement.github_settings_value} found" in result.context
@@ -0,0 +1,73 @@
1
+ # -------------------------------------------------------------------------------
2
+ # |
3
+ # | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
4
+ # | Distributed under the MIT License.
5
+ # |
6
+ # -------------------------------------------------------------------------------
7
+ """Unit tests for DismissStalePullRequestApprovalsRule.py"""
8
+
9
+ from RepoAuditor.Plugins.GitHub.RulesetRequirements.DismissStalePullRequestApprovals import (
10
+ DismissStalePullRequestApprovalsRule,
11
+ )
12
+ from RepoAuditor.Requirement import EvaluateResult
13
+
14
+ from . import create_rule
15
+
16
+
17
+ class TestDismissStalePullRequestApprovalsRule:
18
+ """Unit tests for the DismissStalePullRequestApprovalsRule requirement."""
19
+
20
+ def test_Enabled(self, query_data):
21
+ """Test if the rule is enabled on the main branch."""
22
+ requirement = DismissStalePullRequestApprovalsRule()
23
+
24
+ query_data["rules"].append(
25
+ create_rule(
26
+ name="PR Rules",
27
+ rule_type="pull_request",
28
+ ruleset_name="main",
29
+ parameters={"dismiss_stale_reviews_on_push": True},
30
+ )
31
+ )
32
+
33
+ result = requirement.Evaluate(query_data, {"no": False})
34
+ assert result.result == EvaluateResult.Success
35
+ assert f"{requirement.github_settings_value} is enabled" in result.context
36
+
37
+ def test_Disabled(self, query_data):
38
+ """Test if the required rule is disabled on the main branch
39
+ by providing the value as false.
40
+ """
41
+ requirement = DismissStalePullRequestApprovalsRule()
42
+
43
+ query_data["rules"].append(
44
+ create_rule(
45
+ name="PR Rules",
46
+ # Wrong rule type
47
+ rule_type="pull_request",
48
+ ruleset_name="main",
49
+ parameters={"dismiss_stale_reviews_on_push": False},
50
+ )
51
+ )
52
+
53
+ result = requirement.Evaluate(query_data, {"no": False})
54
+ assert result.result == EvaluateResult.Error
55
+
56
+ def test_WrongRuleType(self, query_data):
57
+ """Test if the required rule is disabled on the main branch
58
+ by providing the wrong rule type.
59
+ """
60
+ requirement = DismissStalePullRequestApprovalsRule()
61
+
62
+ query_data["rules"].append(
63
+ create_rule(
64
+ name="Inactive PR Rules",
65
+ # Wrong rule type
66
+ rule_type="push_request",
67
+ ruleset_name="Ruleset Main",
68
+ parameters={},
69
+ )
70
+ )
71
+
72
+ result = requirement.Evaluate(query_data, {"no": False})
73
+ assert result.result == EvaluateResult.Error
@@ -0,0 +1,73 @@
1
+ # -------------------------------------------------------------------------------
2
+ # |
3
+ # | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
4
+ # | Distributed under the MIT License.
5
+ # |
6
+ # -------------------------------------------------------------------------------
7
+ """Unit tests for EnsureStatusChecksRule.py"""
8
+
9
+ from RepoAuditor.Plugins.GitHub.RulesetRequirements.EnsureStatusChecks import EnsureStatusChecksRule
10
+ from RepoAuditor.Requirement import EvaluateResult
11
+
12
+ from . import create_rule
13
+
14
+
15
+ class TestEnsureStatusChecksRule:
16
+ """Unit tests for the EnsureStatusChecksRule requirement."""
17
+
18
+ def test_Enabled(self, query_data):
19
+ """Test if the rule is enabled on the main branch."""
20
+ requirement = EnsureStatusChecksRule()
21
+
22
+ query_data["rules"].append(
23
+ create_rule(
24
+ name="main",
25
+ rule_type="required_status_checks",
26
+ ruleset_name="main",
27
+ parameters={
28
+ "required_status_checks": [
29
+ "CI+CD",
30
+ "Additional Check",
31
+ ]
32
+ },
33
+ )
34
+ )
35
+
36
+ result = requirement.Evaluate(query_data, {"no": False})
37
+ assert result.result == EvaluateResult.Success
38
+ assert f"{requirement.github_settings_value} is enabled" in result.context
39
+
40
+ def test_NoStatusChecks(self, query_data):
41
+ """Test if the rule is enabled but no status checks are provided."""
42
+ requirement = EnsureStatusChecksRule()
43
+
44
+ query_data["rules"].append(
45
+ create_rule(
46
+ name="main",
47
+ rule_type="required_status_checks",
48
+ ruleset_name="main",
49
+ parameters={"required_status_checks": []},
50
+ )
51
+ )
52
+
53
+ result = requirement.Evaluate(query_data, {"no": False})
54
+ assert result.result == EvaluateResult.Error
55
+ assert f"No active branch ruleset with {requirement.github_settings_value} found" in result.context
56
+
57
+ def test_Disabled(self, query_data):
58
+ """Test if the rule is disabled by not providing the appropriate rule within the ruleset."""
59
+ requirement = EnsureStatusChecksRule()
60
+
61
+ query_data["rules"].append(
62
+ create_rule(
63
+ name="Random Rule",
64
+ # Wrong rule type
65
+ rule_type="pull_request",
66
+ ruleset_name="main",
67
+ parameters={},
68
+ )
69
+ )
70
+
71
+ result = requirement.Evaluate(query_data, {"no": False})
72
+ assert result.result == EvaluateResult.Error
73
+ assert f"No active branch ruleset with {requirement.github_settings_value} found" in result.context
@@ -0,0 +1,73 @@
1
+ # -------------------------------------------------------------------------------
2
+ # |
3
+ # | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
4
+ # | Distributed under the MIT License.
5
+ # |
6
+ # -------------------------------------------------------------------------------
7
+ """Unit tests for RequireApprovalMostRecentPushRule.py"""
8
+
9
+ from RepoAuditor.Plugins.GitHub.RulesetRequirements.RequireApprovalMostRecentPush import (
10
+ RequireApprovalMostRecentPushRule,
11
+ )
12
+ from RepoAuditor.Requirement import EvaluateResult
13
+
14
+ from . import create_rule
15
+
16
+
17
+ class TestRequireApprovalMostRecentPushRule:
18
+ """Unit tests for the RequireApprovalMostRecentPushRule requirement."""
19
+
20
+ def test_Enabled(self, query_data):
21
+ """Test if the rule is enabled on the main branch."""
22
+ requirement = RequireApprovalMostRecentPushRule()
23
+
24
+ query_data["rules"].append(
25
+ create_rule(
26
+ name="PR Rules",
27
+ rule_type="pull_request",
28
+ ruleset_name="main",
29
+ parameters={"require_last_push_approval": True},
30
+ )
31
+ )
32
+
33
+ result = requirement.Evaluate(query_data, {"no": False})
34
+ assert result.result == EvaluateResult.Success
35
+ assert f"{requirement.github_settings_value} is enabled" in result.context
36
+
37
+ def test_Disabled(self, query_data):
38
+ """Test if the required rule is disabled on the main branch
39
+ by providing the value as false.
40
+ """
41
+ requirement = RequireApprovalMostRecentPushRule()
42
+
43
+ query_data["rules"].append(
44
+ create_rule(
45
+ name="PR Rules",
46
+ # Wrong rule type
47
+ rule_type="pull_request",
48
+ ruleset_name="main",
49
+ parameters={"require_last_push_approval": False},
50
+ )
51
+ )
52
+
53
+ result = requirement.Evaluate(query_data, {"no": False})
54
+ assert result.result == EvaluateResult.Error
55
+
56
+ def test_WrongRuleType(self, query_data):
57
+ """Test if the required rule is disabled on the main branch
58
+ by providing the wrong rule type.
59
+ """
60
+ requirement = RequireApprovalMostRecentPushRule()
61
+
62
+ query_data["rules"].append(
63
+ create_rule(
64
+ name="Inactive PR Rules",
65
+ # Wrong rule type
66
+ rule_type="push_request",
67
+ ruleset_name="Ruleset Main",
68
+ parameters={},
69
+ )
70
+ )
71
+
72
+ result = requirement.Evaluate(query_data, {"no": False})
73
+ assert result.result == EvaluateResult.Error