RepoAuditor 0.2.69__tar.gz → 0.2.71__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.69 → repoauditor-0.2.71}/PKG-INFO +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/EnsureStatusChecks.py +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRequirementImpl.py +11 -9
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRulesetRequirementImpl.py +2 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/Impl/ValueRequirementImpl.py +4 -4
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequirePullRequests.py +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireSignedCommits.py +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireStatusChecks.py +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DefaultBranch.py +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Description.py +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Private.py +4 -5
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHubBase/Module.py +11 -6
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Requirement.py +3 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/__init__.py +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/CommunityStandards_EndToEndTest.py +3 -6
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubEnterprise_EndToEndTest.py +3 -6
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals_UnitTest.py +10 -10
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush_UnitTest.py +9 -8
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovals_UnitTest.py +11 -12
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireCodeOwnerReview_UnitTest.py +11 -12
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireUpToDateBranches_UnitTest.py +10 -10
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/StandardQueryRequirements/DependabotSecurityUpdates_UnitTest.py +14 -10
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/StandardQueryRequirements/License_UnitTest.py +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/StandardQueryRequirements/MergeCommitMessage_UnitTest.py +13 -12
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/StandardQueryRequirements/Private_UnitTest.py +10 -6
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/StandardQueryRequirements/SecretScanningPushProtection_UnitTest.py +14 -10
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/StandardQueryRequirements/SecretScanning_UnitTest.py +14 -10
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/StandardQueryRequirements/SquashMergeCommitMessage_UnitTest.py +11 -10
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/ValueRequrementImpl_UnitTest.py +2 -2
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/fixtures.py +1 -1
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHub_EndToEndTest.py +3 -6
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/__snapshots__/GitHubEnterprise_EndToEndTest.ambr +34 -35
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr +58 -59
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Requirement_UnitTest.py +2 -2
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.copier-answers.yml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/CODEOWNERS +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/ISSUE_TEMPLATE/custom.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/actions/release_impl/action.yml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/pull_request_template.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/release_sources.yaml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/workflows/CICD.yml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/workflows/CICD_impl.yml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/workflows/EndToEnd.yml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.github/workflows/codeql.yml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.gitignore +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.pre-commit-config.yaml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/.python-version +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/CODE_OF_CONDUCT.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/CONTRIBUTING.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/DEVELOPMENT.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/GOVERNANCE.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/LICENSE +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/MAINTAINERS.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/README.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/SECURITY.md +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/default_config.yaml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/minisign_key.pub +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/pyproject.toml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/AutoGitSemVer.yaml +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/CommandLineProcessor.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Display.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/EntryPoint.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/ExecuteModules.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Impl/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Module.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugin.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/CommunityStandardsQuery.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Impl/ExistsRequirementImpl.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Impl/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Module.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOfConduct.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOwners.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/Contributing.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/IssueTemplates.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/LicenseFile.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/PullRequestTemplates.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/ReadMe.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/SecurityPolicy.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandards/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/CommunityStandardsPlugin.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionQuery.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowDeletions.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowMainlineForcePushes.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DoNotAllowBypassSettings.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicValueRequirementImpl.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovals.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireCodeOwnerReview.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireConversationResolution.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireLinearHistory.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequirePullRequests.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireSignedCommits.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireStatusChecksToPass.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireUpToDateBranches.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQuery.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/Protected.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/Impl/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/Module.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/RulesetQuery.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/AutoMerge.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DeleteHeadBranches.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DependabotSecurityUpdates.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardValueRequirementImpl.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/License.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommit.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommitMessage.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/RebaseMergeCommit.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanning.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanningPushProtection.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashCommitMerge.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashMergeCommitMessage.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SuggestUpdatingPullRequestBranches.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportDiscussions.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportIssues.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportProjects.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportWikis.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/TemplateRepository.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/WebCommitSignoff.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHub/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHubBase/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/GitHubPlugin.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Plugins/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/Query.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/src/RepoAuditor/py.typed +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/CommandLineProcessor_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/EntryPoint_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/ExecuteModules_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Module_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugin_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/CommunityStandards/CommunityStandardsQuery_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/CommunityStandards/ExistsRequirementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/CommunityStandards/GitHubCommunityStandards_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/ClassicBranchProtectionQuery_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/EnsureStatusChecks_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/ClassicValueRequirementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/DefaultBranchQueryRequirements/Protected_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/DefaultBranchQuery_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/EnableRulesetRequirementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/GitHubModule_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/GitHubSession_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/RulesetRequirements_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/RulsesetQuery_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/StandardQueryRequirements/Description_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/GitHubModule/StandardQuery_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/__snapshots__/CommunityStandards_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/conftest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Plugins/utilities.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/Query_UnitTest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/__init__.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/__snapshots__/ExecuteModules_UnitTest.ambr +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/tests/conftest.py +0 -0
- {repoauditor-0.2.69 → repoauditor-0.2.71}/uv.lock +0 -0
|
@@ -24,7 +24,7 @@ class EnsureStatusChecks(Requirement):
|
|
|
24
24
|
def __init__(self) -> None:
|
|
25
25
|
super().__init__(
|
|
26
26
|
"EnsureStatusChecks",
|
|
27
|
-
"Ensure that status checks have been enabled for the branch.",
|
|
27
|
+
"Ensure that status checks have been enabled for the '{branch}' branch.",
|
|
28
28
|
ExecutionStyle.Parallel,
|
|
29
29
|
textwrap.dedent(
|
|
30
30
|
"""\
|
|
@@ -44,7 +44,7 @@ class EnableRequirementImpl(Requirement):
|
|
|
44
44
|
|
|
45
45
|
super().__init__(
|
|
46
46
|
name,
|
|
47
|
-
f"Validates that {subject} is set to
|
|
47
|
+
f"Validates that {subject} is set to {{__expected_value}}.",
|
|
48
48
|
ExecutionStyle.Parallel,
|
|
49
49
|
resolution,
|
|
50
50
|
rationale,
|
|
@@ -79,6 +79,16 @@ class EnableRequirementImpl(Requirement):
|
|
|
79
79
|
query_data: dict[str, Any],
|
|
80
80
|
requirement_args: dict[str, Any],
|
|
81
81
|
) -> Requirement.EvaluateImplResult:
|
|
82
|
+
expected_value = self.enabled_by_default
|
|
83
|
+
|
|
84
|
+
if requirement_args[self.dynamic_arg_name]:
|
|
85
|
+
expected_value = not expected_value
|
|
86
|
+
provide_rationale = False
|
|
87
|
+
else:
|
|
88
|
+
provide_rationale = True
|
|
89
|
+
|
|
90
|
+
query_data["__expected_value"] = expected_value
|
|
91
|
+
|
|
82
92
|
result = self.get_configuration_value_func(query_data)
|
|
83
93
|
if result is None:
|
|
84
94
|
if query_data["session"].is_enterprise:
|
|
@@ -95,14 +105,6 @@ class EnableRequirementImpl(Requirement):
|
|
|
95
105
|
|
|
96
106
|
return Requirement.EvaluateImplResult(EvaluateResult.DoesNotApply, None)
|
|
97
107
|
|
|
98
|
-
expected_value = self.enabled_by_default
|
|
99
|
-
|
|
100
|
-
if requirement_args[self.dynamic_arg_name]:
|
|
101
|
-
expected_value = not expected_value
|
|
102
|
-
provide_rationale = False
|
|
103
|
-
else:
|
|
104
|
-
provide_rationale = True
|
|
105
|
-
|
|
106
108
|
if result != expected_value:
|
|
107
109
|
query_data["__checked_desc"] = self.unset_set_terminology[int(expected_value)]
|
|
108
110
|
|
|
@@ -67,7 +67,8 @@ class EnableRulesetRequirementImpl(EnableRequirementImpl):
|
|
|
67
67
|
else:
|
|
68
68
|
provide_rationale = True
|
|
69
69
|
|
|
70
|
-
query_data["__expected_value"] =
|
|
70
|
+
query_data["__expected_value"] = expected_rule_enabled
|
|
71
|
+
query_data["__enabled_str"] = "Enable" if expected_rule_enabled else "Disable"
|
|
71
72
|
|
|
72
73
|
# Get the rules for the specified branch
|
|
73
74
|
rules = query_data.get("rules", [])
|
|
@@ -51,7 +51,7 @@ class ValueRequirementImpl(Requirement):
|
|
|
51
51
|
|
|
52
52
|
super().__init__(
|
|
53
53
|
name,
|
|
54
|
-
f"Validates that {subject} is set to
|
|
54
|
+
f"Validates that {subject} is set to '{{__expected_value}}'.",
|
|
55
55
|
ExecutionStyle.Parallel,
|
|
56
56
|
resolution,
|
|
57
57
|
rationale,
|
|
@@ -84,6 +84,9 @@ class ValueRequirementImpl(Requirement):
|
|
|
84
84
|
query_data: dict[str, Any],
|
|
85
85
|
requirement_args: dict[str, Any],
|
|
86
86
|
) -> Requirement.EvaluateImplResult:
|
|
87
|
+
expected_value = requirement_args["value"]
|
|
88
|
+
query_data["__expected_value"] = f"{expected_value}"
|
|
89
|
+
|
|
87
90
|
result = self.get_configuration_value_func(query_data)
|
|
88
91
|
if result is None:
|
|
89
92
|
if self.missing_value_is_warning:
|
|
@@ -91,7 +94,6 @@ class ValueRequirementImpl(Requirement):
|
|
|
91
94
|
|
|
92
95
|
return Requirement.EvaluateImplResult(EvaluateResult.DoesNotApply, None)
|
|
93
96
|
|
|
94
|
-
expected_value = requirement_args["value"]
|
|
95
97
|
is_default_expected_value = expected_value == self.default_value
|
|
96
98
|
|
|
97
99
|
if isinstance(result, DoesNotApplyResult):
|
|
@@ -106,8 +108,6 @@ class ValueRequirementImpl(Requirement):
|
|
|
106
108
|
result = str(result)
|
|
107
109
|
|
|
108
110
|
if result != expected_value:
|
|
109
|
-
query_data["__expected_value"] = f"'{expected_value}'"
|
|
110
|
-
|
|
111
111
|
return Requirement.EvaluateImplResult(
|
|
112
112
|
EvaluateResult.Error,
|
|
113
113
|
f"{self.github_value} must be set to '{expected_value}' (it is currently set to '{result}').",
|
|
@@ -20,6 +20,6 @@ class RequirePullRequests(EnableRulesetRequirementImpl):
|
|
|
20
20
|
github_ruleset_type="pull_request",
|
|
21
21
|
github_ruleset_value="Require a pull request before merging",
|
|
22
22
|
get_configuration_value_func=lambda rule: rule.get("type", "") == "pull_request",
|
|
23
|
-
resolution="{
|
|
23
|
+
resolution="{__enabled_str} pull request rule in repository rulesets",
|
|
24
24
|
rationale="Pull request reviews help maintain code quality and collaboration",
|
|
25
25
|
)
|
|
@@ -20,6 +20,6 @@ class RequireSignedCommits(EnableRulesetRequirementImpl):
|
|
|
20
20
|
github_ruleset_type="required_signatures",
|
|
21
21
|
github_ruleset_value="Require signed commits",
|
|
22
22
|
get_configuration_value_func=lambda rule: rule.get("type", "") == "required_signatures",
|
|
23
|
-
resolution="
|
|
23
|
+
resolution="{__enabled_str} commit signing requirement in repository rulesets",
|
|
24
24
|
rationale="Signed commits ensure commit authenticity",
|
|
25
25
|
)
|
|
@@ -20,6 +20,6 @@ class RequireStatusChecks(EnableRulesetRequirementImpl):
|
|
|
20
20
|
github_ruleset_type="required_status_checks",
|
|
21
21
|
github_ruleset_value="Require status checks to pass",
|
|
22
22
|
get_configuration_value_func=lambda rule: rule.get("type", "") == "required_status_checks",
|
|
23
|
-
resolution="
|
|
23
|
+
resolution="{__enabled_str} required status checks in repository rulesets",
|
|
24
24
|
rationale="Status checks ensure code quality and compatibility",
|
|
25
25
|
)
|
|
@@ -25,7 +25,7 @@ class Private(Requirement):
|
|
|
25
25
|
def __init__(self) -> None:
|
|
26
26
|
super().__init__(
|
|
27
27
|
"Private",
|
|
28
|
-
"Validates that the repository is set to
|
|
28
|
+
"Validates that the repository's visibility is set to '{__expected_visibility}'.",
|
|
29
29
|
ExecutionStyle.Parallel,
|
|
30
30
|
textwrap.dedent(
|
|
31
31
|
"""\
|
|
@@ -71,16 +71,15 @@ class Private(Requirement):
|
|
|
71
71
|
query_data: dict[str, Any],
|
|
72
72
|
requirement_args: dict[str, Any],
|
|
73
73
|
) -> Requirement.EvaluateImplResult:
|
|
74
|
+
expect_private = requirement_args["enabled"]
|
|
75
|
+
query_data["__expected_visibility"] = "private" if expect_private else "public"
|
|
76
|
+
|
|
74
77
|
result = query_data["standard"].get("private", None)
|
|
75
78
|
|
|
76
79
|
if result is None:
|
|
77
80
|
return CreateIncompleteDataResult()
|
|
78
81
|
|
|
79
|
-
expect_private = requirement_args["enabled"]
|
|
80
|
-
|
|
81
82
|
if result != expect_private:
|
|
82
|
-
query_data["__expected_visibility"] = "private" if expect_private else "public"
|
|
83
|
-
|
|
84
83
|
return Requirement.EvaluateImplResult(
|
|
85
84
|
EvaluateResult.Error,
|
|
86
85
|
f"The repository's visibility must be {query_data['__expected_visibility']}.",
|
|
@@ -58,6 +58,17 @@ class GitHubBaseModule(Module):
|
|
|
58
58
|
@override
|
|
59
59
|
def GenerateInitialData(self, dynamic_args: dict[str, Any]) -> Optional[dict[str, Any]]:
|
|
60
60
|
"""Generate the initial data to be used in the `dynamic_args`, such as session info, etc."""
|
|
61
|
+
# Read the PAT (if provided) as a filename or a value.
|
|
62
|
+
# This also decouples the PAT reading logic from the GitHubSession class (which may be mocked for testing).
|
|
63
|
+
github_pat = dynamic_args.get("pat")
|
|
64
|
+
if github_pat:
|
|
65
|
+
potential_file = Path(github_pat)
|
|
66
|
+
if potential_file.is_file():
|
|
67
|
+
with potential_file.open("r") as f:
|
|
68
|
+
github_pat = f.read().strip()
|
|
69
|
+
# Re-assign github_pat so it can be used within the subclassed modules.
|
|
70
|
+
dynamic_args["pat"] = github_pat
|
|
71
|
+
|
|
61
72
|
# Create a GitHub API session
|
|
62
73
|
dynamic_args["session"] = _GitHubSession(dynamic_args["url"], dynamic_args.get("pat"))
|
|
63
74
|
|
|
@@ -90,12 +101,6 @@ class _GitHubSession(requests.Session):
|
|
|
90
101
|
)
|
|
91
102
|
|
|
92
103
|
if github_pat:
|
|
93
|
-
potential_file = Path(github_pat)
|
|
94
|
-
|
|
95
|
-
if potential_file.is_file():
|
|
96
|
-
with potential_file.open("r") as f:
|
|
97
|
-
github_pat = f.read().strip()
|
|
98
|
-
|
|
99
104
|
self.headers["Authorization"] = f"Bearer {github_pat}"
|
|
100
105
|
|
|
101
106
|
github_url = github_url.removesuffix("/")
|
|
@@ -112,6 +112,9 @@ class Requirement(ABC):
|
|
|
112
112
|
"""Evaluate the requirements given the query data and specific arguments."""
|
|
113
113
|
result_info = self._EvaluateImpl(query_data, requirement_args)
|
|
114
114
|
|
|
115
|
+
# Fill in templates in description string
|
|
116
|
+
self.description = self.description.format(**query_data)
|
|
117
|
+
|
|
115
118
|
if result_info.result == EvaluateResult.Error:
|
|
116
119
|
return Requirement.EvaluateInfo(
|
|
117
120
|
result_info.result,
|
|
@@ -334,10 +334,7 @@ def args() -> list[str]:
|
|
|
334
334
|
# ----------------------------------------------------------------------
|
|
335
335
|
@pytest.fixture
|
|
336
336
|
def pat_args(args) -> list[str]:
|
|
337
|
-
|
|
338
|
-
CheckPATFileExists(
|
|
337
|
+
github_pat_filename = (Path(__file__).parent / "github_pat.txt").resolve()
|
|
338
|
+
CheckPATFileExists(github_pat_filename)
|
|
339
339
|
|
|
340
|
-
|
|
341
|
-
pat_value = f.read().strip()
|
|
342
|
-
|
|
343
|
-
return args + ["--CommunityStandards-pat", pat_value]
|
|
340
|
+
return args + ["--CommunityStandards-pat", str(github_pat_filename)]
|
|
@@ -39,15 +39,12 @@ def args() -> list[str]:
|
|
|
39
39
|
# ----------------------------------------------------------------------
|
|
40
40
|
@pytest.fixture
|
|
41
41
|
def pat_args(args) -> list[str]:
|
|
42
|
-
|
|
42
|
+
github_pat_filename = (Path(__file__).parent / "github_gatech_pat.txt").resolve()
|
|
43
43
|
parsed = urllib.parse.urlparse(GetGithubUrl("enterprise"))
|
|
44
44
|
parsed = parsed._replace(path="")
|
|
45
|
-
CheckPATFileExists(
|
|
45
|
+
CheckPATFileExists(github_pat_filename, github_url=parsed.geturl())
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
pat_value = f.read().strip()
|
|
49
|
-
|
|
50
|
-
return args + ["--GitHub-pat", pat_value]
|
|
47
|
+
return args + ["--GitHub-pat", str(github_pat_filename)]
|
|
51
48
|
|
|
52
49
|
|
|
53
50
|
# ----------------------------------------------------------------------
|
|
@@ -32,44 +32,44 @@ def requirement():
|
|
|
32
32
|
return DismissStalePullRequestApprovals()
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
@pytest.fixture(name="requirement_args")
|
|
36
|
+
def requirement_args_fixture():
|
|
37
|
+
return {"disabled": False}
|
|
38
|
+
|
|
39
|
+
|
|
35
40
|
class TestDismissStalePullRequestApprovals:
|
|
36
|
-
def test_required_pull_request_reviews_missing(self, requirement, query_data):
|
|
41
|
+
def test_required_pull_request_reviews_missing(self, requirement, query_data, requirement_args):
|
|
37
42
|
"""Test when `required_pull_request_reviews` is missing."""
|
|
38
43
|
query_data["branch_protection_data"] = {}
|
|
39
|
-
requirement_args = {}
|
|
40
44
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
41
45
|
assert result.result == EvaluateResult.DoesNotApply
|
|
42
46
|
assert result.context is None
|
|
43
47
|
|
|
44
|
-
def test_required_pull_request_reviews_none(self, requirement, query_data):
|
|
48
|
+
def test_required_pull_request_reviews_none(self, requirement, query_data, requirement_args):
|
|
45
49
|
"""Test when `required_pull_request_reviews` is None"""
|
|
46
50
|
query_data["branch_protection_data"]["required_pull_request_reviews"] = None
|
|
47
|
-
requirement_args = {}
|
|
48
51
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
49
52
|
assert result.result == EvaluateResult.DoesNotApply
|
|
50
53
|
assert result.context is None
|
|
51
54
|
|
|
52
|
-
def test_dismiss_stale_reviews_missing(self, requirement, query_data):
|
|
55
|
+
def test_dismiss_stale_reviews_missing(self, requirement, query_data, requirement_args):
|
|
53
56
|
"""Test when `dismiss_stale_reviews` is missing"""
|
|
54
57
|
query_data["branch_protection_data"]["required_pull_request_reviews"] = {}
|
|
55
|
-
requirement_args = {}
|
|
56
58
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
57
59
|
assert result.result == EvaluateResult.DoesNotApply
|
|
58
60
|
assert result.context is None
|
|
59
61
|
|
|
60
|
-
def test_dismiss_stale_reviews_none(self, requirement, query_data):
|
|
62
|
+
def test_dismiss_stale_reviews_none(self, requirement, query_data, requirement_args):
|
|
61
63
|
"""Test when `dismiss_stale_reviews` is None"""
|
|
62
64
|
query_data["branch_protection_data"]["required_pull_request_reviews"] = {
|
|
63
65
|
"dismiss_stale_reviews": None
|
|
64
66
|
}
|
|
65
|
-
requirement_args = {}
|
|
66
67
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
67
68
|
assert result.result == EvaluateResult.DoesNotApply
|
|
68
69
|
assert result.context is None
|
|
69
70
|
|
|
70
|
-
def test_successful(self, requirement, query_data):
|
|
71
|
+
def test_successful(self, requirement, query_data, requirement_args):
|
|
71
72
|
"""Test successful"""
|
|
72
73
|
query_data["branch_protection_data"]["required_pull_request_reviews"]["dismiss_stale_reviews"] = True
|
|
73
|
-
requirement_args = {"disabled": False}
|
|
74
74
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
75
75
|
assert result.result == EvaluateResult.Success
|
|
@@ -32,34 +32,35 @@ def requirement():
|
|
|
32
32
|
return RequireApprovalMostRecentPush()
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
@pytest.fixture(name="requirement_args")
|
|
36
|
+
def requirement_args_fixture():
|
|
37
|
+
return {"disabled": False}
|
|
38
|
+
|
|
39
|
+
|
|
35
40
|
class TestRequireApprovalMostRecentPush:
|
|
36
|
-
def test_required_pull_request_reviews_missing(self, requirement, query_data):
|
|
41
|
+
def test_required_pull_request_reviews_missing(self, requirement, query_data, requirement_args):
|
|
37
42
|
"""Test when `required_pull_request_reviews` is missing"""
|
|
38
43
|
query_data["branch_protection_data"] = {}
|
|
39
|
-
requirement_args = {}
|
|
40
44
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
41
45
|
assert result.result == EvaluateResult.DoesNotApply
|
|
42
46
|
assert result.context is None
|
|
43
47
|
|
|
44
|
-
def test_required_pull_request_reviews_none(self, requirement, query_data):
|
|
48
|
+
def test_required_pull_request_reviews_none(self, requirement, query_data, requirement_args):
|
|
45
49
|
"""Test when `required_pull_request_reviews` is None"""
|
|
46
50
|
query_data["branch_protection_data"]["required_pull_request_reviews"] = None
|
|
47
|
-
requirement_args = {}
|
|
48
51
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
49
52
|
assert result.result == EvaluateResult.DoesNotApply
|
|
50
53
|
assert result.context is None
|
|
51
54
|
|
|
52
|
-
def test_require_last_push_approval_missing(self, requirement, query_data):
|
|
55
|
+
def test_require_last_push_approval_missing(self, requirement, query_data, requirement_args):
|
|
53
56
|
"""Test when `require_last_push_approval` is missing"""
|
|
54
57
|
query_data["branch_protection_data"]["required_pull_request_reviews"] = {}
|
|
55
|
-
requirement_args = {}
|
|
56
58
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
57
59
|
assert result.result == EvaluateResult.DoesNotApply
|
|
58
60
|
assert result.context is None
|
|
59
61
|
|
|
60
|
-
def test_require_last_push_approval_none(self, requirement, query_data):
|
|
62
|
+
def test_require_last_push_approval_none(self, requirement, query_data, requirement_args):
|
|
61
63
|
"""Test when `require_last_push_approval` is None"""
|
|
62
|
-
requirement_args = {}
|
|
63
64
|
query_data["branch_protection_data"]["required_pull_request_reviews"][
|
|
64
65
|
"require_last_push_approval"
|
|
65
66
|
] = None
|
|
@@ -30,47 +30,47 @@ def requirement():
|
|
|
30
30
|
return RequireApprovals()
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
@pytest.fixture(name="requirement_args")
|
|
34
|
+
def requirement_args_fixture():
|
|
35
|
+
return {"value": "1"}
|
|
36
|
+
|
|
37
|
+
|
|
33
38
|
class TestRequireApprovals:
|
|
34
|
-
def test_required_pull_request_reviews_missing(self, requirement, query_data):
|
|
39
|
+
def test_required_pull_request_reviews_missing(self, requirement, query_data, requirement_args):
|
|
35
40
|
"""Test when `required_pull_request_reviews` is missing"""
|
|
36
41
|
query_data["branch_protection_data"] = {}
|
|
37
|
-
requirement_args = {}
|
|
38
42
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
39
43
|
assert result.result == EvaluateResult.DoesNotApply
|
|
40
44
|
assert result.context is None
|
|
41
45
|
|
|
42
|
-
def test_required_pull_request_reviews_none(self, requirement, query_data):
|
|
46
|
+
def test_required_pull_request_reviews_none(self, requirement, query_data, requirement_args):
|
|
43
47
|
"""Test when `required_pull_request_reviews` is None"""
|
|
44
48
|
query_data["branch_protection_data"]["required_pull_request_reviews"] = None
|
|
45
|
-
requirement_args = {}
|
|
46
49
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
47
50
|
assert result.result == EvaluateResult.DoesNotApply
|
|
48
51
|
assert result.context is None
|
|
49
52
|
|
|
50
|
-
def test_required_approving_review_count_missing(self, requirement, query_data):
|
|
53
|
+
def test_required_approving_review_count_missing(self, requirement, query_data, requirement_args):
|
|
51
54
|
"""Test when `required_approving_review_count` is missing"""
|
|
52
55
|
query_data["branch_protection_data"]["required_pull_request_reviews"] = {}
|
|
53
|
-
requirement_args = {}
|
|
54
56
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
55
57
|
assert result.result == EvaluateResult.DoesNotApply
|
|
56
58
|
assert result.context is None
|
|
57
59
|
|
|
58
|
-
def test_required_approving_review_count_none(self, requirement, query_data):
|
|
60
|
+
def test_required_approving_review_count_none(self, requirement, query_data, requirement_args):
|
|
59
61
|
"""Test when `required_approving_review_count` is None"""
|
|
60
62
|
query_data["branch_protection_data"]["required_pull_request_reviews"][
|
|
61
63
|
"required_approving_review_count"
|
|
62
64
|
] = None
|
|
63
|
-
requirement_args = {}
|
|
64
65
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
65
66
|
assert result.result == EvaluateResult.DoesNotApply
|
|
66
67
|
assert result.context is None
|
|
67
68
|
|
|
68
|
-
def test_IncorrectValue(self, requirement, query_data):
|
|
69
|
+
def test_IncorrectValue(self, requirement, query_data, requirement_args):
|
|
69
70
|
"""Test incorrect"""
|
|
70
71
|
query_data["branch_protection_data"]["required_pull_request_reviews"][
|
|
71
72
|
"required_approving_review_count"
|
|
72
73
|
] = "2"
|
|
73
|
-
requirement_args = {"value": "1"}
|
|
74
74
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
75
75
|
assert result.result == EvaluateResult.Error
|
|
76
76
|
assert (
|
|
@@ -78,11 +78,10 @@ class TestRequireApprovals:
|
|
|
78
78
|
in result.context
|
|
79
79
|
)
|
|
80
80
|
|
|
81
|
-
def test_Successful(self, requirement, query_data):
|
|
81
|
+
def test_Successful(self, requirement, query_data, requirement_args):
|
|
82
82
|
"""Test successful"""
|
|
83
83
|
query_data["branch_protection_data"]["required_pull_request_reviews"][
|
|
84
84
|
"required_approving_review_count"
|
|
85
85
|
] = "1"
|
|
86
|
-
requirement_args = {"value": "1"}
|
|
87
86
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
88
87
|
assert result.result == EvaluateResult.Success
|
|
@@ -32,47 +32,47 @@ def requirement():
|
|
|
32
32
|
return RequireCodeOwnerReview()
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
@pytest.fixture(name="requirement_args")
|
|
36
|
+
def requirement_args_fixture():
|
|
37
|
+
return {"enabled": True}
|
|
38
|
+
|
|
39
|
+
|
|
35
40
|
class TestRequireCodeOwnerReview:
|
|
36
|
-
def test_required_pull_request_reviews_missing(self, requirement, query_data):
|
|
41
|
+
def test_required_pull_request_reviews_missing(self, requirement, query_data, requirement_args):
|
|
37
42
|
"""Test when `required_pull_request_reviews` is missing"""
|
|
38
43
|
query_data["branch_protection_data"] = {}
|
|
39
|
-
requirement_args = {}
|
|
40
44
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
41
45
|
assert result.result == EvaluateResult.DoesNotApply
|
|
42
46
|
assert result.context is None
|
|
43
47
|
|
|
44
|
-
def test_required_pull_request_reviews_none(self, requirement, query_data):
|
|
48
|
+
def test_required_pull_request_reviews_none(self, requirement, query_data, requirement_args):
|
|
45
49
|
"""Test when `required_pull_request_reviews` is None"""
|
|
46
50
|
query_data["branch_protection_data"]["required_pull_request_reviews"] = None
|
|
47
|
-
requirement_args = {}
|
|
48
51
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
49
52
|
assert result.result == EvaluateResult.DoesNotApply
|
|
50
53
|
assert result.context is None
|
|
51
54
|
|
|
52
|
-
def test_require_code_owner_reviews_missing(self, requirement, query_data):
|
|
55
|
+
def test_require_code_owner_reviews_missing(self, requirement, query_data, requirement_args):
|
|
53
56
|
"""Test when `require_code_owner_reviews` is missing"""
|
|
54
57
|
query_data["branch_protection_data"]["required_pull_request_reviews"] = {}
|
|
55
|
-
requirement_args = {}
|
|
56
58
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
57
59
|
assert result.result == EvaluateResult.DoesNotApply
|
|
58
60
|
assert result.context is None
|
|
59
61
|
|
|
60
|
-
def test_require_code_owner_reviews_none(self, requirement, query_data):
|
|
62
|
+
def test_require_code_owner_reviews_none(self, requirement, query_data, requirement_args):
|
|
61
63
|
"""Test when `require_code_owner_reviews` is None"""
|
|
62
64
|
query_data["branch_protection_data"]["required_pull_request_reviews"][
|
|
63
65
|
"require_code_owner_reviews"
|
|
64
66
|
] = None
|
|
65
|
-
requirement_args = {}
|
|
66
67
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
67
68
|
assert result.result == EvaluateResult.DoesNotApply
|
|
68
69
|
assert result.context is None
|
|
69
70
|
|
|
70
|
-
def test_IncorrectValue(self, requirement, query_data):
|
|
71
|
+
def test_IncorrectValue(self, requirement, query_data, requirement_args):
|
|
71
72
|
"""Test incorrect"""
|
|
72
73
|
query_data["branch_protection_data"]["required_pull_request_reviews"][
|
|
73
74
|
"require_code_owner_reviews"
|
|
74
75
|
] = False
|
|
75
|
-
requirement_args = {"enabled": True}
|
|
76
76
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
77
77
|
assert result.result == EvaluateResult.Error
|
|
78
78
|
assert (
|
|
@@ -80,11 +80,10 @@ class TestRequireCodeOwnerReview:
|
|
|
80
80
|
in result.context
|
|
81
81
|
)
|
|
82
82
|
|
|
83
|
-
def test_Successful(self, requirement, query_data):
|
|
83
|
+
def test_Successful(self, requirement, query_data, requirement_args):
|
|
84
84
|
"""Test successful"""
|
|
85
85
|
query_data["branch_protection_data"]["required_pull_request_reviews"][
|
|
86
86
|
"require_code_owner_reviews"
|
|
87
87
|
] = True
|
|
88
|
-
requirement_args = {"enabled": True}
|
|
89
88
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
90
89
|
assert result.result == EvaluateResult.Success
|
|
@@ -24,35 +24,36 @@ def requirement():
|
|
|
24
24
|
return RequireUpToDateBranches()
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
@pytest.fixture(name="requirement_args")
|
|
28
|
+
def requirement_args_fixture():
|
|
29
|
+
return {"disabled": True}
|
|
30
|
+
|
|
31
|
+
|
|
27
32
|
class TestRequireUpToDateBranches:
|
|
28
|
-
def test_required_status_checks_missing(self, requirement, query_data):
|
|
33
|
+
def test_required_status_checks_missing(self, requirement, query_data, requirement_args):
|
|
29
34
|
"""Test when `required_status_checks` is missing"""
|
|
30
35
|
query_data["branch_protection_data"] = {}
|
|
31
|
-
requirement_args = {}
|
|
32
36
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
33
37
|
assert result.result == EvaluateResult.DoesNotApply
|
|
34
38
|
assert result.context is None
|
|
35
39
|
|
|
36
|
-
def test_required_status_checks_none(self, requirement, query_data):
|
|
40
|
+
def test_required_status_checks_none(self, requirement, query_data, requirement_args):
|
|
37
41
|
"""Test when `required_status_checks` is None"""
|
|
38
42
|
query_data["branch_protection_data"] = {"required_status_checks": None}
|
|
39
|
-
requirement_args = {}
|
|
40
43
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
41
44
|
assert result.result == EvaluateResult.DoesNotApply
|
|
42
45
|
assert result.context is None
|
|
43
46
|
|
|
44
|
-
def test_strict_missing(self, requirement, query_data):
|
|
47
|
+
def test_strict_missing(self, requirement, query_data, requirement_args):
|
|
45
48
|
"""Test when `strict` is missing"""
|
|
46
49
|
query_data["branch_protection_data"]["required_status_checks"] = {}
|
|
47
|
-
requirement_args = {}
|
|
48
50
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
49
51
|
assert result.result == EvaluateResult.DoesNotApply
|
|
50
52
|
assert result.context is None
|
|
51
53
|
|
|
52
|
-
def test_strict_none(self, requirement, query_data):
|
|
54
|
+
def test_strict_none(self, requirement, query_data, requirement_args):
|
|
53
55
|
"""Test when `strict` is None"""
|
|
54
56
|
query_data["branch_protection_data"]["required_status_checks"] = {"strict": None}
|
|
55
|
-
requirement_args = {}
|
|
56
57
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
57
58
|
assert result.result == EvaluateResult.DoesNotApply
|
|
58
59
|
assert result.context is None
|
|
@@ -68,9 +69,8 @@ class TestRequireUpToDateBranches:
|
|
|
68
69
|
in result.context
|
|
69
70
|
)
|
|
70
71
|
|
|
71
|
-
def test_Successful(self, requirement, query_data):
|
|
72
|
+
def test_Successful(self, requirement, query_data, requirement_args):
|
|
72
73
|
"""Test successful"""
|
|
73
74
|
query_data["branch_protection_data"]["required_status_checks"]["strict"] = False
|
|
74
|
-
requirement_args = {"disabled": True}
|
|
75
75
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
76
76
|
assert result.result == EvaluateResult.Success
|
|
@@ -33,39 +33,43 @@ def requirement():
|
|
|
33
33
|
return DependabotSecurityUpdates()
|
|
34
34
|
|
|
35
35
|
|
|
36
|
+
@pytest.fixture(name="requirement_args")
|
|
37
|
+
def requirement_args_fixture():
|
|
38
|
+
return {"disabled": False}
|
|
39
|
+
|
|
40
|
+
|
|
36
41
|
class TestDependabotSecurityUpdates:
|
|
37
|
-
def test_security_and_analysis_missing(self, requirement, query_data):
|
|
42
|
+
def test_security_and_analysis_missing(self, requirement, query_data, requirement_args):
|
|
38
43
|
"""Test if `security_and_analysis` is missing"""
|
|
39
44
|
query_data["standard"] = {}
|
|
40
|
-
result = requirement.Evaluate(query_data, requirement_args
|
|
45
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
41
46
|
assert result.result == EvaluateResult.Warning
|
|
42
47
|
assert "Incomplete data was encountered" in result.context
|
|
43
48
|
|
|
44
|
-
def test_dependabot_security_updates_missing(self, requirement, query_data):
|
|
49
|
+
def test_dependabot_security_updates_missing(self, requirement, query_data, requirement_args):
|
|
45
50
|
"""Test if `dependabot_security_updates` is missing"""
|
|
46
51
|
query_data["standard"]["security_and_analysis"] = {}
|
|
47
|
-
result = requirement.Evaluate(query_data, requirement_args
|
|
52
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
48
53
|
assert result.result == EvaluateResult.Warning
|
|
49
54
|
assert "Incomplete data was encountered" in result.context
|
|
50
55
|
|
|
51
|
-
def test_status_missing(self, requirement, query_data):
|
|
56
|
+
def test_status_missing(self, requirement, query_data, requirement_args):
|
|
52
57
|
"""Test if `status` is missing"""
|
|
53
58
|
query_data["standard"]["security_and_analysis"]["dependabot_security_updates"] = {}
|
|
54
|
-
result = requirement.Evaluate(query_data, requirement_args
|
|
59
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
55
60
|
assert result.result == EvaluateResult.Warning
|
|
56
61
|
assert "Incomplete data was encountered" in result.context
|
|
57
62
|
|
|
58
|
-
def test_status_none(self, requirement, query_data):
|
|
63
|
+
def test_status_none(self, requirement, query_data, requirement_args):
|
|
59
64
|
"""Test if `status` is None"""
|
|
60
65
|
query_data["standard"]["security_and_analysis"]["dependabot_security_updates"]["status"] = None
|
|
61
|
-
result = requirement.Evaluate(query_data, requirement_args
|
|
66
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
62
67
|
assert result.result == EvaluateResult.Warning
|
|
63
68
|
assert "Incomplete data was encountered" in result.context
|
|
64
69
|
|
|
65
|
-
def test_Incorrect(self, requirement, query_data):
|
|
70
|
+
def test_Incorrect(self, requirement, query_data, requirement_args):
|
|
66
71
|
"""Result doesn't match expected value"""
|
|
67
72
|
query_data["standard"]["security_and_analysis"]["dependabot_security_updates"]["status"] = True
|
|
68
|
-
requirement_args = {"disabled": False}
|
|
69
73
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
70
74
|
assert result.result == EvaluateResult.Error
|
|
71
75
|
assert (
|
|
@@ -37,7 +37,7 @@ class TestLicense:
|
|
|
37
37
|
query_data["standard"] = {}
|
|
38
38
|
result = requirement.Evaluate(
|
|
39
39
|
query_data,
|
|
40
|
-
requirement_args={},
|
|
40
|
+
requirement_args={"value": requirement.default_value},
|
|
41
41
|
)
|
|
42
42
|
assert result.result == EvaluateResult.Warning
|
|
43
43
|
assert "Incomplete data was encountered" in result.context
|