RepoAuditor 0.2.21__tar.gz → 0.2.22__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. {repoauditor-0.2.21 → repoauditor-0.2.22}/PKG-INFO +1 -1
  2. {repoauditor-0.2.21 → repoauditor-0.2.22}/pyproject.toml +1 -1
  3. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionQuery.py +54 -51
  4. repoauditor-0.2.22/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +248 -0
  5. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/__init__.py +1 -1
  6. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/Plugins/GitHub_EndToEndTest.py +2 -31
  7. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/Plugins/utilities.py +36 -2
  8. repoauditor-0.2.21/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +0 -245
  9. {repoauditor-0.2.21 → repoauditor-0.2.22}/.copier-answers.yml +0 -0
  10. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/CODEOWNERS +0 -0
  11. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  12. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  13. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/ISSUE_TEMPLATE/custom.md +0 -0
  14. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  15. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/actions/release_impl/action.yml +0 -0
  16. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/pull_request_template.md +0 -0
  17. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/release_sources.yaml +0 -0
  18. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/workflows/CICD.yml +0 -0
  19. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/workflows/CICD_impl.yml +0 -0
  20. {repoauditor-0.2.21 → repoauditor-0.2.22}/.github/workflows/codeql.yml +0 -0
  21. {repoauditor-0.2.21 → repoauditor-0.2.22}/.gitignore +0 -0
  22. {repoauditor-0.2.21 → repoauditor-0.2.22}/.pre-commit-config.yaml +0 -0
  23. {repoauditor-0.2.21 → repoauditor-0.2.22}/.python-version +0 -0
  24. {repoauditor-0.2.21 → repoauditor-0.2.22}/CODE_OF_CONDUCT.md +0 -0
  25. {repoauditor-0.2.21 → repoauditor-0.2.22}/CONTRIBUTING.md +0 -0
  26. {repoauditor-0.2.21 → repoauditor-0.2.22}/DEVELOPMENT.md +0 -0
  27. {repoauditor-0.2.21 → repoauditor-0.2.22}/GOVERNANCE.md +0 -0
  28. {repoauditor-0.2.21 → repoauditor-0.2.22}/LICENSE +0 -0
  29. {repoauditor-0.2.21 → repoauditor-0.2.22}/MAINTAINERS.md +0 -0
  30. {repoauditor-0.2.21 → repoauditor-0.2.22}/README.md +0 -0
  31. {repoauditor-0.2.21 → repoauditor-0.2.22}/SECURITY.md +0 -0
  32. {repoauditor-0.2.21 → repoauditor-0.2.22}/minisign_key.pub +0 -0
  33. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/AutoGitSemVer.yaml +0 -0
  34. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/CommandLineProcessor.py +0 -0
  35. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/EntryPoint.py +0 -0
  36. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/ExecuteModules.py +0 -0
  37. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py +0 -0
  38. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Impl/__init__.py +0 -0
  39. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Module.py +0 -0
  40. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugin.py +0 -0
  41. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowDeletions.py +0 -0
  42. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowForcePushes.py +0 -0
  43. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals.py +0 -0
  44. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DoNotAllowBypassSettings.py +0 -0
  45. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/EnsureStatusChecks.py +0 -0
  46. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicEnableRequirementImpl.py +0 -0
  47. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicValueRequirementImpl.py +0 -0
  48. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/__init__.py +0 -0
  49. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush.py +0 -0
  50. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovals.py +0 -0
  51. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireCodeOwnerReview.py +0 -0
  52. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireConversationResolution.py +0 -0
  53. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireLinearHistory.py +0 -0
  54. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequirePullRequests.py +0 -0
  55. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireSignedCommits.py +0 -0
  56. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireStatusChecksToPass.py +0 -0
  57. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireUpToDateBranches.py +0 -0
  58. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/__init__.py +0 -0
  59. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQuery.py +0 -0
  60. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQueryRequirements/Protected.py +0 -0
  61. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQueryRequirements/__init__.py +0 -0
  62. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +0 -0
  63. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRequirementImpl.py +0 -0
  64. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/Impl/ValueRequirementImpl.py +0 -0
  65. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/Impl/__init__.py +0 -0
  66. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/Module.py +0 -0
  67. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/AutoMerge.py +0 -0
  68. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DefaultBranch.py +0 -0
  69. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DeleteHeadBranches.py +0 -0
  70. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DependabotSecurityUpdates.py +0 -0
  71. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Description.py +0 -0
  72. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/StandardEnableRequirementImpl.py +0 -0
  73. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/StandardValueRequirementImpl.py +0 -0
  74. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/__init__.py +0 -0
  75. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/License.py +0 -0
  76. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/MergeCommit.py +0 -0
  77. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/MergeCommitMessage.py +0 -0
  78. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Private.py +0 -0
  79. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/RebaseMergeCommit.py +0 -0
  80. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SecretScanning.py +0 -0
  81. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SecretScanningPushProtection.py +0 -0
  82. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SquashCommitMerge.py +0 -0
  83. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SquashMergeCommitMessage.py +0 -0
  84. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SuggestUpdatingPullRequestBranches.py +0 -0
  85. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportDiscussions.py +0 -0
  86. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportIssues.py +0 -0
  87. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportProjects.py +0 -0
  88. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportWikis.py +0 -0
  89. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/TemplateRepository.py +0 -0
  90. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/WebCommitSignoff.py +0 -0
  91. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/__init__.py +0 -0
  92. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHub/__init__.py +0 -0
  93. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHubBase/Module.py +0 -0
  94. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHubBase/__init__.py +0 -0
  95. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHubCustomization/CustomizationQuery.py +0 -0
  96. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHubCustomization/Module.py +0 -0
  97. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHubCustomization/__init__.py +0 -0
  98. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHubCustomizationPlugin.py +0 -0
  99. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/GitHubPlugin.py +0 -0
  100. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Plugins/__init__.py +0 -0
  101. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Query.py +0 -0
  102. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/Requirement.py +0 -0
  103. {repoauditor-0.2.21 → repoauditor-0.2.22}/src/RepoAuditor/py.typed +0 -0
  104. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/CommandLineProcessor_UnitTest.py +0 -0
  105. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/EntryPoint_UnitTest.py +0 -0
  106. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/ExecuteModules_UnitTest.py +0 -0
  107. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/Module_UnitTest.py +0 -0
  108. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/Plugin_UnitTest.py +0 -0
  109. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/Plugins/GitHubCustomization_UnitTest.py +0 -0
  110. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/Plugins/GitHubModule_UnitTest.py +0 -0
  111. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr +0 -0
  112. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/Query_UnitTest.py +0 -0
  113. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/Requirement_UnitTest.py +0 -0
  114. {repoauditor-0.2.21 → repoauditor-0.2.22}/tests/__snapshots__/ExecuteModules_UnitTest.ambr +0 -0
  115. {repoauditor-0.2.21 → repoauditor-0.2.22}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RepoAuditor
