RepoAuditor 0.2.61__tar.gz → 0.2.67__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.61 → repoauditor-0.2.67}/PKG-INFO +1 -1
- repoauditor-0.2.67/default_config.yaml +4 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Display.py +20 -9
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRulesetRequirementImpl.py +52 -15
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/Impl/ValueRequirementImpl.py +8 -11
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/RulesetQuery.py +3 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequirePullRequests.py +5 -5
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireSignedCommits.py +5 -5
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireStatusChecks.py +4 -4
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Description.py +2 -4
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/License.py +15 -11
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommitMessage.py +5 -5
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashMergeCommitMessage.py +5 -5
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/__init__.py +1 -1
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/ClassicValueRequirementImpl_UnitTest.py +2 -2
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/EnableRulesetRequirementImpl_UnitTest.py +45 -13
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/RulesetRequirements_UnitTest.py +19 -19
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/StandardQueryRequirements/Description_UnitTest.py +16 -10
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/StandardQueryRequirements/License_UnitTest.py +1 -1
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHub_EndToEndTest.py +68 -8
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/__snapshots__/CommunityStandards_EndToEndTest.ambr +168 -48
- repoauditor-0.2.61/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr → repoauditor-0.2.67/tests/Plugins/__snapshots__/GitHubEnterprise_EndToEndTest.ambr +455 -375
- repoauditor-0.2.67/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr +2391 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/__snapshots__/ExecuteModules_UnitTest.ambr +896 -256
- repoauditor-0.2.61/default_config.yaml +0 -4
- repoauditor-0.2.61/tests/Plugins/__snapshots__/GitHubEnterprise_EndToEndTest.ambr +0 -1366
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.copier-answers.yml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/CODEOWNERS +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/ISSUE_TEMPLATE/custom.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/actions/release_impl/action.yml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/pull_request_template.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/release_sources.yaml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/workflows/CICD.yml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/workflows/CICD_impl.yml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/workflows/EndToEnd.yml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.github/workflows/codeql.yml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.gitignore +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.pre-commit-config.yaml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/.python-version +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/CODE_OF_CONDUCT.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/CONTRIBUTING.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/DEVELOPMENT.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/GOVERNANCE.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/LICENSE +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/MAINTAINERS.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/README.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/SECURITY.md +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/minisign_key.pub +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/pyproject.toml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/AutoGitSemVer.yaml +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/CommandLineProcessor.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/EntryPoint.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/ExecuteModules.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Impl/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Module.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugin.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/CommunityStandardsQuery.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Impl/ExistsRequirementImpl.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Impl/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Module.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOfConduct.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOwners.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/Contributing.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/IssueTemplates.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/LicenseFile.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/PullRequestTemplates.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/ReadMe.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/SecurityPolicy.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandards/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/CommunityStandardsPlugin.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionQuery.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowDeletions.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowMainlineForcePushes.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DoNotAllowBypassSettings.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/EnsureStatusChecks.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicValueRequirementImpl.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovals.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireCodeOwnerReview.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireConversationResolution.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireLinearHistory.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequirePullRequests.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireSignedCommits.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireStatusChecksToPass.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireUpToDateBranches.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQuery.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/Protected.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRequirementImpl.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/Impl/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/Module.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/AutoMerge.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DefaultBranch.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DeleteHeadBranches.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DependabotSecurityUpdates.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardValueRequirementImpl.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommit.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Private.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/RebaseMergeCommit.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanning.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanningPushProtection.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashCommitMerge.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SuggestUpdatingPullRequestBranches.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportDiscussions.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportIssues.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportProjects.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportWikis.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/TemplateRepository.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/WebCommitSignoff.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHub/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHubBase/Module.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHubBase/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/GitHubPlugin.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Plugins/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Query.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/Requirement.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/src/RepoAuditor/py.typed +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/CommandLineProcessor_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/EntryPoint_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/ExecuteModules_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Module_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugin_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/CommunityStandards/CommunityStandardsQuery_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/CommunityStandards/ExistsRequirementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/CommunityStandards/GitHubCommunityStandards_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/CommunityStandards_EndToEndTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubEnterprise_EndToEndTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/ClassicBranchProtectionQuery_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/EnsureStatusChecks_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovals_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireCodeOwnerReview_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireUpToDateBranches_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/DefaultBranchQueryRequirements/Protected_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/DefaultBranchQuery_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/GitHubModule_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/GitHubSession_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/RulsesetQuery_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/StandardQueryRequirements/DependabotSecurityUpdates_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/StandardQueryRequirements/MergeCommitMessage_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/StandardQueryRequirements/Private_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/StandardQueryRequirements/SecretScanningPushProtection_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/StandardQueryRequirements/SecretScanning_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/StandardQueryRequirements/SquashMergeCommitMessage_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/StandardQuery_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/ValueRequrementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/fixtures.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/conftest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/utilities.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Query_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Requirement_UnitTest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/__init__.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/tests/conftest.py +0 -0
- {repoauditor-0.2.61 → repoauditor-0.2.67}/uv.lock +0 -0
|
@@ -37,16 +37,16 @@ def GetInternalPanelContent(
|
|
|
37
37
|
if module.description:
|
|
38
38
|
internal_content.append(f"{module.description.strip()}\n")
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
),
|
|
40
|
+
metrics_display = textwrap.dedent(
|
|
41
|
+
f"""\
|
|
42
|
+
[grey66]
|
|
43
|
+
Successful: {num_success} ({(num_success / num_requirements):.02%})
|
|
44
|
+
Warnings: {num_warning} ({(num_warning / num_requirements):.02%})
|
|
45
|
+
Errors: {num_error} ({(num_error / num_requirements):.02%})
|
|
46
|
+
Skipped: {num_does_not_apply} ({(num_does_not_apply / num_requirements):.02%})
|
|
47
|
+
""",
|
|
49
48
|
)
|
|
49
|
+
internal_content.append(metrics_display)
|
|
50
50
|
|
|
51
51
|
for result in results:
|
|
52
52
|
if not dm.is_verbose and result.result in [
|
|
@@ -106,6 +106,17 @@ def GetInternalPanelContent(
|
|
|
106
106
|
),
|
|
107
107
|
)
|
|
108
108
|
|
|
109
|
+
# Finally print statistics at the end in a panel if verbose
|
|
110
|
+
internal_content.append(
|
|
111
|
+
Panel(
|
|
112
|
+
metrics_display,
|
|
113
|
+
title="Metrics",
|
|
114
|
+
title_align="left",
|
|
115
|
+
border_style="grey66",
|
|
116
|
+
padding=(1, 1, 0, 1),
|
|
117
|
+
),
|
|
118
|
+
)
|
|
119
|
+
|
|
109
120
|
return internal_content
|
|
110
121
|
|
|
111
122
|
|
|
@@ -59,25 +59,62 @@ class EnableRulesetRequirementImpl(EnableRequirementImpl):
|
|
|
59
59
|
query_data: dict[str, Any],
|
|
60
60
|
requirement_args: dict[str, Any],
|
|
61
61
|
) -> Requirement.EvaluateImplResult:
|
|
62
|
+
expected_rule_enabled = self.enabled_by_default
|
|
63
|
+
|
|
62
64
|
if requirement_args[self.dynamic_arg_name]:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
expected_rule_enabled = not expected_rule_enabled
|
|
66
|
+
provide_rationale = False
|
|
67
|
+
else:
|
|
68
|
+
provide_rationale = True
|
|
69
|
+
|
|
70
|
+
query_data["__expected_value"] = "Enable" if expected_rule_enabled else "Disable"
|
|
71
|
+
|
|
72
|
+
# Get the rules for the specified branch
|
|
73
|
+
rules = query_data.get("rules", [])
|
|
74
|
+
|
|
75
|
+
# Check if the rule is checked in the ruleset
|
|
76
|
+
rule_enabled = False
|
|
77
|
+
ruleset = None
|
|
78
|
+
for rule in rules:
|
|
79
|
+
# If the rule is present, it is checked
|
|
80
|
+
if self.get_configuration_value_func(rule):
|
|
81
|
+
rule_enabled = True
|
|
82
|
+
# Get the ruleset associated with the rule
|
|
83
|
+
ruleset = rule["ruleset"]
|
|
84
|
+
break
|
|
85
|
+
|
|
86
|
+
# If rule is active and we want it enabled,
|
|
87
|
+
# or rule is inactive and we want it disabled,
|
|
88
|
+
# return success.
|
|
89
|
+
if rule_enabled == expected_rule_enabled:
|
|
90
|
+
context = (
|
|
91
|
+
f"{self.github_settings_value} is enabled in Ruleset '{ruleset['name']}'"
|
|
92
|
+
if expected_rule_enabled
|
|
93
|
+
else f"{self.github_settings_value} is disabled"
|
|
94
|
+
)
|
|
95
|
+
return self.EvaluateImplResult(
|
|
96
|
+
EvaluateResult.Success,
|
|
97
|
+
context,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
# When rule is active but we want it disabled
|
|
101
|
+
if rule_enabled:
|
|
102
|
+
assert expected_rule_enabled is False
|
|
74
103
|
|
|
75
104
|
return self.EvaluateImplResult(
|
|
76
105
|
EvaluateResult.Error,
|
|
77
|
-
f"
|
|
106
|
+
f"{self.github_settings_value} rule active in ruleset '{ruleset['name']}'. It should be set to {expected_rule_enabled}",
|
|
78
107
|
provide_resolution=True,
|
|
79
|
-
provide_rationale=
|
|
108
|
+
provide_rationale=provide_rationale,
|
|
80
109
|
)
|
|
81
110
|
|
|
82
|
-
#
|
|
83
|
-
|
|
111
|
+
# Rule is inactive but we want it on
|
|
112
|
+
assert rule_enabled is False
|
|
113
|
+
assert expected_rule_enabled is True
|
|
114
|
+
|
|
115
|
+
return self.EvaluateImplResult(
|
|
116
|
+
EvaluateResult.Error,
|
|
117
|
+
f"No active branch ruleset with {self.github_settings_value} found",
|
|
118
|
+
provide_resolution=True,
|
|
119
|
+
provide_rationale=provide_rationale,
|
|
120
|
+
)
|
|
@@ -28,14 +28,14 @@ class DoesNotApplyResult:
|
|
|
28
28
|
|
|
29
29
|
# ----------------------------------------------------------------------
|
|
30
30
|
class ValueRequirementImpl(Requirement):
|
|
31
|
-
"""Object that implements settings
|
|
31
|
+
"""Object that implements checking of metadata/settings are set to the specified value."""
|
|
32
32
|
|
|
33
33
|
# ----------------------------------------------------------------------
|
|
34
34
|
def __init__(
|
|
35
35
|
self,
|
|
36
36
|
name: str,
|
|
37
37
|
default_value: str,
|
|
38
|
-
|
|
38
|
+
github_value: Optional[str],
|
|
39
39
|
get_configuration_value_func: Callable[[dict[str, Any]], str | DoesNotApplyResult | None],
|
|
40
40
|
resolution: str,
|
|
41
41
|
rationale: str,
|
|
@@ -44,13 +44,10 @@ class ValueRequirementImpl(Requirement):
|
|
|
44
44
|
requires_explicit_include: bool = False,
|
|
45
45
|
missing_value_is_warning: bool = True,
|
|
46
46
|
) -> None:
|
|
47
|
-
if
|
|
48
|
-
github_settings_value = "the entity"
|
|
49
|
-
else:
|
|
50
|
-
github_settings_value = f"'{github_settings_value}'"
|
|
47
|
+
github_value = f"'{github_value}'" if github_value else "the entity"
|
|
51
48
|
|
|
52
49
|
if subject is None:
|
|
53
|
-
subject =
|
|
50
|
+
subject = github_value
|
|
54
51
|
|
|
55
52
|
super().__init__(
|
|
56
53
|
name,
|
|
@@ -61,7 +58,7 @@ class ValueRequirementImpl(Requirement):
|
|
|
61
58
|
requires_explicit_include=requires_explicit_include,
|
|
62
59
|
)
|
|
63
60
|
|
|
64
|
-
self.
|
|
61
|
+
self.github_value = github_value
|
|
65
62
|
self.default_value = default_value
|
|
66
63
|
self.get_configuration_value_func = get_configuration_value_func
|
|
67
64
|
self.missing_value_is_warning = missing_value_is_warning
|
|
@@ -75,7 +72,7 @@ class ValueRequirementImpl(Requirement):
|
|
|
75
72
|
str,
|
|
76
73
|
typer.Option(
|
|
77
74
|
self.default_value,
|
|
78
|
-
help=f"Ensures that {self.
|
|
75
|
+
help=f"Ensures that {self.github_value} is set to the provided value.",
|
|
79
76
|
),
|
|
80
77
|
),
|
|
81
78
|
}
|
|
@@ -103,7 +100,7 @@ class ValueRequirementImpl(Requirement):
|
|
|
103
100
|
|
|
104
101
|
return Requirement.EvaluateImplResult(
|
|
105
102
|
EvaluateResult.Error,
|
|
106
|
-
f"{self.
|
|
103
|
+
f"{self.github_value} cannot be set to '{expected_value}' because {result.reason}",
|
|
107
104
|
)
|
|
108
105
|
|
|
109
106
|
result = str(result)
|
|
@@ -113,7 +110,7 @@ class ValueRequirementImpl(Requirement):
|
|
|
113
110
|
|
|
114
111
|
return Requirement.EvaluateImplResult(
|
|
115
112
|
EvaluateResult.Error,
|
|
116
|
-
f"{self.
|
|
113
|
+
f"{self.github_value} must be set to '{expected_value}' (it is currently set to '{result}').",
|
|
117
114
|
provide_resolution=True,
|
|
118
115
|
provide_rationale=is_default_expected_value,
|
|
119
116
|
)
|
|
@@ -56,6 +56,9 @@ class RulesetQuery(Query):
|
|
|
56
56
|
|
|
57
57
|
branch = response["default_branch"]
|
|
58
58
|
|
|
59
|
+
# Record the branch name
|
|
60
|
+
module_data["branch"] = branch
|
|
61
|
+
|
|
59
62
|
# Fetch ruleset data for a specific branch.
|
|
60
63
|
# This only returns active rules on the branch
|
|
61
64
|
rules_response = module_data["session"].get(f"rules/branches/{branch}")
|
|
@@ -14,12 +14,12 @@ class RequirePullRequests(EnableRulesetRequirementImpl):
|
|
|
14
14
|
|
|
15
15
|
def __init__(self) -> None:
|
|
16
16
|
super().__init__(
|
|
17
|
-
name="
|
|
18
|
-
enabled_by_default=
|
|
19
|
-
dynamic_arg_name="
|
|
17
|
+
name="RequirePullRequestsRule",
|
|
18
|
+
enabled_by_default=True,
|
|
19
|
+
dynamic_arg_name="disabled",
|
|
20
20
|
github_ruleset_type="pull_request",
|
|
21
|
-
github_ruleset_value="
|
|
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="{__expected_value} pull request rule in repository rulesets",
|
|
24
24
|
rationale="Pull request reviews help maintain code quality and collaboration",
|
|
25
25
|
)
|
|
@@ -10,15 +10,15 @@ from RepoAuditor.Plugins.GitHub.Impl.EnableRulesetRequirementImpl import EnableR
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class RequireSignedCommits(EnableRulesetRequirementImpl):
|
|
13
|
-
"""Require signed commits."""
|
|
13
|
+
"""Check that the "Require signed commits" rule is disabled."""
|
|
14
14
|
|
|
15
15
|
def __init__(self) -> None:
|
|
16
16
|
super().__init__(
|
|
17
|
-
name="
|
|
18
|
-
enabled_by_default=
|
|
19
|
-
dynamic_arg_name="
|
|
17
|
+
name="RequireSignedCommitsRule",
|
|
18
|
+
enabled_by_default=True,
|
|
19
|
+
dynamic_arg_name="disabled",
|
|
20
20
|
github_ruleset_type="required_signatures",
|
|
21
|
-
github_ruleset_value="
|
|
21
|
+
github_ruleset_value="Require signed commits",
|
|
22
22
|
get_configuration_value_func=lambda rule: rule.get("type", "") == "required_signatures",
|
|
23
23
|
resolution="Enable commit signing requirement in repository rulesets",
|
|
24
24
|
rationale="Signed commits ensure commit authenticity",
|
|
@@ -14,11 +14,11 @@ class RequireStatusChecks(EnableRulesetRequirementImpl):
|
|
|
14
14
|
|
|
15
15
|
def __init__(self) -> None:
|
|
16
16
|
super().__init__(
|
|
17
|
-
name="
|
|
18
|
-
enabled_by_default=
|
|
19
|
-
dynamic_arg_name="
|
|
17
|
+
name="RequireStatusChecksRule",
|
|
18
|
+
enabled_by_default=True,
|
|
19
|
+
dynamic_arg_name="disabled",
|
|
20
20
|
github_ruleset_type="required_status_checks",
|
|
21
|
-
github_ruleset_value="
|
|
21
|
+
github_ruleset_value="Require status checks to pass",
|
|
22
22
|
get_configuration_value_func=lambda rule: rule.get("type", "") == "required_status_checks",
|
|
23
23
|
resolution="Configure required status checks in repository rulesets",
|
|
24
24
|
rationale="Status checks ensure code quality and compatibility",
|
|
@@ -13,7 +13,6 @@ import typer
|
|
|
13
13
|
from dbrownell_Common.TyperEx import TypeDefinitionItemType # type: ignore[import-untyped]
|
|
14
14
|
from dbrownell_Common.Types import override # type: ignore[import-untyped]
|
|
15
15
|
|
|
16
|
-
from RepoAuditor.Plugins.GitHub.Impl.Common import CreateIncompleteDataResult
|
|
17
16
|
from RepoAuditor.Requirement import EvaluateResult, ExecutionStyle, Requirement
|
|
18
17
|
|
|
19
18
|
|
|
@@ -73,10 +72,9 @@ class Description(Requirement):
|
|
|
73
72
|
) -> Requirement.EvaluateImplResult:
|
|
74
73
|
standard_data = query_data["standard"]
|
|
75
74
|
|
|
75
|
+
# If result is None, it means the description is empty.
|
|
76
|
+
# It is not a permissions issue, since "Read Metadata" is a mandatory permission for all PATs
|
|
76
77
|
result = standard_data.get("description", None)
|
|
77
|
-
if result is None:
|
|
78
|
-
return CreateIncompleteDataResult()
|
|
79
|
-
|
|
80
78
|
expect_description = not requirement_args["allow-empty"]
|
|
81
79
|
|
|
82
80
|
if expect_description and not result:
|
|
@@ -9,25 +9,29 @@
|
|
|
9
9
|
import textwrap
|
|
10
10
|
from typing import Any, Optional
|
|
11
11
|
|
|
12
|
-
from RepoAuditor.Plugins.GitHub.
|
|
13
|
-
StandardValueRequirementImpl,
|
|
14
|
-
)
|
|
12
|
+
from RepoAuditor.Plugins.GitHub.Impl.ValueRequirementImpl import ValueRequirementImpl
|
|
15
13
|
|
|
16
14
|
|
|
17
15
|
# ----------------------------------------------------------------------
|
|
18
|
-
class License(
|
|
16
|
+
class License(ValueRequirementImpl):
|
|
19
17
|
"""Default License as MIT Requirement."""
|
|
20
18
|
|
|
21
19
|
# ----------------------------------------------------------------------
|
|
22
20
|
def __init__(self) -> None:
|
|
23
21
|
super().__init__(
|
|
24
|
-
"License",
|
|
25
|
-
"MIT License",
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
name="License",
|
|
23
|
+
default_value="MIT License",
|
|
24
|
+
github_value="License",
|
|
25
|
+
get_configuration_value_func=_GetValue,
|
|
26
|
+
resolution=textwrap.dedent(
|
|
27
|
+
"""\
|
|
28
|
+
1) Create a LICENSE/LICENSE.md file in your main branch at the root of your repository.
|
|
29
|
+
2) Add the appropriate licensing information in the above file.
|
|
30
|
+
|
|
31
|
+
For detailed information about open source licenses, you can visit: https://choosealicense.com/
|
|
32
|
+
"""
|
|
33
|
+
),
|
|
34
|
+
rationale=textwrap.dedent(
|
|
31
35
|
"""\
|
|
32
36
|
The default behavior is to use the MIT License.
|
|
33
37
|
|
|
@@ -30,18 +30,18 @@ class MergeCommitMessage(StandardValueRequirementImpl):
|
|
|
30
30
|
_GetValue,
|
|
31
31
|
textwrap.dedent(
|
|
32
32
|
"""\
|
|
33
|
-
Available values:
|
|
33
|
+
Available values on GitHub:
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Default message [PR_TITLE]
|
|
36
36
|
Pull Request number and head branch on the first line; pull request title on the third line
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Default to pull request title [BLANK]
|
|
39
39
|
Pull Request title and number on the first line.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Default to pull request title and description [PR_BODY]
|
|
42
42
|
Pull Request title and number on the first line; pull request description starting on the third line.
|
|
43
43
|
|
|
44
|
-
The default setting is BLANK.
|
|
44
|
+
The default setting is "Default to pull request title [BLANK]".
|
|
45
45
|
|
|
46
46
|
Reasons for this Default
|
|
47
47
|
------------------------
|
|
@@ -30,20 +30,20 @@ class SquashMergeCommitMessage(StandardValueRequirementImpl):
|
|
|
30
30
|
_GetValue,
|
|
31
31
|
textwrap.dedent(
|
|
32
32
|
"""\
|
|
33
|
-
Available values:
|
|
33
|
+
Available values on GitHub:
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Default to pull request title [BLANK]
|
|
36
36
|
Pull Request title and number on the first line.
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Default to pull request title and commit details [COMMIT_MESSAGES]
|
|
39
39
|
Commit title and...
|
|
40
40
|
[Single Commit] ...commit message
|
|
41
41
|
[Multiple Commits] ...pull request title and number and list of commits
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Default to pull request title and description [PR_BODY]
|
|
44
44
|
Pull Request title and number on the first line; commit description starting on the third line.
|
|
45
45
|
|
|
46
|
-
The default setting is COMMIT_MESSAGES.
|
|
46
|
+
The default setting is "Default to pull request title and commit details [COMMIT_MESSAGES]".
|
|
47
47
|
|
|
48
48
|
Reasons for this Default
|
|
49
49
|
------------------------
|
|
@@ -22,7 +22,7 @@ class TestClassicValueRequirementImpl:
|
|
|
22
22
|
get_configuration_value_func=lambda _: "yes",
|
|
23
23
|
rationale="For testing",
|
|
24
24
|
)
|
|
25
|
-
assert requirement.
|
|
25
|
+
assert requirement.github_value == "'No Settings Section'"
|
|
26
26
|
|
|
27
27
|
def test_NoSettingsValue(self):
|
|
28
28
|
"""Test for when no github_settings_value is provided."""
|
|
@@ -34,4 +34,4 @@ class TestClassicValueRequirementImpl:
|
|
|
34
34
|
get_configuration_value_func=lambda _: "yes",
|
|
35
35
|
rationale="For testing",
|
|
36
36
|
)
|
|
37
|
-
assert requirement.
|
|
37
|
+
assert requirement.github_value == "the entity"
|
|
@@ -18,7 +18,7 @@ class TestEnableRulesetRequirementImpl:
|
|
|
18
18
|
requirement = EnableRulesetRequirementImpl(
|
|
19
19
|
name="Test Name",
|
|
20
20
|
enabled_by_default=False,
|
|
21
|
-
dynamic_arg_name="
|
|
21
|
+
dynamic_arg_name="enabled",
|
|
22
22
|
github_ruleset_type="Test Ruleset",
|
|
23
23
|
github_ruleset_value="test_ruleset",
|
|
24
24
|
get_configuration_value_func=lambda _: True,
|
|
@@ -28,15 +28,15 @@ class TestEnableRulesetRequirementImpl:
|
|
|
28
28
|
|
|
29
29
|
assert requirement.name == "Test Name"
|
|
30
30
|
assert requirement.enabled_by_default is False
|
|
31
|
-
assert requirement.dynamic_arg_name == "
|
|
31
|
+
assert requirement.dynamic_arg_name == "enabled"
|
|
32
32
|
assert requirement.github_ruleset_type == "Test Ruleset"
|
|
33
33
|
|
|
34
|
-
def
|
|
35
|
-
"""Test the _EvaluateImpl method when
|
|
34
|
+
def test_Evaluate_Disabled(self):
|
|
35
|
+
"""Test the _EvaluateImpl method when dynamic arg is set to `enabled: False`."""
|
|
36
36
|
requirement = EnableRulesetRequirementImpl(
|
|
37
37
|
name="Test Name",
|
|
38
38
|
enabled_by_default=False,
|
|
39
|
-
dynamic_arg_name="
|
|
39
|
+
dynamic_arg_name="enabled",
|
|
40
40
|
github_ruleset_type="Test Ruleset",
|
|
41
41
|
github_ruleset_value="test_ruleset",
|
|
42
42
|
get_configuration_value_func=lambda _: True,
|
|
@@ -44,16 +44,48 @@ class TestEnableRulesetRequirementImpl:
|
|
|
44
44
|
rationale="Test rationale",
|
|
45
45
|
)
|
|
46
46
|
query_data = {}
|
|
47
|
-
requirement_args = {"
|
|
47
|
+
requirement_args = {"enabled": False}
|
|
48
48
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
49
|
-
|
|
49
|
+
# No rule and should be disabled, hence result is success
|
|
50
|
+
assert result.result == EvaluateResult.Success
|
|
51
|
+
|
|
52
|
+
def test_Evaluate_Disabled_Alternative(self):
|
|
53
|
+
"""Test the _EvaluateImpl method when dynamic arg is
|
|
54
|
+
set to `disabled: True` but rule is active.
|
|
55
|
+
"""
|
|
56
|
+
requirement = EnableRulesetRequirementImpl(
|
|
57
|
+
name="True By Default",
|
|
58
|
+
enabled_by_default=True,
|
|
59
|
+
dynamic_arg_name="disabled",
|
|
60
|
+
github_ruleset_type="Test Ruleset",
|
|
61
|
+
github_ruleset_value="test_ruleset",
|
|
62
|
+
get_configuration_value_func=lambda rule: rule.get("type", "") == "valid_rule",
|
|
63
|
+
resolution="Test Resolution",
|
|
64
|
+
rationale="Test rationale",
|
|
65
|
+
)
|
|
66
|
+
query_data = {
|
|
67
|
+
"rules": [
|
|
68
|
+
{
|
|
69
|
+
"type": "valid_rule",
|
|
70
|
+
"ruleset": {
|
|
71
|
+
"name": "Valid",
|
|
72
|
+
"id": "01",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
requirement_args = {"disabled": True}
|
|
78
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
79
|
+
# No rule and should be disabled, hence result is success
|
|
80
|
+
assert result.result == EvaluateResult.Error
|
|
81
|
+
assert "It should be set to False" in result.context
|
|
50
82
|
|
|
51
83
|
def test_Evaluate_InvalidRule(self):
|
|
52
|
-
"""Test the _EvaluateImpl method when
|
|
84
|
+
"""Test the _EvaluateImpl method when dynamic arg is set to `enabled: True` and the rule found is invalid."""
|
|
53
85
|
requirement = EnableRulesetRequirementImpl(
|
|
54
86
|
name="Test Name",
|
|
55
87
|
enabled_by_default=False,
|
|
56
|
-
dynamic_arg_name="
|
|
88
|
+
dynamic_arg_name="enabled",
|
|
57
89
|
github_ruleset_type="Test Ruleset",
|
|
58
90
|
github_ruleset_value="test_ruleset",
|
|
59
91
|
get_configuration_value_func=lambda rule: rule.get("type", "") == "valid rule",
|
|
@@ -71,16 +103,16 @@ class TestEnableRulesetRequirementImpl:
|
|
|
71
103
|
},
|
|
72
104
|
]
|
|
73
105
|
}
|
|
74
|
-
requirement_args = {"
|
|
106
|
+
requirement_args = {"enabled": True}
|
|
75
107
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
76
108
|
assert result.result == EvaluateResult.Error
|
|
77
109
|
|
|
78
110
|
def test_Evaluate_ValidRule(self):
|
|
79
|
-
"""Test the _EvaluateImpl method when
|
|
111
|
+
"""Test the _EvaluateImpl method when dynamic arg is set to `enabled: True` and a valid rule is found."""
|
|
80
112
|
requirement = EnableRulesetRequirementImpl(
|
|
81
113
|
name="Test Name",
|
|
82
114
|
enabled_by_default=False,
|
|
83
|
-
dynamic_arg_name="
|
|
115
|
+
dynamic_arg_name="enabled",
|
|
84
116
|
github_ruleset_type="Test Ruleset",
|
|
85
117
|
github_ruleset_value="test_ruleset",
|
|
86
118
|
get_configuration_value_func=lambda rule: rule.get("type", "") == "valid_rule",
|
|
@@ -98,7 +130,7 @@ class TestEnableRulesetRequirementImpl:
|
|
|
98
130
|
}
|
|
99
131
|
]
|
|
100
132
|
}
|
|
101
|
-
requirement_args = {"
|
|
133
|
+
requirement_args = {"enabled": True}
|
|
102
134
|
result = requirement.Evaluate(query_data, requirement_args)
|
|
103
135
|
|
|
104
136
|
assert result.result == EvaluateResult.Success
|
{repoauditor-0.2.61 → repoauditor-0.2.67}/tests/Plugins/GitHubModule/RulesetRequirements_UnitTest.py
RENAMED
|
@@ -43,9 +43,9 @@ class TestRequirePullRequests:
|
|
|
43
43
|
)
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
|
-
result = requirement.Evaluate(context, {"
|
|
46
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
47
47
|
assert result.result == EvaluateResult.Success
|
|
48
|
-
assert "
|
|
48
|
+
assert f"{requirement.github_settings_value} is enabled" in result.context
|
|
49
49
|
|
|
50
50
|
def test_Disabled(self):
|
|
51
51
|
"""Test if the required rule is disabled on the main branch
|
|
@@ -57,14 +57,14 @@ class TestRequirePullRequests:
|
|
|
57
57
|
create_rule(
|
|
58
58
|
name="Inactive PR Rules",
|
|
59
59
|
# Wrong rule type
|
|
60
|
-
rule_type="",
|
|
60
|
+
rule_type="push_request",
|
|
61
61
|
ruleset_name="Ruleset Main",
|
|
62
62
|
parameters={},
|
|
63
63
|
)
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
|
-
result = requirement.Evaluate(context, {"
|
|
67
|
-
assert result.result == EvaluateResult.
|
|
66
|
+
result = requirement.Evaluate(context, {"disabled": True})
|
|
67
|
+
assert result.result == EvaluateResult.Success
|
|
68
68
|
|
|
69
69
|
def test_WrongTarget(self):
|
|
70
70
|
"""Test if rules are applied on the wrong branch."""
|
|
@@ -75,16 +75,16 @@ class TestRequirePullRequests:
|
|
|
75
75
|
# Hence the rules here will be empty.
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
|
-
result = requirement.Evaluate(context, {"
|
|
78
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
79
79
|
assert result.result == EvaluateResult.Error
|
|
80
80
|
|
|
81
81
|
def test_NoRulesets(self):
|
|
82
82
|
"""Test if no rules are applied on the main branch."""
|
|
83
83
|
requirement = RequirePullRequests()
|
|
84
84
|
context = {"rules": []}
|
|
85
|
-
result = requirement.Evaluate(context, {"
|
|
85
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
86
86
|
assert result.result == EvaluateResult.Error
|
|
87
|
-
assert "No active branch ruleset
|
|
87
|
+
assert f"No active branch ruleset with {requirement.github_settings_value} found" in result.context
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
# ----------------------------------------------------------------------
|
|
@@ -104,9 +104,9 @@ class TestRequireSignedCommits:
|
|
|
104
104
|
)
|
|
105
105
|
]
|
|
106
106
|
}
|
|
107
|
-
result = requirement.Evaluate(context, {"
|
|
107
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
108
108
|
assert result.result == EvaluateResult.Success
|
|
109
|
-
assert "
|
|
109
|
+
assert f"{requirement.github_settings_value} is enabled" in result.context
|
|
110
110
|
|
|
111
111
|
def test_Disabled(self):
|
|
112
112
|
"""Test if the required rule is disabled on the main branch
|
|
@@ -124,7 +124,7 @@ class TestRequireSignedCommits:
|
|
|
124
124
|
)
|
|
125
125
|
]
|
|
126
126
|
}
|
|
127
|
-
result = requirement.Evaluate(context, {"
|
|
127
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
128
128
|
assert result.result == EvaluateResult.Error
|
|
129
129
|
|
|
130
130
|
def test_PartialConfig(self):
|
|
@@ -135,16 +135,16 @@ class TestRequireSignedCommits:
|
|
|
135
135
|
# GitHub only returns rules that are actively enforced
|
|
136
136
|
]
|
|
137
137
|
}
|
|
138
|
-
result = requirement.Evaluate(context, {"
|
|
138
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
139
139
|
assert result.result == EvaluateResult.Error
|
|
140
140
|
|
|
141
141
|
def test_NoRulesets(self):
|
|
142
142
|
"""Test if no rules are applied on the main branch."""
|
|
143
143
|
requirement = RequireSignedCommits()
|
|
144
144
|
context = {"rules": []}
|
|
145
|
-
result = requirement.Evaluate(context, {"
|
|
145
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
146
146
|
assert result.result == EvaluateResult.Error
|
|
147
|
-
assert "No active branch ruleset
|
|
147
|
+
assert f"No active branch ruleset with {requirement.github_settings_value} found" in result.context
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
# ----------------------------------------------------------------------
|
|
@@ -164,9 +164,9 @@ class TestRequireStatusChecks:
|
|
|
164
164
|
)
|
|
165
165
|
]
|
|
166
166
|
}
|
|
167
|
-
result = requirement.Evaluate(context, {"
|
|
167
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
168
168
|
assert result.result == EvaluateResult.Success
|
|
169
|
-
assert "
|
|
169
|
+
assert f"{requirement.github_settings_value} is enabled" in result.context
|
|
170
170
|
|
|
171
171
|
def test_EmptyChecks(self):
|
|
172
172
|
"""Test for Status Check rules which don't have an associated CI check."""
|
|
@@ -178,13 +178,13 @@ class TestRequireStatusChecks:
|
|
|
178
178
|
# Hence empty.
|
|
179
179
|
]
|
|
180
180
|
}
|
|
181
|
-
result = requirement.Evaluate(context, {"
|
|
181
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
182
182
|
assert result.result == EvaluateResult.Error
|
|
183
183
|
|
|
184
184
|
def test_NoRulesets(self):
|
|
185
185
|
"""Test if no rules are applied on the main branch."""
|
|
186
186
|
requirement = RequireStatusChecks()
|
|
187
187
|
context = {"rules": []}
|
|
188
|
-
result = requirement.Evaluate(context, {"
|
|
188
|
+
result = requirement.Evaluate(context, {"disabled": False})
|
|
189
189
|
assert result.result == EvaluateResult.Error
|
|
190
|
-
assert "No active branch ruleset
|
|
190
|
+
assert f"No active branch ruleset with {requirement.github_settings_value} found" in result.context
|