github2gerrit 2.1.0__tar.gz → 2.1.1__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 (143) hide show
  1. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/.pre-commit-config.yaml +26 -6
  2. github2gerrit-2.1.1/LICENSES/Apache-2.0.txt +201 -0
  3. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/PKG-INFO +3 -2
  4. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/pyproject.toml +80 -45
  5. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/cli.py +19 -34
  6. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/config.py +108 -0
  7. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/core.py +4 -3
  8. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/duplicate_detection.py +17 -5
  9. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/ssh_config_parser.py +36 -60
  10. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/conftest.py +29 -0
  11. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/fixtures/make_repo.py +3 -10
  12. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_action_environment_mapping.py +27 -0
  13. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_action_outputs.py +3 -0
  14. github2gerrit-2.1.1/tests/test_cache_isolation.py +210 -0
  15. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_cli.py +9 -17
  16. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_cli_helpers.py +140 -0
  17. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_composite_action_coverage.py +14 -5
  18. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_config_helpers.py +326 -0
  19. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_integration_fixture_repo.py +1 -1
  20. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_prepare_commits.py +1 -1
  21. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_ssh_setup.py +5 -5
  22. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_duplicate_detection.py +455 -0
  23. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_error_codes.py +21 -10
  24. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_gerrit_change_id_footer.py +1 -1
  25. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_gerrit_pr_closer.py +1 -0
  26. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_gerrit_ssh_abandon.py +2 -3
  27. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_gerrit_urls_more.py +7 -14
  28. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_mapping_comment_additional.py +59 -32
  29. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_mapping_comment_digest_and_backref.py +3 -4
  30. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_misc_small_coverage.py +1 -1
  31. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_orphan_rest_side_effects.py +11 -10
  32. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_pr_commands.py +2 -2
  33. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_pr_content_filter_integration.py +1 -1
  34. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_reconciliation_extracted_module.py +42 -24
  35. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_reconciliation_plan_and_orphans.py +46 -26
  36. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_ssh_agent_ownership.py +39 -9
  37. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_ssh_artifact_prevention.py +10 -0
  38. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/unit/test_config_integration.py +6 -19
  39. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/unit/test_ssh_config_parser.py +159 -72
  40. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/uv.lock +37 -24
  41. github2gerrit-2.1.0/LICENSE +0 -1
  42. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/.aislop/config.yml +0 -0
  43. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/.editorconfig +0 -0
  44. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/.gitignore +0 -0
  45. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/.gitlint +0 -0
  46. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/.markdownlint.yaml +0 -0
  47. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/.yamllint +0 -0
  48. /github2gerrit-2.1.0/LICENSES/Apache-2.0.txt → /github2gerrit-2.1.1/LICENSE +0 -0
  49. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/README.md +0 -0
  50. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/REUSE.toml +0 -0
  51. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/SECURITY.md +0 -0
  52. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/action.yaml +0 -0
  53. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/docs/COMMIT_RULES.md +0 -0
  54. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/docs/cli.md +0 -0
  55. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/docs/development.md +0 -0
  56. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/docs/features.md +0 -0
  57. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/docs/github2gerrit_token_permissions_classic.png +0 -0
  58. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/sitecustomize.py +0 -0
  59. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/__init__.py +0 -0
  60. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/commit_normalization.py +0 -0
  61. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/commit_rules.py +0 -0
  62. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/constants.py +0 -0
  63. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/error_codes.py +0 -0
  64. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/external_api.py +0 -0
  65. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/gerrit_pr_closer.py +0 -0
  66. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/gerrit_query.py +0 -0
  67. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/gerrit_rest.py +0 -0
  68. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/gerrit_ssh.py +0 -0
  69. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/gerrit_urls.py +0 -0
  70. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/github_api.py +0 -0
  71. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/gitreview.py +0 -0
  72. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/gitutils.py +0 -0
  73. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/mapping_comment.py +0 -0
  74. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/models.py +0 -0
  75. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/netrc.py +0 -0
  76. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/orchestrator/__init__.py +0 -0
  77. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/orchestrator/reconciliation.py +0 -0
  78. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/pr_approval.py +0 -0
  79. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/pr_commands.py +0 -0
  80. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/pr_content_filter.py +0 -0
  81. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/pr_directives.py +0 -0
  82. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/reconcile_matcher.py +0 -0
  83. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/rich_display.py +0 -0
  84. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/rich_logging.py +0 -0
  85. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/similarity.py +0 -0
  86. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/ssh_agent_setup.py +0 -0
  87. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/ssh_common.py +0 -0
  88. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/ssh_discovery.py +0 -0
  89. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/trailers.py +0 -0
  90. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/trust.py +0 -0
  91. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/src/github2gerrit/utils.py +0 -0
  92. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/fixtures/__init__.py +0 -0
  93. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/fixtures/ssh_config_samples.py +0 -0
  94. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_action_pr_number_handling.py +0 -0
  95. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_action_step_validation.py +0 -0
  96. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_automation_only.py +0 -0
  97. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_change_id_deduplication.py +0 -0
  98. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_clean_squash_title.py +0 -0
  99. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_cli_netrc_options.py +0 -0
  100. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_cli_outputs_file.py +0 -0
  101. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_cli_url_and_dryrun.py +0 -0
  102. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_commit_normalization.py +0 -0
  103. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_commit_rules.py +0 -0
  104. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_config_and_reviewers.py +0 -0
  105. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_close_pr_policy.py +0 -0
  106. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_config_and_errors.py +0 -0
  107. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_gerrit_backref_comment.py +0 -0
  108. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_gerrit_push_errors.py +0 -0
  109. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_gerrit_rest_results.py +0 -0
  110. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_shallow_clone.py +0 -0
  111. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_core_ssrf_protection.py +0 -0
  112. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_dependency_supersession.py +0 -0
  113. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_dns_validation_and_no_gerrit.py +0 -0
  114. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_email_case_normalization.py +0 -0
  115. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_external_api_framework.py +0 -0
  116. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_final_state_reconciliation.py +0 -0
  117. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_force_flag_cli.py +0 -0
  118. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_fork_approval_gate.py +0 -0
  119. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_fork_pr_hardening.py +0 -0
  120. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_gerrit_change_status_checks.py +0 -0
  121. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_gerrit_rest_client.py +0 -0
  122. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_gerrit_urls.py +0 -0
  123. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_ghe_and_gitreview_args.py +0 -0
  124. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_github_api_error_handling.py +0 -0
  125. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_github_api_helpers.py +0 -0
  126. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_github_api_retry_and_helpers.py +0 -0
  127. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_gitreview.py +0 -0
  128. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_gitutils_helpers.py +0 -0
  129. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_issue_157_regressions.py +0 -0
  130. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_metadata_and_reconciliation.py +0 -0
  131. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_metadata_trailer_separation_bug.py +0 -0
  132. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_netrc.py +0 -0
  133. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_pr_command_authorisation.py +0 -0
  134. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_pr_content_filter.py +0 -0
  135. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_pr_update_detection.py +0 -0
  136. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_reconciliation_scenarios.py +0 -0
  137. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_ssh_agent.py +0 -0
  138. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_ssh_common.py +0 -0
  139. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_ssh_discovery.py +0 -0
  140. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_ssh_discovery_dry_run.py +0 -0
  141. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_trailers_additional.py +0 -0
  142. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_url_parser.py +0 -0
  143. {github2gerrit-2.1.0 → github2gerrit-2.1.1}/tests/test_utils.py +0 -0
@@ -64,20 +64,38 @@ repos:
64
64
  types: [yaml]
65
65
 
66
66
  - repo: https://github.com/astral-sh/ruff-pre-commit
67
- rev: aab412d509121cb5f7533134b7e67f9fab59c682 # frozen: v0.16.4
67
+ rev: 1f1e8bf348ff38fc88619a38d3ca4d9c56abea49 # frozen: v0.16.5
68
68
  hooks:
69
69
  - id: ruff
70
- files: ^(src|scripts|tests)/.+\.py$
70
+ files: ^(src|scripts|tests)/.+\.py$|^sitecustomize\.py$
71
71
  args: [--fix, --exit-non-zero-on-fix]
72
72
  - id: ruff-format
73
- files: ^(src|scripts|tests)/.+\.py$
73
+ files: ^(src|scripts|tests)/.+\.py$|^sitecustomize\.py$
74
74
 
75
75
  - repo: https://github.com/pre-commit/mirrors-mypy
76
76
  rev: 7ff8d35ae36a7d2b968f2f90b4c723e292e594ee # frozen: v2.3.1
77
77
  hooks:
78
78
  - id: mypy
79
- files: ^src/.+\.py$
79
+ # Every Python path in the repository, matching the ruff and
80
+ # basedpyright hooks above and below so the three cannot drift.
81
+ files: ^(src|scripts|tests)/.+\.py$|^sitecustomize\.py$
82
+ # mypy runs in an isolated virtualenv that holds only what is
83
+ # listed here, so anything the checked files import has to be
84
+ # present or mypy draws conclusions the project never would. With
85
+ # pytest absent, for instance, @pytest.fixture reads as an untyped
86
+ # decorator and pytest.raises stops telling mypy the block can
87
+ # swallow the exception, which turns every statement after a
88
+ # `with pytest.raises(...)` into dead code. Installing the real
89
+ # packages removes that whole class of environment-only findings;
90
+ # keep this list in step with the imports under src/ and tests/.
91
+ # pygerrit2 is deliberately absent: it is an optional runtime
92
+ # dependency and pyproject.toml already gives it
93
+ # ignore_missing_imports.
80
94
  additional_dependencies:
95
+ - click>=8.2
96
+ - pytest
97
+ - responses
98
+ - typer
81
99
  - types-PyYAML
82
100
  - types-requests
83
101
 
@@ -123,10 +141,12 @@ repos:
123
141
  rev: 3c94d276aa3005fa1f5a977946c9dc106135c083 # frozen: 1.39.10
124
142
  hooks:
125
143
  - id: basedpyright
126
- files: ^src/.+\.py$
144
+ # Every Python path in the repository. Keep in sync with the
145
+ # `include` list under [tool.pyright] in pyproject.toml.
146
+ files: ^(src|scripts|tests)/.+\.py$|^sitecustomize\.py$
127
147
 
128
148
  - repo: https://github.com/lfreleng-actions/gha-workflow-linter
129
- rev: 42aa4db931ab4c9da0930ae5ca2259ab08da79cb # frozen: v1.5.2
149
+ rev: cae470a1e8988c3cacbe9cc40a0d6b8e6881bde2 # frozen: v1.5.5
130
150
  hooks:
131
151
  - id: gha-workflow-linter
132
152
 
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: github2gerrit
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Submit a GitHub pull request to a Gerrit repository.
5
5
  Project-URL: Homepage, https://github.com/lfreleng-actions/github2gerrit-action
6
6
  Project-URL: Repository, https://github.com/lfreleng-actions/github2gerrit-action
@@ -22,7 +22,6 @@ Classifier: Topic :: Software Development :: Build Tools
22
22
  Classifier: Topic :: Software Development :: Version Control
23
23
  Classifier: Typing :: Typed
24
24
  Requires-Python: >=3.11
25
- Requires-Dist: click>=8.1.7
26
25
  Requires-Dist: cryptography>=48.0.1
27
26
  Requires-Dist: git-review>=2.5.0
28
27
  Requires-Dist: pygerrit2>=2.0.15
@@ -33,6 +32,7 @@ Requires-Dist: rich>=14.2.0
33
32
  Requires-Dist: typer>=0.20.1
34
33
  Requires-Dist: urllib3>=2.6.3
35
34
  Provides-Extra: dev
35
+ Requires-Dist: click>=8.2; extra == 'dev'
36
36
  Requires-Dist: coverage[toml]>=7.10.6; extra == 'dev'
37
37
  Requires-Dist: mypy>=1.17.1; extra == 'dev'
38
38
  Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
@@ -40,6 +40,7 @@ Requires-Dist: pytest-mock>=3.15.1; extra == 'dev'
40
40
  Requires-Dist: pytest>=9.0.2; extra == 'dev'
41
41
  Requires-Dist: responses>=0.25.8; extra == 'dev'
42
42
  Requires-Dist: ruff>=0.6.3; extra == 'dev'
43
+ Requires-Dist: types-pyyaml>=6.0.12; extra == 'dev'
43
44
  Requires-Dist: types-requests>=2.31.0; extra == 'dev'
44
45
  Requires-Dist: types-urllib3>=1.26.25.14; extra == 'dev'
45
46
  Description-Content-Type: text/markdown
@@ -28,15 +28,16 @@ classifiers = [
28
28
  ]