3
- Version: 0.2.21
3
+ Version: 0.2.22
4
4
  Summary: Add your description here
5
5
  Project-URL: Homepage, https://github.com/gt-sse-center/RepoAuditor
6
6
  Project-URL: Documentation, https://github.com/gt-sse-center/RepoAuditor
@@ -76,7 +76,7 @@ exclude = ["tests/**"]
76
76
  # ...however, we current experience failures in the rulesets commented out below.
77
77
  select = [
78
78
  "AIR",
79
- #"ERA", # 168
79
+ "ERA",
80
80
  "FAST",
81
81
  "YTT",
82
82
  "ANN",
@@ -4,7 +4,60 @@
4
4
  # | Distributed under the MIT License.
5
5
  # |
6
6
  # -------------------------------------------------------------------------------
7
- """Contains the ClassicBranchProtection object."""
7
+ """Contains the ClassicBranchProtection object.
8
+
9
+ The API request/response has the following schema:
10
+
11
+ REQUEST : https://api.github.com/repos/<username>/<repo>/branches/<branch>/protection
12
+ RESPONSE:
13
+ {
14
+ "url": <not used>,
15
+ "required_status_checks": { /* RequireStatusChecksToPass */
16
+ "url": <not used>,
17
+ "strict": RequireUpToDateBranches,
18
+ "contexts": <not used>,
19
+ "contexts_url": <not used>,
20
+ "checks": EnsureStatusChecks
21
+ },
22
+ "required_pull_request_reviews": { /* RequirePullRequests */
23
+ "url": <not used>,
24
+ "dismiss_stale_reviews": DismissStalePullRequestApprovals,
25
+ "require_code_owner_reviews": RequireCodeOwnerReview,
26
+ "require_last_push_approval": RequireApprovalMostRecentPush,
27
+ "required_approving_review_count": RequireApprovals,
28
+ "bypass_pull_request_allowances": <not used>,
29
+ },
30
+ "required_signatures": {
31
+ "url": <not used>,
32
+ "enabled": RequireSignedCommits
33
+ },
34
+ "enforce_admins": {
35
+ "url": <not used>,
36
+ "enabled": DoNotAllowBypassSettings
37
+ },
38
+ "required_linear_history": {
39
+ "enabled": RequireLinearHistory
40
+ },
41
+ "allow_force_pushes": {
42
+ "enabled": AllowForcePushes
43
+ },
44
+ "allow_deletions": {
45
+ "enabled": AllowDeletions
46
+ },
47
+ "block_creations": {
48
+ "enabled": <not used>
49
+ },
50
+ "required_conversation_resolution": {
51
+ "enabled": RequireConversationResolution
52
+ },
53
+ "lock_branch": {
54
+ "enabled": <not used>
55
+ },
56
+ "allow_fork_syncing": {
57
+ "enabled": <not used>
58
+ }
59
+ }
60
+ """
8
61
 
9
62
  from typing import Any, Optional
10
63
 
@@ -33,56 +86,6 @@ from .ClassicBranchProtectionRequirements.RequireSignedCommits import RequireSig
33
86
  from .ClassicBranchProtectionRequirements.RequireStatusChecksToPass import RequireStatusChecksToPass
34
87
  from .ClassicBranchProtectionRequirements.RequireUpToDateBranches import RequireUpToDateBranches
35
88
 
36
- # REQUEST : https://api.github.com/repos/<username>/<repo>/branches/<branch>/protection
37
- # RESPONSE:
38
- # {
39
- # "url": <not used>,
40
- # "required_status_checks": { /* RequireStatusChecksToPass */
41
- # "url": <not used>,
42
- # "strict": RequireUpToDateBranches,
43
- # "contexts": <not used>,
44
- # "contexts_url": <not used>,
45
- # "checks": EnsureStatusChecks
46
- # },
47
- # "required_pull_request_reviews": { /* RequirePullRequests */
48
- # "url": <not used>,
49
- # "dismiss_stale_reviews": DismissStalePullRequestApprovals,
50
- # "require_code_owner_reviews": RequireCodeOwnerReview,
51
- # "require_last_push_approval": RequireApprovalMostRecentPush,
52
- # "required_approving_review_count": RequireApprovals,
53
- # "bypass_pull_request_allowances": <not used>,
54
- # },
55
- # "required_signatures": {
56
- # "url": <not used>,
57
- # "enabled": RequireSignedCommits
58
- # },
59
- # "enforce_admins": {
60
- # "url": <not used>,
61
- # "enabled": DoNotAllowBypassSettings
62
- # },
63
- # "required_linear_history": {
64
- # "enabled": RequireLinearHistory
65
- # },
66
- # "allow_force_pushes": {
67
- # "enabled": AllowForcePushes
68
- # },
69
- # "allow_deletions": {
70
- # "enabled": AllowDeletions
71
- # },
72
- # "block_creations": {
73
- # "enabled": <not used>
74
- # },
75
- # "required_conversation_resolution": {
76
- # "enabled": RequireConversationResolution
77
- # },
78
- # "lock_branch": {
79
- # "enabled": <not used>
80
- # },
81
- # "allow_fork_syncing": {
82
- # "enabled": <not used>
83
- # }
84
- # }
85
-
86
89
 
87
90
  # ----------------------------------------------------------------------
88
91
  class ClassicBranchProtectionQuery(Query):
@@ -0,0 +1,248 @@
1
+ # -------------------------------------------------------------------------------
2
+ # |
3
+ # | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
4
+ # | Distributed under the MIT License.
5
+ # |
6
+ # -------------------------------------------------------------------------------
7
+ """Contains the StandardQuery object.
8
+
9
+ The API request/response has the following schema:
10
+
11
+ REQUEST: https://api.github.com/repos/<username>/<repo>
12
+ RESPONSE:
13
+ {
14
+ "id": <not used>,
15
+ "node_id": <not used>,
16
+ "name": <not used>",
17
+ "full_name": <not used>,
18
+ "private": Private,
19
+ "owner": {
20
+ "login": <not used>,
21
+ "id": <not used>,
22
+ "node_id": <not used>,
23
+ "avatar_url": <not used>,
24
+ "gravatar_id": <not used>,
25
+ "url": <not used>,
26
+ "html_url": <not used>,
27
+ "followers_url": <not used>,
28
+ "following_url": <not used>,
29
+ "gists_url": <not used>,
30
+ "starred_url": <not used>,
31
+ "subscriptions_url": <not used>,
32
+ "organizations_url": <not used>,
33
+ "repos_url": <not used>,
34
+ "events_url": <not used>,
35
+ "received_events_url": <not used>,
36
+ "type": <not used>,
37
+ "site_admin": <not used>
38
+ },
39
+ "html_url": <not used>,
40
+ "description": Description,
41
+ "fork": <not used>,
42
+ "url": <not used>,
43
+ "forks_url": <not used>,
44
+ "keys_url": <not used>,
45
+ "collaborators_url": <not used>,
46
+ "teams_url": <not used>,
47
+ "hooks_url": <not used>,
48
+ "issue_events_url": <not used>,
49
+ "events_url": <not used>,
50
+ "assignees_url": <not used>,
51
+ "branches_url": <not used>,
52
+ "tags_url": <not used>,
53
+ "blobs_url": <not used>,
54
+ "git_tags_url": <not used>,
55
+ "git_refs_url": <not used>,
56
+ "trees_url": <not used>,
57
+ "statuses_url": <not used>,
58
+ "languages_url": <not used>,
59
+ "stargazers_url": <not used>,
60
+ "contributors_url": <not used>,
61
+ "subscribers_url": <not used>,
62
+ "subscription_url": <not used>,
63
+ "commits_url": <not used>,
64
+ "git_commits_url": <not used>,
65
+ "comments_url": <not used>,
66
+ "issue_comment_url": <not used>,
67
+ "contents_url": <not used>,
68
+ "compare_url": <not used>,
69
+ "merges_url": <not used>,
70
+ "archive_url": <not used>,
71
+ "downloads_url": <not used>,
72
+ "issues_url": <not used>,
73
+ "pulls_url": <not used>,
74
+ "milestones_url": <not used>,
75
+ "notifications_url": <not used>,
76
+ "labels_url": <not used>,
77
+ "releases_url": <not used>,
78
+ "deployments_url": <not used>,
79
+ "created_at": <not used>,
80
+ "updated_at": <not used>,
81
+ "pushed_at": <not used>,
82
+ "git_url": <not used>,
83
+ "ssh_url": <not used>,
84
+ "clone_url": <not used>,
85
+ "svn_url": <not used>,
86
+ "homepage": <not used>,
87
+ "size": <not used>,
88
+ "stargazers_count": <not used>,
89
+ "watchers_count": <not used>,
90
+ "language": <not used>,
91
+ "has_issues": SupportIssues,
92
+ "has_projects": SupportProjects,
93
+ "has_downloads": <not used> (No way to set value in GitHub settings),
94
+ "has_wiki": SupportWikis,
95
+ "has_pages": <not used>,
96
+ "has_discussions": SupportDiscussions,
97
+ "forks_count": <not used>,
98
+ "mirror_url": <not used>,
99
+ "archived": <not used>,
100
+ "disabled": <not used>,
101
+ "open_issues_count": <not used>,
102
+ "license": {
103
+ "key": <not used>,
104
+ "name": License,
105
+ "spdx_id": <not used>,
106
+ "url": <not used>,
107
+ "node_id": <not used>
108
+ },
109
+ "allow_forking": <not used> (No way to set value in GitHub settings),
110
+ "is_template": <not used>,
111
+ "web_commit_signoff_required": WebCommitSignoff,
112
+ "topics": <not used>,
113
+ "visibility": Private,
114
+ "forks": <not used>,
115
+ "open_issues": <not used>,
116
+ "watchers": <not used>,
117
+ "default_branch": DefaultBranch,
118
+ "permissions": {
119
+ "admin": <not used>,
120
+ "maintain": <not used>,
121
+ "push": <not used>,
122
+ "triage": <not used>,
123
+ "pull": <not used>
124
+ },
125
+ "temp_clone_token": <not used>,
126
+ "allow_squash_merge": SquashMergeCommit,
127
+ "allow_merge_commit": MergeCommit,
128
+ "allow_rebase_merge": RebaseMergeCommit,
129
+ "allow_auto_merge": AutoMerge,
130
+ "delete_branch_on_merge": DeleteHeadBranches,
131
+ "allow_update_branch": SuggestUpdatingPullRequestBranches,
132
+ "use_squash_pr_title_as_default": <not used> (No way to set value in GitHub settings),
133
+ "squash_merge_commit_message": SquashMergeCommitMessage,
134
+ "squash_merge_commit_title": <not used> (No way to set value in GitHub settings),
135
+ "merge_commit_message": MergeCommitMessage,
136
+ "merge_commit_title": <not used> (No way to set value in GitHub settings),
137
+ "custom_properties": <not used>,
138
+ "organization": {
139
+ "login": <not used>,
140
+ "id": <not used>,
141
+ "node_id": <not used>,
142
+ "avatar_url": <not used>,
143
+ "gravatar_id": <not used>,
144
+ "url": <not used>,
145
+ "html_url": <not used>,
146
+ "followers_url": <not used>,
147
+ "following_url": <not used>,
148
+ "gists_url": <not used>,
149
+ "starred_url": <not used>,
150
+ "subscriptions_url": <not used>,
151
+ "organizations_url": <not used>,
152
+ "repos_url": <not used>,
153
+ "events_url": <not used>,
154
+ "received_events_url": <not used>,
155
+ "type": <not used>,
156
+ "site_admin": <not used>
157
+ },
158
+ "security_and_analysis": {
159
+ "secret_scanning": SecretScanning,
160
+ "secret_scanning_push_protection": SecretScanningPushProtection,
161
+ "dependabot_security_updates": DependabotSecurityUpdates,
162
+ "secret_scanning_validity_checks": <not used> (The functionality doesn't seem to be available in the UX yet (https://github.blog/2023-10-04-introducing-secret-scanning-validity-checks-for-major-cloud-services/))
163
+ },
164
+ "network_count": <not used>,
165
+ "subscribers_count": <not used>
166
+ }
167
+ """
168
+
169
+ from typing import Any, Optional
170
+
171
+ from dbrownell_Common.Types import override # type: ignore[import-untyped]
172
+
173
+ from RepoAuditor.Query import ExecutionStyle, Query
174
+
175
+ from .StandardQueryRequirements.AutoMerge import AutoMerge
176
+ from .StandardQueryRequirements.DefaultBranch import DefaultBranch
177
+ from .StandardQueryRequirements.DeleteHeadBranches import DeleteHeadBranches
178
+ from .StandardQueryRequirements.Description import Description
179
+ from .StandardQueryRequirements.DependabotSecurityUpdates import DependabotSecurityUpdates
180
+ from .StandardQueryRequirements.License import License
181
+ from .StandardQueryRequirements.MergeCommit import MergeCommit
182
+ from .StandardQueryRequirements.MergeCommitMessage import MergeCommitMessage
183
+ from .StandardQueryRequirements.Private import Private
184
+ from .StandardQueryRequirements.RebaseMergeCommit import RebaseMergeCommit
185
+ from .StandardQueryRequirements.SecretScanning import SecretScanning
186
+ from .StandardQueryRequirements.SecretScanningPushProtection import SecretScanningPushProtection
187
+ from .StandardQueryRequirements.SquashCommitMerge import SquashCommitMerge
188
+ from .StandardQueryRequirements.SquashMergeCommitMessage import SquashMergeCommitMessage
189
+ from .StandardQueryRequirements.SuggestUpdatingPullRequestBranches import (
190
+ SuggestUpdatingPullRequestBranches,
191
+ )
192
+ from .StandardQueryRequirements.SupportDiscussions import SupportDiscussions
193
+ from .StandardQueryRequirements.SupportIssues import SupportIssues
194
+ from .StandardQueryRequirements.SupportProjects import SupportProjects
195
+ from .StandardQueryRequirements.SupportWikis import SupportWikis
196
+ from .StandardQueryRequirements.TemplateRepository import TemplateRepository
197
+ from .StandardQueryRequirements.WebCommitSignoff import WebCommitSignoff
198
+
199
+
200
+ # ----------------------------------------------------------------------
201
+ class StandardQuery(Query):
202
+ """Query with requirements that operate on basic GitHub repository data."""
203
+
204
+ # ----------------------------------------------------------------------
205
+ def __init__(self) -> None:
206
+ super().__init__(
207
+ "StandardQuery",
208
+ ExecutionStyle.Parallel,
209
+ [
210
+ AutoMerge(),
211
+ DefaultBranch(),
212
+ DeleteHeadBranches(),
213
+ Description(),
214
+ DependabotSecurityUpdates(),
215
+ License(),
216
+ MergeCommit(),
217
+ MergeCommitMessage(),
218
+ Private(),
219
+ RebaseMergeCommit(),
220
+ SecretScanning(),
221
+ SecretScanningPushProtection(),
222
+ SquashCommitMerge(),
223
+ SquashMergeCommitMessage(),
224
+ SuggestUpdatingPullRequestBranches(),
225
+ SupportDiscussions(),
226
+ SupportIssues(),
227
+ SupportProjects(),
228
+ SupportWikis(),
229
+ TemplateRepository(),
230
+ WebCommitSignoff(),
231
+ ],
232
+ )
233
+
234
+ # ----------------------------------------------------------------------
235
+ @override
236
+ def GetData(
237
+ self,
238
+ module_data: dict[str, Any],
239
+ ) -> Optional[dict[str, Any]]:
240
+ """Get the data from an API session."""
241
+ response = module_data["session"].get("")
242
+
243
+ response.raise_for_status()
244
+ response = response.json()
245
+
246
+ module_data["standard"] = response
247
+
248
+ return module_data
@@ -3,4 +3,4 @@ APP_NAME = "RepoAuditor"
3
3
  # Note that this value will be overwritten by calls to `python ../../Build.py update_version` based
4
4
  # on changes observed in the git repository. The default value below will be used until the value
5
5
  # here is explicitly updated by the Continuous Integration system.
6
- __version__ = "0.2.21"
6
+ __version__ = "0.2.22"
@@ -7,9 +7,6 @@
7
7
  """End-to-end tests for the GitHub plugin"""
8
8
 
9
9
  import os
10
- import sys
11
- import textwrap
12
-
13
10
  from pathlib import Path
14
11
 
15
12
  import pytest
@@ -22,37 +19,11 @@ from typer.testing import CliRunner
22
19
  from RepoAuditor.EntryPoint import app
23
20
 
24
21
 
25
- from utilities import ScrubDurationGithuburlAndSpaces, GetGithubUrl
22
+ from utilities import ScrubDurationGithuburlAndSpaces, GetGithubUrl, CheckPATFileExists
26
23
 
27
24
  # ----------------------------------------------------------------------
28
25
  _github_pat_filename = (Path(__file__).parent / "github_pat.txt").resolve()
29
-
30
- if not _github_pat_filename.is_file():
31
- sys.stdout.write(
32
- textwrap.dedent(
33
- f"""\
34
-
35
-
36
- The filename '{_github_pat_filename}' does not exist. Please create this file and add your GitHub Personal Access Token (PAT) to it.
37
- This git repository is configured to ignore the file so that it will never be included as part of a commit.
38
-
39
- To create a new token:
40
-
41
- 1. Visit https://github.com/settings/tokens/new
42
- 2. Ensure that 'repo' scope is checked
43
- 3. Click 'Generate token'
44
- 4. Copy the token to the clipboard
45
- 5. Create the file '{_github_pat_filename}'
46
- 6. Paste the token into the created file
47
- 7. Save the file and run these tests again.
48
-
49
- These tests query a repository on GitHub, but GitHub limits the number of concurrent requests made to a repository when a PAT is
50
- not provided. As a result, the tests will fail once the limit is reached.
51
- """,
52
- ),
53
- )
54
-
55
- sys.exit(-1)
26
+ CheckPATFileExists(_github_pat_filename)
56
27
 
57
28
  # ----------------------------------------------------------------------
58
29
  pytest.fixture(InitializeStreamCapabilities(), scope="session", autouse=True)
@@ -6,11 +6,15 @@
6
6
  # -------------------------------------------------------------------------------
7
7
  """Helper utilities for Github tests"""
8
8
 
9
- from git import Repo
10
-
11
9
  import re
10
+ import sys
11
+ import textwrap
12
+
13
+ from pathlib import Path
12
14
  from typing import Match
15
+
13
16
  from dbrownell_Common.TestHelpers.StreamTestHelpers import ScrubDuration
17
+ from git import Repo
14
18
 
15
19
 
16
20
  # ----------------------------------------------------------------------
@@ -66,3 +70,33 @@ def GetGithubUrl(remote_name: str = "origin") -> str:
66
70
  repo_url = repo_url.replace(":", "/").replace("git@", "https://")
67
71
 
68
72
  return repo_url.split(".git")[0]
73
+
74
+
75
+ def CheckPATFileExists(github_pat_filename: Path):
76
+ """Check if PAT file exists, and give error message if not."""
77
+ if not github_pat_filename.is_file():
78
+ sys.stdout.write(
79
+ textwrap.dedent(
80
+ f"""\
81
+
82
+
83
+ The filename '{github_pat_filename}' does not exist. Please create this file and add your GitHub Personal Access Token (PAT) to it.
84
+ This git repository is configured to ignore the file so that it will never be included as part of a commit.
85
+
86
+ To create a new token:
87
+
88
+ 1. Visit https://github.com/settings/tokens/new
89
+ 2. Ensure that 'repo' scope is checked
90
+ 3. Click 'Generate token'
91
+ 4. Copy the token to the clipboard
92
+ 5. Create the file '{github_pat_filename}'
93
+ 6. Paste the token into the created file
94
+ 7. Save the file and run these tests again.
95
+
96
+ These tests query a repository on GitHub, but GitHub limits the number of concurrent requests made to a repository when a PAT is
97
+ not provided. As a result, the tests will fail once the limit is reached.
98
+ """,
99
+ ),
100
+ )
101
+
102
+ sys.exit(-1)
@@ -1,245 +0,0 @@
1
- # -------------------------------------------------------------------------------
2
- # |
3
- # | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
4
- # | Distributed under the MIT License.
5
- # |
6
- # -------------------------------------------------------------------------------
7
- """Contains the StandardQuery object."""
8
-
9
- from typing import Any, Optional
10
-
11
- from dbrownell_Common.Types import override # type: ignore[import-untyped]
12
-
13
- from RepoAuditor.Query import ExecutionStyle, Query
14
-
15
- from .StandardQueryRequirements.AutoMerge import AutoMerge
16
- from .StandardQueryRequirements.DefaultBranch import DefaultBranch
17
- from .StandardQueryRequirements.DeleteHeadBranches import DeleteHeadBranches
18
- from .StandardQueryRequirements.Description import Description
19
- from .StandardQueryRequirements.DependabotSecurityUpdates import DependabotSecurityUpdates
20
- from .StandardQueryRequirements.License import License
21
- from .StandardQueryRequirements.MergeCommit import MergeCommit
22
- from .StandardQueryRequirements.MergeCommitMessage import MergeCommitMessage
23
- from .StandardQueryRequirements.Private import Private
24
- from .StandardQueryRequirements.RebaseMergeCommit import RebaseMergeCommit
25
- from .StandardQueryRequirements.SecretScanning import SecretScanning
26
- from .StandardQueryRequirements.SecretScanningPushProtection import SecretScanningPushProtection
27
- from .StandardQueryRequirements.SquashCommitMerge import SquashCommitMerge
28
- from .StandardQueryRequirements.SquashMergeCommitMessage import SquashMergeCommitMessage
29
- from .StandardQueryRequirements.SuggestUpdatingPullRequestBranches import (
30
- SuggestUpdatingPullRequestBranches,
31
- )
32
- from .StandardQueryRequirements.SupportDiscussions import SupportDiscussions
33
- from .StandardQueryRequirements.SupportIssues import SupportIssues
34
- from .StandardQueryRequirements.SupportProjects import SupportProjects
35
- from .StandardQueryRequirements.SupportWikis import SupportWikis
36
- from .StandardQueryRequirements.TemplateRepository import TemplateRepository
37
- from .StandardQueryRequirements.WebCommitSignoff import WebCommitSignoff
38
-
39
- # REQUEST: https://api.github.com/repos/<username>/<repo>
40
- # RESPONSE:
41
- # {
42
- # "id": <not used>,
43
- # "node_id": <not used>,
44
- # "name": <not used>",
45
- # "full_name": <not used>,
46
- # "private": Private,
47
- # "owner": {
48
- # "login": <not used>,
49
- # "id": <not used>,
50
- # "node_id": <not used>,
51
- # "avatar_url": <not used>,
52
- # "gravatar_id": <not used>,
53
- # "url": <not used>,
54
- # "html_url": <not used>,
55
- # "followers_url": <not used>,
56
- # "following_url": <not used>,
57
- # "gists_url": <not used>,
58
- # "starred_url": <not used>,
59
- # "subscriptions_url": <not used>,
60
- # "organizations_url": <not used>,
61
- # "repos_url": <not used>,
62
- # "events_url": <not used>,
63
- # "received_events_url": <not used>,
64
- # "type": <not used>,
65
- # "site_admin": <not used>
66
- # },
67
- # "html_url": <not used>,
68
- # "description": Description,
69
- # "fork": <not used>,
70
- # "url": <not used>,
71
- # "forks_url": <not used>,
72
- # "keys_url": <not used>,
73
- # "collaborators_url": <not used>,
74
- # "teams_url": <not used>,
75
- # "hooks_url": <not used>,
76
- # "issue_events_url": <not used>,
77
- # "events_url": <not used>,
78
- # "assignees_url": <not used>,
79
- # "branches_url": <not used>,
80
- # "tags_url": <not used>,
81
- # "blobs_url": <not used>,
82
- # "git_tags_url": <not used>,
83
- # "git_refs_url": <not used>,
84
- # "trees_url": <not used>,
85
- # "statuses_url": <not used>,
86
- # "languages_url": <not used>,
87
- # "stargazers_url": <not used>,
88
- # "contributors_url": <not used>,
89
- # "subscribers_url": <not used>,
90
- # "subscription_url": <not used>,
91
- # "commits_url": <not used>,
92
- # "git_commits_url": <not used>,
93
- # "comments_url": <not used>,
94
- # "issue_comment_url": <not used>,
95
- # "contents_url": <not used>,
96
- # "compare_url": <not used>,
97
- # "merges_url": <not used>,
98
- # "archive_url": <not used>,
99
- # "downloads_url": <not used>,
100
- # "issues_url": <not used>,
101
- # "pulls_url": <not used>,
102
- # "milestones_url": <not used>,
103
- # "notifications_url": <not used>,
104
- # "labels_url": <not used>,
105
- # "releases_url": <not used>,
106
- # "deployments_url": <not used>,
107
- # "created_at": <not used>,
108
- # "updated_at": <not used>,
109
- # "pushed_at": <not used>,
110
- # "git_url": <not used>,
111
- # "ssh_url": <not used>,
112
- # "clone_url": <not used>,
113
- # "svn_url": <not used>,
114
- # "homepage": <not used>,
115
- # "size": <not used>,
116
- # "stargazers_count": <not used>,
117
- # "watchers_count": <not used>,
118
- # "language": <not used>,
119
- # "has_issues": SupportIssues,
120
- # "has_projects": SupportProjects,
121
- # "has_downloads": <not used> (No way to set value in GitHub settings),
122
- # "has_wiki": SupportWikis,
123
- # "has_pages": <not used>,
124
- # "has_discussions": SupportDiscussions,
125
- # "forks_count": <not used>,
126
- # "mirror_url": <not used>,
127
- # "archived": <not used>,
128
- # "disabled": <not used>,
129
- # "open_issues_count": <not used>,
130
- # "license": {
131
- # "key": <not used>,
132
- # "name": License,
133
- # "spdx_id": <not used>,
134
- # "url": <not used>,
135
- # "node_id": <not used>
136
- # },
137
- # "allow_forking": <not used> (No way to set value in GitHub settings),
138
- # "is_template": <not used>,
139
- # "web_commit_signoff_required": WebCommitSignoff,
140
- # "topics": <not used>,
141
- # "visibility": Private,
142
- # "forks": <not used>,
143
- # "open_issues": <not used>,
144
- # "watchers": <not used>,
145
- # "default_branch": DefaultBranch,
146
- # "permissions": {
147
- # "admin": <not used>,
148
- # "maintain": <not used>,
149
- # "push": <not used>,
150
- # "triage": <not used>,
151
- # "pull": <not used>
152
- # },
153
- # "temp_clone_token": <not used>,
154
- # "allow_squash_merge": SquashMergeCommit,
155
- # "allow_merge_commit": MergeCommit,
156
- # "allow_rebase_merge": RebaseMergeCommit,
157
- # "allow_auto_merge": AutoMerge,
158
- # "delete_branch_on_merge": DeleteHeadBranches,
159
- # "allow_update_branch": SuggestUpdatingPullRequestBranches,
160
- # "use_squash_pr_title_as_default": <not used> (No way to set value in GitHub settings),
161
- # "squash_merge_commit_message": SquashMergeCommitMessage,
162
- # "squash_merge_commit_title": <not used> (No way to set value in GitHub settings),
163
- # "merge_commit_message": MergeCommitMessage,
164
- # "merge_commit_title": <not used> (No way to set value in GitHub settings),
165
- # "custom_properties": <not used>,
166
- # "organization": {
167
- # "login": <not used>,
168
- # "id": <not used>,
169
- # "node_id": <not used>,
170
- # "avatar_url": <not used>,
171
- # "gravatar_id": <not used>,
172
- # "url": <not used>,
173
- # "html_url": <not used>,
174
- # "followers_url": <not used>,
175
- # "following_url": <not used>,
176
- # "gists_url": <not used>,
177
- # "starred_url": <not used>,
178
- # "subscriptions_url": <not used>,
179
- # "organizations_url": <not used>,
180
- # "repos_url": <not used>,
181
- # "events_url": <not used>,
182
- # "received_events_url": <not used>,
183
- # "type": <not used>,
184
- # "site_admin": <not used>
185
- # },
186
- # "security_and_analysis": {
187
- # "secret_scanning": SecretScanning,
188
- # "secret_scanning_push_protection": SecretScanningPushProtection,
189
- # "dependabot_security_updates": DependabotSecurityUpdates,
190
- # "secret_scanning_validity_checks": <not used> (The functionality doesn't seem to be available in the UX yet (https://github.blog/2023-10-04-introducing-secret-scanning-validity-checks-for-major-cloud-services/))
191
- # },
192
- # "network_count": <not used>,
193
- # "subscribers_count": <not used>
194
- # }
195
-
196
-
197
- # ----------------------------------------------------------------------
198
- class StandardQuery(Query):
199
- """Query with requirements that operate on basic GitHub repository data."""
200
-
201
- # ----------------------------------------------------------------------
202
- def __init__(self) -> None:
203
- super().__init__(
204
- "StandardQuery",
205
- ExecutionStyle.Parallel,
206
- [
207
- AutoMerge(),
208
- DefaultBranch(),
209
- DeleteHeadBranches(),
210
- Description(),
211
- DependabotSecurityUpdates(),
212
- License(),
213
- MergeCommit(),
214
- MergeCommitMessage(),
215
- Private(),
216
- RebaseMergeCommit(),
217
- SecretScanning(),
218
- SecretScanningPushProtection(),
219
- SquashCommitMerge(),
220
- SquashMergeCommitMessage(),
221
- SuggestUpdatingPullRequestBranches(),
222
- SupportDiscussions(),
223
- SupportIssues(),
224
- SupportProjects(),
225
- SupportWikis(),
226
- TemplateRepository(),
227
- WebCommitSignoff(),
228
- ],
229
- )
230
-
231
- # ----------------------------------------------------------------------
232
- @override
233
- def GetData(
234
- self,
235
- module_data: dict[str, Any],
236
- ) -> Optional[dict[str, Any]]:
237
- """Get the data from an API session."""
238
- response = module_data["session"].get("")
239
-
240
- response.raise_for_status()
241
- response = response.json()
242
-
243
- module_data["standard"] = response
244
-
245
- return module_data
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes