RepoAuditor 0.2.84__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.
- {repoauditor-0.2.84 → repoauditor-0.3.0}/PKG-INFO +1 -1
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/LicenseFile.py +1 -1
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/__init__.py +1 -1
- repoauditor-0.2.84/tests/Plugins/CommunityStandards/GitHubCommunityStandards_UnitTest.py → repoauditor-0.3.0/tests/Plugins/CommunityStandards/CommunityStandards_UnitTest.py +1 -1
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/CommunityStandards_EndToEndTest.py +1 -1
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/AllowMainlineForcePushesRule_UnitTest.py +53 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/DismissStalePullRequestApprovalsRule_UnitTest.py +73 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/EnsureStatusChecksRule_UnitTest.py +73 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireApprovalMostRecentPushRule_UnitTest.py +73 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireApprovalsRule_UnitTest.py +71 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireCodeOwnerReviewRule_UnitTest.py +73 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireConversationResolutionRule_UnitTest.py +73 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequirePullRequests_UnitTest.py +71 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireSignedCommits_UnitTest.py +71 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireStatusChecksToPassRule_UnitTest.py +58 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireUpToDateBranchesRule_UnitTest.py +73 -0
- repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/__init__.py +23 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/fixtures.py +1 -0
- repoauditor-0.2.84/tests/Plugins/GitHubModule/RulesetRequirements_UnitTest.py +0 -688
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.copier-answers.yml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/CODEOWNERS +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/ISSUE_TEMPLATE/custom.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/actions/release_impl/action.yml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/pull_request_template.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/release_sources.yaml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/workflows/CICD.yml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/workflows/CICD_impl.yml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/workflows/EndToEnd.yml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.github/workflows/codeql.yml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.gitignore +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.pre-commit-config.yaml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/.python-version +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/CODE_OF_CONDUCT.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/GOVERNANCE.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/LICENSE +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/MAINTAINERS.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/README.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/SECURITY.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/default_config.yaml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/docs/CONTRIBUTING.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/docs/DEVELOPMENT.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/docs/PAT.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/docs/config_file.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/docs/index.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/docs/troubleshooting.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/docs/usage.md +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/minisign_key.pub +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/mkdocs.yml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/pyproject.toml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/AutoGitSemVer.yaml +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/CommandLineProcessor.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Display.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/EntryPoint.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/ExecuteModules.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Impl/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Module.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugin.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/CommunityStandardsQuery.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Impl/ExistsRequirementImpl.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Impl/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Module.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOfConduct.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOwners.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/Contributing.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/IssueTemplates.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/PullRequestTemplates.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/ReadMe.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/SecurityPolicy.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandards/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/CommunityStandardsPlugin.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionQuery.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowDeletions.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowMainlineForcePushes.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DoNotAllowBypassSettings.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/EnsureStatusChecks.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicValueRequirementImpl.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovals.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireCodeOwnerReview.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireConversationResolution.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireLinearHistory.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequirePullRequests.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireSignedCommits.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireStatusChecksToPass.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireUpToDateBranches.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQuery.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/Protected.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRequirementImpl.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRulesetRequirementImpl.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Impl/ValueRequirementImpl.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Impl/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/Module.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetQuery.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/AllowMainlineForcePushes.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/DismissStalePullRequestApprovals.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/EnsureStatusChecks.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireApprovalMostRecentPush.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireApprovals.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireCodeOwnerReview.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireCodeScanningResults.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireConversationResolution.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireLinearHistory.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequirePullRequests.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireSignedCommits.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireStatusChecksToPass.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireSuccessfulDeployments.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireUpToDateBranches.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RestrictCreations.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RestrictDeletions.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RestrictUpdates.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/AutoMerge.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DefaultBranch.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DeleteHeadBranches.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DependabotSecurityUpdates.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Description.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardValueRequirementImpl.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/License.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommit.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommitMessage.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Private.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/RebaseMergeCommit.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanning.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanningPushProtection.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashCommitMerge.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashMergeCommitMessage.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SuggestUpdatingPullRequestBranches.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportDiscussions.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportIssues.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportProjects.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportWikis.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/TemplateRepository.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/WebCommitSignoff.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHub/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHubBase/Module.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHubBase/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/GitHubPlugin.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Plugins/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Query.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/Requirement.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/src/RepoAuditor/py.typed +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/CommandLineProcessor_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/EntryPoint_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/ExecuteModules_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Module_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugin_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/CommunityStandards/CommunityStandardsQuery_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/CommunityStandards/ExistsRequirementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubEnterprise_EndToEndTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionQuery_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/EnsureStatusChecks_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovals_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireCodeOwnerReview_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireUpToDateBranches_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ClassicValueRequirementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/DefaultBranchQuery_UnitTest.py +0 -0
- {repoauditor-0.2.84/tests/Plugins/GitHubModule/DefaultBranchQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/DefaultBranchRequirements}/Protected_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/EnableRulesetRequirementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/GitHubModule_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/GitHubSession_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/RulsesetQuery_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/StandardQuery_UnitTest.py +0 -0
- {repoauditor-0.2.84/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/DependabotSecurityUpdates_UnitTest.py +0 -0
- {repoauditor-0.2.84/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/Description_UnitTest.py +0 -0
- {repoauditor-0.2.84/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/License_UnitTest.py +0 -0
- {repoauditor-0.2.84/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/MergeCommitMessage_UnitTest.py +0 -0
- {repoauditor-0.2.84/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/Private_UnitTest.py +0 -0
- {repoauditor-0.2.84/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/SecretScanningPushProtection_UnitTest.py +0 -0
- {repoauditor-0.2.84/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/SecretScanning_UnitTest.py +0 -0
- {repoauditor-0.2.84/tests/Plugins/GitHubModule/StandardQueryRequirements → repoauditor-0.3.0/tests/Plugins/GitHubModule/StandardRequirements}/SquashMergeCommitMessage_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHubModule/ValueRequrementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/GitHub_EndToEndTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/__snapshots__/CommunityStandards_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/__snapshots__/GitHubEnterprise_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/conftest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Plugins/utilities.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Query_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/Requirement_UnitTest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/__init__.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/__snapshots__/ExecuteModules_UnitTest.ambr +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/tests/conftest.py +0 -0
- {repoauditor-0.2.84 → repoauditor-0.3.0}/uv.lock +0 -0
|
@@ -14,7 +14,7 @@ from RepoAuditor.Plugins.CommunityStandards.Impl.ExistsRequirementImpl import (
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class LicenseFile(ExistsRequirementImpl):
|
|
17
|
-
"""Validates that a
|
|
17
|
+
"""Validates that a file with licensing information is present."""
|
|
18
18
|
|
|
19
19
|
def __init__(self) -> None:
|
|
20
20
|
super().__init__(
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# | Distributed under the MIT License.
|
|
5
5
|
# |
|
|
6
6
|
# -------------------------------------------------------------------------------
|
|
7
|
-
"""Unit tests for the
|
|
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."""
|
|
@@ -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
|
repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/EnsureStatusChecksRule_UnitTest.py
ADDED
|
@@ -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
|
repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequireApprovalsRule_UnitTest.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
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 RequireApprovalsRule.py"""
|
|
8
|
+
|
|
9
|
+
from RepoAuditor.Plugins.GitHub.RulesetRequirements.RequireApprovals import RequireApprovalsRule
|
|
10
|
+
from RepoAuditor.Requirement import EvaluateResult
|
|
11
|
+
|
|
12
|
+
from . import create_rule
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TestRequireApprovalsRule:
|
|
16
|
+
"""Unit tests for the RequireApprovalsRule requirement."""
|
|
17
|
+
|
|
18
|
+
def test_Enabled(self, query_data):
|
|
19
|
+
"""Test if the rule is enabled on the main branch."""
|
|
20
|
+
requirement = RequireApprovalsRule()
|
|
21
|
+
|
|
22
|
+
query_data["rules"].append(
|
|
23
|
+
create_rule(
|
|
24
|
+
name="PR Rules",
|
|
25
|
+
rule_type="pull_request",
|
|
26
|
+
ruleset_name="main",
|
|
27
|
+
parameters={"required_approving_review_count": 1},
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
result = requirement.Evaluate(query_data, {"no": False})
|
|
32
|
+
assert result.result == EvaluateResult.Success
|
|
33
|
+
assert f"{requirement.github_settings_value} is enabled" in result.context
|
|
34
|
+
|
|
35
|
+
def test_Disabled(self, query_data):
|
|
36
|
+
"""Test if the required rule is disabled on the main branch
|
|
37
|
+
by providing the value as false.
|
|
38
|
+
"""
|
|
39
|
+
requirement = RequireApprovalsRule()
|
|
40
|
+
|
|
41
|
+
query_data["rules"].append(
|
|
42
|
+
create_rule(
|
|
43
|
+
name="PR Rules",
|
|
44
|
+
# Wrong rule type
|
|
45
|
+
rule_type="pull_request",
|
|
46
|
+
ruleset_name="main",
|
|
47
|
+
parameters={"required_approving_review_count": 0},
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
result = requirement.Evaluate(query_data, {"no": False})
|
|
52
|
+
assert result.result == EvaluateResult.Error
|
|
53
|
+
|
|
54
|
+
def test_WrongRuleType(self, query_data):
|
|
55
|
+
"""Test if the required rule is disabled on the main branch
|
|
56
|
+
by providing the wrong rule type.
|
|
57
|
+
"""
|
|
58
|
+
requirement = RequireApprovalsRule()
|
|
59
|
+
|
|
60
|
+
query_data["rules"].append(
|
|
61
|
+
create_rule(
|
|
62
|
+
name="Inactive PR Rules",
|
|
63
|
+
# Wrong rule type
|
|
64
|
+
rule_type="push_request",
|
|
65
|
+
ruleset_name="main",
|
|
66
|
+
parameters={},
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
result = requirement.Evaluate(query_data, {"no": False})
|
|
71
|
+
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 RequireCodeOwnerReviewRule.py"""
|
|
8
|
+
|
|
9
|
+
from RepoAuditor.Plugins.GitHub.RulesetRequirements.RequireCodeOwnerReview import (
|
|
10
|
+
RequireCodeOwnerReviewRule,
|
|
11
|
+
)
|
|
12
|
+
from RepoAuditor.Requirement import EvaluateResult
|
|
13
|
+
|
|
14
|
+
from . import create_rule
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class TestRequireCodeOwnerReviewRule:
|
|
18
|
+
"""Unit tests for the RequireCodeOwnerReviewRule requirement."""
|
|
19
|
+
|
|
20
|
+
def test_Enabled(self, query_data):
|
|
21
|
+
"""Test if the rule is enabled on the main branch."""
|
|
22
|
+
requirement = RequireCodeOwnerReviewRule()
|
|
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_code_owner_review": True},
|
|
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 required rule is disabled on the main branch
|
|
39
|
+
by providing the value as false.
|
|
40
|
+
"""
|
|
41
|
+
requirement = RequireCodeOwnerReviewRule()
|
|
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_code_owner_review": False},
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
result = requirement.Evaluate(query_data, {"yes": True})
|
|
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 = RequireCodeOwnerReviewRule()
|
|
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, {"yes": True})
|
|
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 RequireConversationResolutionRule.py"""
|
|
8
|
+
|
|
9
|
+
from RepoAuditor.Plugins.GitHub.RulesetRequirements.RequireConversationResolution import (
|
|
10
|
+
RequireConversationResolutionRule,
|
|
11
|
+
)
|
|
12
|
+
from RepoAuditor.Requirement import EvaluateResult
|
|
13
|
+
|
|
14
|
+
from . import create_rule
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class TestRequireConversationResolutionRule:
|
|
18
|
+
"""Unit tests for the RequireConversationResolutionRule requirement."""
|
|
19
|
+
|
|
20
|
+
def test_Enabled(self, query_data):
|
|
21
|
+
"""Test if the rule is enabled on the main branch."""
|
|
22
|
+
requirement = RequireConversationResolutionRule()
|
|
23
|
+
|
|
24
|
+
query_data["rules"].append(
|
|
25
|
+
create_rule(
|
|
26
|
+
name="PR Rules",
|
|
27
|
+
rule_type="pull_request",
|
|
28
|
+
ruleset_name="main",
|
|
29
|
+
parameters={"required_review_thread_resolution": 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 = RequireConversationResolutionRule()
|
|
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={"required_review_thread_resolution": 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 = RequireConversationResolutionRule()
|
|
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
|
repoauditor-0.3.0/tests/Plugins/GitHubModule/RulesetRequirements/RequirePullRequests_UnitTest.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
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 the RequirePullRequests.py"""
|
|
8
|
+
|
|
9
|
+
from RepoAuditor.Plugins.GitHub.RulesetRequirements.RequirePullRequests import RequirePullRequests
|
|
10
|
+
from RepoAuditor.Requirement import EvaluateResult
|
|
11
|
+
|
|
12
|
+
from . import create_rule
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TestRequirePullRequests:
|
|
16
|
+
"""Unit tests for the RequirePullRequests requirement."""
|
|
17
|
+
|
|
18
|
+
def test_Enabled(self, query_data):
|
|
19
|
+
"""Test if the rule is enabled on the main branch."""
|
|
20
|
+
requirement = RequirePullRequests()
|
|
21
|
+
|
|
22
|
+
query_data["rules"].append(
|
|
23
|
+
create_rule(
|
|
24
|
+
name="PR Rules",
|
|
25
|
+
rule_type="pull_request",
|
|
26
|
+
ruleset_name="Ruleset Main",
|
|
27
|
+
parameters={},
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
result = requirement.Evaluate(query_data, {"no": False})
|
|
32
|
+
assert result.result == EvaluateResult.Success
|
|
33
|
+
assert f"{requirement.github_settings_value} is enabled" in result.context
|
|
34
|
+
|
|
35
|
+
def test_Disabled(self, query_data):
|
|
36
|
+
"""Test if the required rule is disabled on the main branch
|
|
37
|
+
by providing the wrong rule type.
|
|
38
|
+
"""
|
|
39
|
+
requirement = RequirePullRequests()
|
|
40
|
+
|
|
41
|
+
query_data["rules"].append(
|
|
42
|
+
create_rule(
|
|
43
|
+
name="Inactive PR Rules",
|
|
44
|
+
# Wrong rule type
|
|
45
|
+
rule_type="push_request",
|
|
46
|
+
ruleset_name="Ruleset Main",
|
|
47
|
+
parameters={},
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
result = requirement.Evaluate(query_data, {"no": True})
|
|
52
|
+
assert result.result == EvaluateResult.Success
|
|
53
|
+
|
|
54
|
+
def test_WrongTarget(self, query_data):
|
|
55
|
+
"""Test if rules are applied on the wrong branch."""
|
|
56
|
+
requirement = RequirePullRequests()
|
|
57
|
+
query_data["rules"] = [
|
|
58
|
+
# GitHub behavior is to always give enforced rules on the specified target target.
|
|
59
|
+
# Hence the rules here will be empty.
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
result = requirement.Evaluate(query_data, {"no": False})
|
|
63
|
+
assert result.result == EvaluateResult.Error
|
|
64
|
+
|
|
65
|
+
def test_NoRulesets(self, query_data):
|
|
66
|
+
"""Test if no rules are applied on the main branch."""
|
|
67
|
+
requirement = RequirePullRequests()
|
|
68
|
+
query_data["rules"] = []
|
|
69
|
+
result = requirement.Evaluate(query_data, {"no": False})
|
|
70
|
+
assert result.result == EvaluateResult.Error
|
|
71
|
+
assert f"No active branch ruleset with {requirement.github_settings_value} found" in result.context
|