29
29
  dependencies = [
30
30
  # CLI framework (Typer)
31
+ #
32
+ # typer vendors its own copy of click from 0.26 onward (typer._click)
33
+ # and depends on the installed click below that, so both regimes fall
34
+ # inside this floor. Nothing here imports click directly, so click is
35
+ # deliberately not a dependency: taking a symbol from click that typer
36
+ # also exposes gives two distinct objects under the vendored regime,
37
+ # which fails silently. See the dev extra for the one place the
38
+ # installed click still matters.
31
39
  "typer>=0.20.1",
32
40
 
33
- # Imported directly by the CLI (click.Group subclass for custom usage
34
- # formatting; click.core.ParameterSource to detect explicit CLI flags)
35
- # rather than only transitively via typer. Declared as a direct
36
- # dependency so our import contract doesn't depend on typer's internal
37
- # dependency choices.
38
- "click>=8.1.7",
39
-
40
41
  # Rich formatting for CLI output
41
42
  "rich>=14.2.0",
42
43
 
@@ -107,12 +108,21 @@ dev = [
107
108
  "coverage[toml]>=7.10.6",
108
109
  "responses>=0.25.8",
109
110
 
111
+ # typer.testing.CliRunner subclasses click.testing.CliRunner up to
112
+ # typer 0.25, so under that half of the supported range result.stderr
113
+ # comes from the installed click, which only captures it separately
114
+ # from 8.2 onward and raises ValueError before that. typer 0.26 and
115
+ # later vendor their own copy and are unaffected. Test-only: no
116
+ # runtime code imports click.
117
+ "click>=8.2",
118
+
110
119
  # Lint/format
111
120
  "ruff>=0.6.3",
112
121
  "mypy>=1.17.1",
113
122
 
114
123
  # Type checking helpers
115
124
  "pytest-mock>=3.15.1",
125
+ "types-PyYAML>=6.0.12",
116
126
  "types-requests>=2.31.0",
117
127
  "types-urllib3>=1.26.25.14",
118
128
  ]
@@ -160,40 +170,49 @@ warn_unreachable = true
160
170
  warn_unused_ignores = true
161
171
  disallow_any_generics = true
162
172
  disallow_subclassing_any = true
163
- disallow_untyped_defs = true
164
- disallow_incomplete_defs = true
165
- disallow_untyped_calls = true
173
+ # Annotation rules are relaxed here and switched back on for the shipped
174
+ # package by the github2gerrit.* override below. The obvious shape --
175
+ # global strictness plus a tests.* relaxation -- cannot work, because
176
+ # neither half of it matches:
177
+ #
178
+ # * tests/ has no __init__.py, so mypy names its modules test_cli,
179
+ # conftest and so on, never tests.test_cli.
180
+ # * A pattern cannot recover the real names either. mypy accepts "*"
181
+ # only as a whole dotted component, so "test_*" is rejected outright
182
+ # ("Patterns must be fully-qualified module names, optionally with
183
+ # '*' in some components") and the section is discarded in silence.
184
+ #
185
+ # Inverting the default is the only form that both applies and keeps
186
+ # applying when test files are added. It also suits scripts/, which is
187
+ # unannotated by design.
188
+ disallow_untyped_defs = false
189
+ disallow_incomplete_defs = false
190
+ disallow_untyped_calls = false
166
191
  no_implicit_optional = true
167
192
  show_error_codes = true
168
193
  pretty = true
169
- exclude = [
170
- "build/",
171
- "dist/",
172
- "docs/",
173
- "scripts/",
174
- "tests/fixtures/",
175
- "tests/test_composite_action_coverage.py",
176
- "tests/test_action_environment_mapping.py",
177
- "tests/test_action_step_validation.py",
178
- "tests/test_action_outputs.py",
179
- "tests/test_trailers_additional.py",
180
- ]
181
-
194
+ # exclude skips directory discovery only; files named explicitly on the
195
+ # command line are still checked. The pre-commit hook passes filenames,
196
+ # so anything listed here would be checked there regardless -- keep this
197
+ # to paths that hold no first-party Python.
198
+ exclude = ["build/", "dist/", "docs/"]
199
+
200
+ # The shipped package is held to full strict-mode annotation rules.
201
+ # Everything else -- tests/, scripts/, sitecustomize.py -- keeps every
202
+ # correctness check (check_untyped_defs, warn_unreachable,
203
+ # strict_equality, no_implicit_reexport) but is not required to annotate
204
+ # signatures. This mirrors the basedpyright stance recorded in
205
+ # [[tool.pyright.executionEnvironments]] below, where #392 disabled
206
+ # reportMissingParameterType for tests/ because pytest already resolves
207
+ # fixtures by parameter name.
182
208
  [[tool.mypy.overrides]]
183
- module = [
184
- "tests.test_composite_action_coverage",
185
- "tests.test_action_environment_mapping",
186
- "tests.test_action_step_validation",
187
- "tests.test_action_outputs",
188
- "tests.test_trailers_additional",
189
- ]
190
- disallow_untyped_defs = false
191
- disallow_incomplete_defs = false
192
- disallow_untyped_calls = false
193
- check_untyped_defs = false
209
+ module = ["github2gerrit.*"]
210
+ disallow_untyped_defs = true
211
+ disallow_incomplete_defs = true
212
+ disallow_untyped_calls = true
194
213
 
195
214
  [[tool.mypy.overrides]]
196
- module = ["pygerrit2", "pygerrit2.*"]
215
+ module = ["pygerrit2"]
197
216
  ignore_missing_imports = true
198
217
 
199
218
  [[tool.mypy.overrides]]
@@ -204,21 +223,12 @@ ignore_missing_imports = true
204
223
  module = ["typer", "typer.*"]
205
224
  ignore_missing_imports = true
206
225
 
207
- [[tool.mypy.overrides]]
208
- module = ["pytest", "pytest.*"]
209
- ignore_missing_imports = true
210
-
211
226
  [[tool.mypy.overrides]]
212
227
  module = ["github2gerrit.rich_display"]
213
228
  disallow_untyped_defs = false
214
229
  disallow_untyped_calls = false
215
230
  check_untyped_defs = false
216
231
 
217
- [[tool.mypy.overrides]]
218
- module = ["tests.*"]
219
- disallow_untyped_defs = false
220
- disallow_untyped_calls = false
221
-
222
232
  [tool.coverage.run]
223
233
  branch = true
224
234
  # Keep transient coverage data out of the working tree so tests that
@@ -254,7 +264,10 @@ markers = [
254
264
 
255
265
  [tool.pyright]
256
266
  pythonVersion = "3.11"
257
- include = ["src"]
267
+ # Every Python path in the repository, so an editor's language server and
268
+ # the pre-commit hook agree on the checked set. Keep in sync with the
269
+ # basedpyright hook's `files` pattern in .pre-commit-config.yaml.
270
+ include = ["src", "tests", "scripts", "sitecustomize.py"]
258
271
  typeCheckingMode = "strict"
259
272
  reportMissingImports = "none"
260
273
  reportMissingTypeStubs = "none"
@@ -278,6 +291,21 @@ reportIncompatibleVariableOverride = "error"
278
291
  reportOverlappingOverload = "error"
279
292
  reportUnsupportedDunderAll = "error"
280
293
 
294
+ # Test code is held to the same correctness rules as src/, but not to the
295
+ # same annotation rules. This mirrors the mypy stance above, where tests
296
+ # set disallow_untyped_defs = false.
297
+ [[tool.pyright.executionEnvironments]]
298
+ root = "tests"
299
+ # pytest resolves fixtures by parameter name at collection time, so
300
+ # annotating every `monkeypatch`, `tmp_path` and `mock_*` parameter adds
301
+ # no checking that the collection step does not already perform.
302
+ reportMissingParameterType = "none"
303
+ # @pytest.fixture and @pytest.mark.* read as untyped whenever pytest is
304
+ # not importable. The pre-commit hook runs basedpyright without a project
305
+ # virtualenv, so this fires there but not locally. The same tolerance is
306
+ # already applied repository-wide via reportMissingImports = "none".
307
+ reportUntypedFunctionDecorator = "none"
308
+
281
309
 
282
310
  [tool.uv]
283
311
  # uv will manage installation based on this pyproject and lockfile.
@@ -289,4 +317,11 @@ managed = true
289
317
  dev = [
290
318
  "hatch-vcs>=0.5.0",
291
319
  "hatchling>=1.28.0",
320
+ # Pull in the dev extra defined above. uv installs the `dev` group by
321
+ # default, so a bare `uv sync` provisions pytest and friends; without
322
+ # this, `uv run pytest` silently falls through to whatever pytest sits
323
+ # on PATH. Declared by reference rather than duplicated because CI
324
+ # installs the extra directly (`uv pip install ./[test,dev]`) and
325
+ # cannot see dependency groups.
326
+ "github2gerrit[dev]",
292
327
  ]
@@ -24,13 +24,10 @@ from pathlib import Path
24
24
  from typing import TYPE_CHECKING
25
25
  from typing import Any
26
26
  from typing import NoReturn
27
- from typing import Protocol
28
27
  from typing import TypeVar
29
28
  from typing import cast
30
29
  from urllib.parse import urlparse
31
30
 
32
- import click
33
- import click.core
34
31
  import typer
35
32
 
36
33
  from . import models
@@ -595,33 +592,6 @@ def _parse_github_target(url: str) -> GitHubPRTarget | GitHubRepoTarget:
595
592
 
596
593
  APP_NAME = "github2gerrit"
597
594
 
598
- if TYPE_CHECKING:
599
- BaseGroup = object
600
- else:
601
- BaseGroup = click.Group
602
-
603
-
604
- class _FormatterProto(Protocol):
605
- def write_usage(self, prog: str, args: str, prefix: str = ...) -> None:
606
- """Write the program usage line."""
607
-
608
-
609
- class _ContextProto(Protocol):
610
- @property
611
- def command_path(self) -> str:
612
- """Return the full command path."""
613
- raise NotImplementedError
614
-
615
-
616
- class _SingleUsageGroup(BaseGroup):
617
- def format_usage(
618
- self, ctx: _ContextProto, formatter: _FormatterProto
619
- ) -> None:
620
- # Force a simplified usage line without COMMAND [ARGS]...
621
- formatter.write_usage(
622
- ctx.command_path, "[OPTIONS] TARGET_URL", prefix="Usage: "
623
- )
624
-
625
595
 
626
596
  # Error message constants to comply with TRY003
627
597
  _MSG_MISSING_REQUIRED_INPUT = "Missing required input: {field_name}"
@@ -712,7 +682,6 @@ if "--help" in sys.argv or _is_github_actions_context():
712
682
  app: typer.Typer = typer.Typer(
713
683
  add_completion=False,
714
684
  no_args_is_help=False,
715
- cls=cast(Any, _SingleUsageGroup),
716
685
  rich_markup_mode="rich",
717
686
  help=(
718
687
  "Tool to convert GitHub pull requests into Gerrit changes "
@@ -762,10 +731,18 @@ def _save_derived_parameters_after_success(data: Inputs) -> None:
762
731
  cfg = load_org_config(org_for_cfg)
763
732
 
764
733
  # Apply derivation with saving enabled to capture newly derived
765
- # parameters
734
+ # parameters. The result is written to the configuration file
735
+ # only: this runs after submission and never calls
736
+ # apply_config_to_env, so nothing derived here reaches the
737
+ # process environment and recording it as derived provenance
738
+ # would describe environment values this call did not set.
766
739
  repository = os.getenv("GITHUB_REPOSITORY", "")
767
740
  apply_parameter_derivation(
768
- cfg, org_for_cfg, repository=repository, save_to_config=True
741
+ cfg,
742
+ org_for_cfg,
743
+ repository=repository,
744
+ save_to_config=True,
745
+ mark_derived=False,
769
746
  )
770
747
 
771
748
  log.debug(
@@ -810,7 +787,15 @@ def _resolve_bool_override(
810
787
  provided on the command line, so CLI flags always take precedence.
811
788
  """
812
789
  source = ctx.get_parameter_source(param_name) # pyright: ignore[reportAttributeAccessIssue]
813
- if source == click.core.ParameterSource.COMMANDLINE: # pyright: ignore[reportAttributeAccessIssue, reportUnnecessaryComparison]
790
+ # Compare by member name rather than by identity with a
791
+ # ParameterSource member. typer vendors its own copy of click under
792
+ # typer._click from 0.26 onward, so there ctx.get_parameter_source
793
+ # returns a typer._click.core.ParameterSource member, which never
794
+ # compares equal to the click.core.ParameterSource member of the
795
+ # same name. Below 0.26 typer uses the installed click and the two
796
+ # do match, which is why this arrived as a typer upgrade rather than
797
+ # a code change. Matching on .name is correct under both.
798
+ if source is not None and source.name == "COMMANDLINE":
814
799
  return current
815
800
  env_val = os.getenv(env_var)
816
801
  if env_val is not None: