github2gerrit 0.1.9__tar.gz → 0.1.11__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.
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/.pre-commit-config.yaml +5 -4
- github2gerrit-0.1.11/LICENSE +1 -0
- {github2gerrit-0.1.9/src/github2gerrit.egg-info → github2gerrit-0.1.11}/PKG-INFO +99 -25
- github2gerrit-0.1.9/PKG-INFO → github2gerrit-0.1.11/README.md +79 -46
- github2gerrit-0.1.11/REVISION_PLAN.md +387 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/action.yaml +59 -43
- github2gerrit-0.1.11/docs/COMPOSITE_ACTION_TESTING.md +219 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/pyproject.toml +59 -9
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/sitecustomize.py +7 -2
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/cli.py +796 -200
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/commit_normalization.py +44 -15
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/config.py +77 -30
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/core.py +1576 -260
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/duplicate_detection.py +224 -100
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/external_api.py +76 -25
- github2gerrit-0.1.11/src/github2gerrit/gerrit_query.py +286 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/gerrit_rest.py +53 -18
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/gerrit_urls.py +90 -33
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/github_api.py +19 -6
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/gitutils.py +43 -14
- github2gerrit-0.1.11/src/github2gerrit/mapping_comment.py +345 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/models.py +15 -1
- github2gerrit-0.1.11/src/github2gerrit/orchestrator/__init__.py +25 -0
- github2gerrit-0.1.11/src/github2gerrit/orchestrator/reconciliation.py +589 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/pr_content_filter.py +65 -17
- github2gerrit-0.1.11/src/github2gerrit/reconcile_matcher.py +595 -0
- github2gerrit-0.1.11/src/github2gerrit/rich_display.py +502 -0
- github2gerrit-0.1.11/src/github2gerrit/rich_logging.py +316 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/similarity.py +66 -19
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/ssh_agent_setup.py +59 -22
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/ssh_common.py +30 -11
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/ssh_discovery.py +67 -20
- github2gerrit-0.1.11/src/github2gerrit/trailers.py +340 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/utils.py +6 -2
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/conftest.py +16 -6
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/fixtures/make_repo.py +23 -9
- github2gerrit-0.1.11/tests/test_action_environment_mapping.py +474 -0
- github2gerrit-0.1.11/tests/test_action_outputs.py +670 -0
- github2gerrit-0.1.11/tests/test_action_pr_number_handling.py +153 -0
- github2gerrit-0.1.11/tests/test_action_step_validation.py +747 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_change_id_deduplication.py +68 -23
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_cli.py +91 -35
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_cli_helpers.py +14 -15
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_cli_outputs_file.py +75 -16
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_cli_url_and_dryrun.py +43 -5
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_commit_normalization.py +57 -18
- github2gerrit-0.1.11/tests/test_composite_action_coverage.py +786 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_config_and_reviewers.py +5 -2
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_config_helpers.py +93 -32
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_core_close_pr_policy.py +21 -7
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_core_config_and_errors.py +54 -18
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_core_gerrit_backref_comment.py +18 -6
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_core_gerrit_push_errors.py +22 -10
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_core_gerrit_rest_results.py +35 -12
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_core_integration_fixture_repo.py +8 -3
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_core_prepare_commits.py +57 -19
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_core_ssh_setup.py +73 -24
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_duplicate_detection.py +178 -106
- github2gerrit-0.1.11/tests/test_email_case_normalization.py +258 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_external_api_framework.py +33 -11
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_gerrit_change_id_footer.py +80 -18
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_gerrit_rest_client.py +39 -13
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_gerrit_urls.py +136 -36
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_gerrit_urls_more.py +83 -26
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_ghe_and_gitreview_args.py +18 -6
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_github_api_helpers.py +8 -3
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_github_api_retry_and_helpers.py +3 -1
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_gitutils_helpers.py +42 -15
- github2gerrit-0.1.11/tests/test_mapping_comment_additional.py +397 -0
- github2gerrit-0.1.11/tests/test_mapping_comment_digest_and_backref.py +173 -0
- github2gerrit-0.1.11/tests/test_metadata_and_reconciliation.py +140 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_misc_small_coverage.py +3 -1
- github2gerrit-0.1.11/tests/test_orphan_rest_side_effects.py +337 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_pr_content_filter.py +17 -6
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_pr_content_filter_integration.py +45 -15
- github2gerrit-0.1.11/tests/test_reconciliation_extracted_module.py +221 -0
- github2gerrit-0.1.11/tests/test_reconciliation_plan_and_orphans.py +311 -0
- github2gerrit-0.1.11/tests/test_reconciliation_scenarios.py +325 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_ssh_agent.py +84 -27
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_ssh_common.py +18 -6
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_ssh_discovery.py +45 -15
- github2gerrit-0.1.11/tests/test_trailers_additional.py +199 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_url_parser.py +3 -1
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/test_utils.py +110 -23
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/uv.lock +80 -0
- github2gerrit-0.1.9/.github/actionlint.yaml +0 -11
- github2gerrit-0.1.9/.github/dependabot.yml +0 -12
- github2gerrit-0.1.9/.github/release-drafter.yml +0 -68
- github2gerrit-0.1.9/.github/workflows/build-test-release.yaml +0 -324
- github2gerrit-0.1.9/.github/workflows/build-test.yaml +0 -108
- github2gerrit-0.1.9/.github/workflows/dependencies.yaml +0 -47
- github2gerrit-0.1.9/.github/workflows/github2gerrit.yaml +0 -215
- github2gerrit-0.1.9/.github/workflows/release-drafter.yaml +0 -63
- github2gerrit-0.1.9/.github/workflows/semantic-pull-request.yaml +0 -55
- github2gerrit-0.1.9/.github/workflows/sha-pinned-actions.yaml +0 -29
- github2gerrit-0.1.9/.github/workflows/testing.yaml +0 -305
- github2gerrit-0.1.9/LICENSE +0 -201
- github2gerrit-0.1.9/README.md +0 -758
- github2gerrit-0.1.9/setup.cfg +0 -4
- github2gerrit-0.1.9/src/github2gerrit.egg-info/SOURCES.txt +0 -88
- github2gerrit-0.1.9/src/github2gerrit.egg-info/dependency_links.txt +0 -1
- github2gerrit-0.1.9/src/github2gerrit.egg-info/entry_points.txt +0 -2
- github2gerrit-0.1.9/src/github2gerrit.egg-info/requires.txt +0 -15
- github2gerrit-0.1.9/src/github2gerrit.egg-info/top_level.txt +0 -1
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/.editorconfig +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/.gitignore +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/.gitlint +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/.markdownlint.yaml +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/.readthedocs.yml +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/.yamllint +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/LICENSES/Apache-2.0.txt +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/REUSE.toml +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/docs/github2gerrit_token_permissions_classic.png +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/src/github2gerrit/__init__.py +0 -0
- {github2gerrit-0.1.9 → github2gerrit-0.1.11}/tests/fixtures/__init__.py +0 -0
@@ -58,7 +58,7 @@ repos:
|
|
58
58
|
types: [yaml]
|
59
59
|
|
60
60
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
61
|
-
rev:
|
61
|
+
rev: f298305809c552671cc47e0fec0ba43e96c146a2 # frozen: v0.13.2
|
62
62
|
hooks:
|
63
63
|
- id: ruff
|
64
64
|
files: ^(src|scripts|tests)/.+\.py$
|
@@ -67,9 +67,10 @@ repos:
|
|
67
67
|
files: ^(src|scripts|tests)/.+\.py$
|
68
68
|
|
69
69
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
70
|
-
rev:
|
70
|
+
rev: 9f70dc58c23dfcca1b97af99eaeee3140a807c7e # frozen: v1.18.2
|
71
71
|
hooks:
|
72
72
|
- id: mypy
|
73
|
+
files: ^src/.+\.py$
|
73
74
|
additional_dependencies:
|
74
75
|
- types-PyYAML
|
75
76
|
- types-requests
|
@@ -101,7 +102,7 @@ repos:
|
|
101
102
|
exclude: "GERRIT_URL_CENTRALIZATION.md"
|
102
103
|
|
103
104
|
- repo: https://github.com/fsfe/reuse-tool
|
104
|
-
rev:
|
105
|
+
rev: 8b8bbd873b2af6b2a2521ab2b1ff07b2ab624840 # frozen: v5.1.1
|
105
106
|
hooks:
|
106
107
|
- id: reuse
|
107
108
|
|
@@ -119,7 +120,7 @@ repos:
|
|
119
120
|
- id: codespell
|
120
121
|
|
121
122
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
122
|
-
rev:
|
123
|
+
rev: 83987cd6ad8943c7f029b500b14aaf82c00a01fa # frozen: 0.34.0
|
123
124
|
hooks:
|
124
125
|
- id: check-github-actions
|
125
126
|
- id: check-github-workflows
|
@@ -0,0 +1 @@
|
|
1
|
+
LICENSES/Apache-2.0.txt
|
@@ -1,13 +1,14 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: github2gerrit
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.11
|
4
4
|
Summary: Submit a GitHub pull request to a Gerrit repository.
|
5
|
-
Author-email: Matthew Watkins <mwatkins@linuxfoundation.org>
|
6
|
-
License-Expression: Apache-2.0
|
7
5
|
Project-URL: Homepage, https://github.com/lfreleng-actions/github2gerrit
|
8
6
|
Project-URL: Repository, https://github.com/lfreleng-actions/github2gerrit
|
9
7
|
Project-URL: Issues, https://github.com/lfreleng-actions/github2gerrit/issues
|
10
|
-
|
8
|
+
Author-email: Matthew Watkins <mwatkins@linuxfoundation.org>
|
9
|
+
License-Expression: Apache-2.0
|
10
|
+
License-File: LICENSE
|
11
|
+
Keywords: actions,ci,cli,gerrit,github,typer
|
11
12
|
Classifier: Development Status :: 4 - Beta
|
12
13
|
Classifier: Environment :: Console
|
13
14
|
Classifier: Intended Audience :: Developers
|
@@ -20,23 +21,23 @@ Classifier: Topic :: Software Development :: Build Tools
|
|
20
21
|
Classifier: Topic :: Software Development :: Version Control
|
21
22
|
Classifier: Typing :: Typed
|
22
23
|
Requires-Python: <3.14,>=3.11
|
23
|
-
Description-Content-Type: text/markdown
|
24
|
-
License-File: LICENSE
|
25
|
-
Requires-Dist: typer>=0.12.5
|
26
|
-
Requires-Dist: PyGithub>=2.3.0
|
27
|
-
Requires-Dist: pygerrit2>=2.0.0
|
28
24
|
Requires-Dist: git-review>=2.3.1
|
29
|
-
Requires-Dist:
|
25
|
+
Requires-Dist: pygerrit2>=2.0.0
|
26
|
+
Requires-Dist: pygithub>=2.3.0
|
27
|
+
Requires-Dist: pyyaml>=6.0.1
|
28
|
+
Requires-Dist: rich>=13.0.0
|
29
|
+
Requires-Dist: typer>=0.12.5
|
30
30
|
Provides-Extra: dev
|
31
|
-
Requires-Dist:
|
32
|
-
Requires-Dist:
|
33
|
-
Requires-Dist:
|
34
|
-
Requires-Dist:
|
35
|
-
Requires-Dist:
|
36
|
-
Requires-Dist:
|
37
|
-
Requires-Dist:
|
38
|
-
Requires-Dist: types-click>=7.1.8; extra ==
|
39
|
-
|
31
|
+
Requires-Dist: coverage[toml]>=7.6.1; extra == 'dev'
|
32
|
+
Requires-Dist: mypy>=1.11.2; extra == 'dev'
|
33
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
|
34
|
+
Requires-Dist: pytest-mock>=3.14.0; extra == 'dev'
|
35
|
+
Requires-Dist: pytest>=8.3.2; extra == 'dev'
|
36
|
+
Requires-Dist: responses>=0.25.0; extra == 'dev'
|
37
|
+
Requires-Dist: ruff>=0.6.3; extra == 'dev'
|
38
|
+
Requires-Dist: types-click>=7.1.8; extra == 'dev'
|
39
|
+
Requires-Dist: types-requests>=2.31.0; extra == 'dev'
|
40
|
+
Description-Content-Type: text/markdown
|
40
41
|
|
41
42
|
<!--
|
42
43
|
SPDX-License-Identifier: Apache-2.0
|
@@ -140,6 +141,27 @@ with:
|
|
140
141
|
When allowed, duplicates generate warnings but processing continues.
|
141
142
|
The tool exits with code 3 when it detects duplicates and they are not allowed.
|
142
143
|
|
144
|
+
### Configuring duplicate detection scope
|
145
|
+
|
146
|
+
By default, the duplicate detector considers changes with status `open` when searching for potential duplicates.
|
147
|
+
You can customize which Gerrit change states to check using `--duplicate-types` or setting `DUPLICATE_TYPES`:
|
148
|
+
|
149
|
+
```bash
|
150
|
+
# CLI usage - check against open and merged changes
|
151
|
+
github2gerrit --duplicate-types=open,merged https://github.com/org/repo
|
152
|
+
|
153
|
+
# Environment variable
|
154
|
+
DUPLICATE_TYPES=open,merged,abandoned github2gerrit https://github.com/org/repo
|
155
|
+
|
156
|
+
# GitHub Actions
|
157
|
+
uses: onap/github2gerrit@main
|
158
|
+
with:
|
159
|
+
DUPLICATE_TYPES: 'open,merged'
|
160
|
+
```
|
161
|
+
|
162
|
+
Valid change states include `open`, `merged`, and `abandoned`. This setting determines which existing changes
|
163
|
+
to check when evaluating whether a new change would be a duplicate.
|
164
|
+
|
143
165
|
## Commit Message Normalization
|
144
166
|
|
145
167
|
The tool includes intelligent commit message normalization that automatically
|
@@ -309,6 +331,8 @@ jobs:
|
|
309
331
|
ORGANIZATION: ${{ github.repository_owner }}
|
310
332
|
REVIEWERS_EMAIL: ""
|
311
333
|
ISSUE_ID: "" # Optional: adds 'Issue-ID: ...' trailer to the commit message
|
334
|
+
# ISSUE_ID_LOOKUP: ${{ vars.ISSUE_ID_LOOKUP }} # Optional: enable JSON lookup
|
335
|
+
# ISSUE_ID_LOOKUP_JSON: ${{ vars.ISSUE_ID_LOOKUP_JSON }} # Optional: JSON lookup table
|
312
336
|
```
|
313
337
|
|
314
338
|
The action reads `.gitreview`. If `.gitreview` is absent, you must
|
@@ -368,6 +392,7 @@ Key options include:
|
|
368
392
|
- `--use-pr-as-commit`: Use PR title/body as commit message (`USE_PR_AS_COMMIT`)
|
369
393
|
- `--issue-id`: Add an Issue-ID trailer (e.g., "Issue-ID: ABC-123") to the commit message (`ISSUE_ID`)
|
370
394
|
- `--preserve-github-prs`: Don't close GitHub PRs after submission (`PRESERVE_GITHUB_PRS`)
|
395
|
+
- `--duplicate-types`: Configure which Gerrit change states to check for duplicates (`DUPLICATE_TYPES`)
|
371
396
|
|
372
397
|
For a complete list of all available options, see the [Inputs](#inputs) section.
|
373
398
|
|
@@ -403,13 +428,15 @@ Common issues and solutions:
|
|
403
428
|
|
404
429
|
2. **SSH Permission Denied**:
|
405
430
|
- Ensure `GERRIT_SSH_PRIVKEY_G2G` and `GERRIT_KNOWN_HOSTS` are properly set
|
406
|
-
- If you see "Permissions 0644 for 'gerrit_key' are too open", the action will automatically
|
407
|
-
authentication
|
431
|
+
- If you see "Permissions 0644 for 'gerrit_key' are too open", the action will automatically
|
432
|
+
try SSH agent authentication
|
408
433
|
- For persistent file permission issues, ensure `G2G_USE_SSH_AGENT=true` (default)
|
409
434
|
|
410
435
|
3. **Branch Not Found**: Check that the target branch exists in both GitHub and Gerrit
|
411
436
|
4. **Change-Id Issues**: Enable debug logging to see Change-Id generation and validation
|
412
|
-
5. **
|
437
|
+
5. **Account Not Found Errors**: If you see "Account '<Email@Domain.com>' not found",
|
438
|
+
ensure your Gerrit account email matches your git config email (case-sensitive).
|
439
|
+
6. **Gerrit API Errors**: Verify Gerrit server connectivity and project permissions
|
413
440
|
|
414
441
|
> **Note**: The tool displays configuration errors cleanly without Python tracebacks.
|
415
442
|
> If you see a traceback in the output, please report it as a bug.
|
@@ -592,8 +619,10 @@ alignment between action inputs, environment variables, and CLI flags:
|
|
592
619
|
| `ALLOW_DUPLICATES` | `ALLOW_DUPLICATES` | `--allow-duplicates` | No | `"false"` | Allow submitting duplicate changes without error |
|
593
620
|
| `CI_TESTING` | `CI_TESTING` | `--ci-testing` | No | `"false"` | Enable CI testing mode (overrides .gitreview) |
|
594
621
|
| `ISSUE_ID` | `ISSUE_ID` | `--issue-id` | No | `""` | Issue ID to include (e.g., ABC-123) |
|
622
|
+
| `ISSUE_ID_LOOKUP` | N/A | N/A | No | `"false"` | Enable Issue ID lookup via JSON table |
|
623
|
+
| `ISSUE_ID_LOOKUP_JSON` | N/A | N/A | No | `"{}"` | JSON mapping of GitHub actors to Issue IDs |
|
595
624
|
| `G2G_USE_SSH_AGENT` | `G2G_USE_SSH_AGENT` | N/A | No | `"true"` | Use SSH agent for authentication |
|
596
|
-
| `
|
625
|
+
| `DUPLICATE_TYPES` | `DUPLICATE_TYPES` | `--duplicate-types` | No | `"open"` | Comma-separated Gerrit change states to check for duplicate detection |
|
597
626
|
| `GERRIT_SERVER` | `GERRIT_SERVER` | `--gerrit-server` | No² | `""` | Gerrit server hostname (auto-derived if enabled) |
|
598
627
|
| `GERRIT_SERVER_PORT` | `GERRIT_SERVER_PORT` | `--gerrit-server-port` | No | `"29418"` | Gerrit SSH port |
|
599
628
|
| `GERRIT_PROJECT` | `GERRIT_PROJECT` | `--gerrit-project` | No² | `""` | Gerrit project name |
|
@@ -604,7 +633,7 @@ alignment between action inputs, environment variables, and CLI flags:
|
|
604
633
|
|
605
634
|
**Notes:**
|
606
635
|
|
607
|
-
1. Auto-derived when `G2G_ENABLE_DERIVATION=true` (default:
|
636
|
+
1. Auto-derived when `G2G_ENABLE_DERIVATION=true` (default: true in all contexts)
|
608
637
|
2. Optional if `.gitreview` file exists in repository
|
609
638
|
|
610
639
|
### Internal Environment Variables
|
@@ -614,7 +643,7 @@ The following environment variables control internal behavior but are not action
|
|
614
643
|
| Environment Variable | Description | Default |
|
615
644
|
|---------------------|-------------|---------|
|
616
645
|
| `G2G_LOG_LEVEL` | Logging level (DEBUG, INFO, WARNING, ERROR) | `"INFO"` |
|
617
|
-
| `G2G_ENABLE_DERIVATION` | Enable auto-derivation of Gerrit parameters | `"
|
646
|
+
| `G2G_ENABLE_DERIVATION` | Enable auto-derivation of Gerrit parameters | `"true"` |
|
618
647
|
| `G2G_CONFIG_PATH` | Path to organization configuration file | `~/.config/github2gerrit/config.ini` |
|
619
648
|
| `G2G_AUTO_SAVE_CONFIG` | Auto-save derived parameters to config | `"false"` (GitHub Actions), `"true"` (CLI) |
|
620
649
|
| `G2G_TARGET_URL` | Internal flag for direct URL mode | Set automatically |
|
@@ -680,6 +709,51 @@ variable.
|
|
680
709
|
**Note**: Unknown configuration keys will generate warnings to help catch typos
|
681
710
|
and missing functionality.
|
682
711
|
|
712
|
+
### Issue ID Lookup
|
713
|
+
|
714
|
+
> **Migration Note**: If you were using repository variables `ISSUE_ID_LOOKUP`
|
715
|
+
> and `ISSUE_ID_LOOKUP_JSON` directly, you now need to pass them as inputs to
|
716
|
+
> the action. See the example below.
|
717
|
+
|
718
|
+
The action supports automatic Issue ID resolution via JSON lookup when no
|
719
|
+
explicit `ISSUE_ID` exists:
|
720
|
+
|
721
|
+
```yaml
|
722
|
+
- uses: lfreleng-actions/github2gerrit-action@v1
|
723
|
+
with:
|
724
|
+
GERRIT_SSH_PRIVKEY_G2G: ${{ secrets.GERRIT_SSH_PRIVKEY_G2G }}
|
725
|
+
# Enable Issue ID lookup (pass repository variables as inputs)
|
726
|
+
ISSUE_ID_LOOKUP: ${{ vars.ISSUE_ID_LOOKUP }}
|
727
|
+
ISSUE_ID_LOOKUP_JSON: ${{ vars.ISSUE_ID_LOOKUP_JSON }}
|
728
|
+
# ... other inputs
|
729
|
+
```
|
730
|
+
|
731
|
+
**Setup Requirements:**
|
732
|
+
|
733
|
+
1. Set repository variables:
|
734
|
+
- `ISSUE_ID_LOOKUP`: `"true"` (enables lookup feature)
|
735
|
+
- `ISSUE_ID_LOOKUP_JSON`: JSON mapping of GitHub usernames to Issue IDs
|
736
|
+
|
737
|
+
2. **Example JSON format:**
|
738
|
+
|
739
|
+
```json
|
740
|
+
{
|
741
|
+
"dependabot[bot]": "AUTO-123",
|
742
|
+
"renovate[bot]": "AUTO-456",
|
743
|
+
"alice": "PROJ-789",
|
744
|
+
"bob": "PROJ-101"
|
745
|
+
}
|
746
|
+
```
|
747
|
+
|
748
|
+
**Lookup Logic:**
|
749
|
+
|
750
|
+
1. If `ISSUE_ID` input exists → use it directly
|
751
|
+
2. If `ISSUE_ID` is empty AND `ISSUE_ID_LOOKUP=true` → lookup using `github.actor`
|
752
|
+
3. If lookup fails → no Issue ID gets added (silent fallback)
|
753
|
+
|
754
|
+
This feature helps organizations automatically tag commits with
|
755
|
+
project-specific Issue IDs based on who creates the pull request.
|
756
|
+
|
683
757
|
## Behavior details
|
684
758
|
|
685
759
|
- Branch resolution
|
@@ -1,43 +1,3 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: github2gerrit
|
3
|
-
Version: 0.1.9
|
4
|
-
Summary: Submit a GitHub pull request to a Gerrit repository.
|
5
|
-
Author-email: Matthew Watkins <mwatkins@linuxfoundation.org>
|
6
|
-
License-Expression: Apache-2.0
|
7
|
-
Project-URL: Homepage, https://github.com/lfreleng-actions/github2gerrit
|
8
|
-
Project-URL: Repository, https://github.com/lfreleng-actions/github2gerrit
|
9
|
-
Project-URL: Issues, https://github.com/lfreleng-actions/github2gerrit/issues
|
10
|
-
Keywords: github,gerrit,ci,actions,typer,cli
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
12
|
-
Classifier: Environment :: Console
|
13
|
-
Classifier: Intended Audience :: Developers
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
15
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
18
|
-
Classifier: Programming Language :: Python :: 3.13
|
19
|
-
Classifier: Topic :: Software Development :: Build Tools
|
20
|
-
Classifier: Topic :: Software Development :: Version Control
|
21
|
-
Classifier: Typing :: Typed
|
22
|
-
Requires-Python: <3.14,>=3.11
|
23
|
-
Description-Content-Type: text/markdown
|
24
|
-
License-File: LICENSE
|
25
|
-
Requires-Dist: typer>=0.12.5
|
26
|
-
Requires-Dist: PyGithub>=2.3.0
|
27
|
-
Requires-Dist: pygerrit2>=2.0.0
|
28
|
-
Requires-Dist: git-review>=2.3.1
|
29
|
-
Requires-Dist: PyYAML>=6.0.1
|
30
|
-
Provides-Extra: dev
|
31
|
-
Requires-Dist: pytest>=8.3.2; extra == "dev"
|
32
|
-
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
33
|
-
Requires-Dist: coverage[toml]>=7.6.1; extra == "dev"
|
34
|
-
Requires-Dist: ruff>=0.6.3; extra == "dev"
|
35
|
-
Requires-Dist: mypy>=1.11.2; extra == "dev"
|
36
|
-
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
|
37
|
-
Requires-Dist: types-requests>=2.31.0; extra == "dev"
|
38
|
-
Requires-Dist: types-click>=7.1.8; extra == "dev"
|
39
|
-
Dynamic: license-file
|
40
|
-
|
41
1
|
<!--
|
42
2
|
SPDX-License-Identifier: Apache-2.0
|
43
3
|
SPDX-FileCopyrightText: 2025 The Linux Foundation
|
@@ -140,6 +100,27 @@ with:
|
|
140
100
|
When allowed, duplicates generate warnings but processing continues.
|
141
101
|
The tool exits with code 3 when it detects duplicates and they are not allowed.
|
142
102
|
|
103
|
+
### Configuring duplicate detection scope
|
104
|
+
|
105
|
+
By default, the duplicate detector considers changes with status `open` when searching for potential duplicates.
|
106
|
+
You can customize which Gerrit change states to check using `--duplicate-types` or setting `DUPLICATE_TYPES`:
|
107
|
+
|
108
|
+
```bash
|
109
|
+
# CLI usage - check against open and merged changes
|
110
|
+
github2gerrit --duplicate-types=open,merged https://github.com/org/repo
|
111
|
+
|
112
|
+
# Environment variable
|
113
|
+
DUPLICATE_TYPES=open,merged,abandoned github2gerrit https://github.com/org/repo
|
114
|
+
|
115
|
+
# GitHub Actions
|
116
|
+
uses: onap/github2gerrit@main
|
117
|
+
with:
|
118
|
+
DUPLICATE_TYPES: 'open,merged'
|
119
|
+
```
|
120
|
+
|
121
|
+
Valid change states include `open`, `merged`, and `abandoned`. This setting determines which existing changes
|
122
|
+
to check when evaluating whether a new change would be a duplicate.
|
123
|
+
|
143
124
|
## Commit Message Normalization
|
144
125
|
|
145
126
|
The tool includes intelligent commit message normalization that automatically
|
@@ -309,6 +290,8 @@ jobs:
|
|
309
290
|
ORGANIZATION: ${{ github.repository_owner }}
|
310
291
|
REVIEWERS_EMAIL: ""
|
311
292
|
ISSUE_ID: "" # Optional: adds 'Issue-ID: ...' trailer to the commit message
|
293
|
+
# ISSUE_ID_LOOKUP: ${{ vars.ISSUE_ID_LOOKUP }} # Optional: enable JSON lookup
|
294
|
+
# ISSUE_ID_LOOKUP_JSON: ${{ vars.ISSUE_ID_LOOKUP_JSON }} # Optional: JSON lookup table
|
312
295
|
```
|
313
296
|
|
314
297
|
The action reads `.gitreview`. If `.gitreview` is absent, you must
|
@@ -368,6 +351,7 @@ Key options include:
|
|
368
351
|
- `--use-pr-as-commit`: Use PR title/body as commit message (`USE_PR_AS_COMMIT`)
|
369
352
|
- `--issue-id`: Add an Issue-ID trailer (e.g., "Issue-ID: ABC-123") to the commit message (`ISSUE_ID`)
|
370
353
|
- `--preserve-github-prs`: Don't close GitHub PRs after submission (`PRESERVE_GITHUB_PRS`)
|
354
|
+
- `--duplicate-types`: Configure which Gerrit change states to check for duplicates (`DUPLICATE_TYPES`)
|
371
355
|
|
372
356
|
For a complete list of all available options, see the [Inputs](#inputs) section.
|
373
357
|
|
@@ -403,13 +387,15 @@ Common issues and solutions:
|
|
403
387
|
|
404
388
|
2. **SSH Permission Denied**:
|
405
389
|
- Ensure `GERRIT_SSH_PRIVKEY_G2G` and `GERRIT_KNOWN_HOSTS` are properly set
|
406
|
-
- If you see "Permissions 0644 for 'gerrit_key' are too open", the action will automatically
|
407
|
-
authentication
|
390
|
+
- If you see "Permissions 0644 for 'gerrit_key' are too open", the action will automatically
|
391
|
+
try SSH agent authentication
|
408
392
|
- For persistent file permission issues, ensure `G2G_USE_SSH_AGENT=true` (default)
|
409
393
|
|
410
394
|
3. **Branch Not Found**: Check that the target branch exists in both GitHub and Gerrit
|
411
395
|
4. **Change-Id Issues**: Enable debug logging to see Change-Id generation and validation
|
412
|
-
5. **
|
396
|
+
5. **Account Not Found Errors**: If you see "Account '<Email@Domain.com>' not found",
|
397
|
+
ensure your Gerrit account email matches your git config email (case-sensitive).
|
398
|
+
6. **Gerrit API Errors**: Verify Gerrit server connectivity and project permissions
|
413
399
|
|
414
400
|
> **Note**: The tool displays configuration errors cleanly without Python tracebacks.
|
415
401
|
> If you see a traceback in the output, please report it as a bug.
|
@@ -592,8 +578,10 @@ alignment between action inputs, environment variables, and CLI flags:
|
|
592
578
|
| `ALLOW_DUPLICATES` | `ALLOW_DUPLICATES` | `--allow-duplicates` | No | `"false"` | Allow submitting duplicate changes without error |
|
593
579
|
| `CI_TESTING` | `CI_TESTING` | `--ci-testing` | No | `"false"` | Enable CI testing mode (overrides .gitreview) |
|
594
580
|
| `ISSUE_ID` | `ISSUE_ID` | `--issue-id` | No | `""` | Issue ID to include (e.g., ABC-123) |
|
581
|
+
| `ISSUE_ID_LOOKUP` | N/A | N/A | No | `"false"` | Enable Issue ID lookup via JSON table |
|
582
|
+
| `ISSUE_ID_LOOKUP_JSON` | N/A | N/A | No | `"{}"` | JSON mapping of GitHub actors to Issue IDs |
|
595
583
|
| `G2G_USE_SSH_AGENT` | `G2G_USE_SSH_AGENT` | N/A | No | `"true"` | Use SSH agent for authentication |
|
596
|
-
| `
|
584
|
+
| `DUPLICATE_TYPES` | `DUPLICATE_TYPES` | `--duplicate-types` | No | `"open"` | Comma-separated Gerrit change states to check for duplicate detection |
|
597
585
|
| `GERRIT_SERVER` | `GERRIT_SERVER` | `--gerrit-server` | No² | `""` | Gerrit server hostname (auto-derived if enabled) |
|
598
586
|
| `GERRIT_SERVER_PORT` | `GERRIT_SERVER_PORT` | `--gerrit-server-port` | No | `"29418"` | Gerrit SSH port |
|
599
587
|
| `GERRIT_PROJECT` | `GERRIT_PROJECT` | `--gerrit-project` | No² | `""` | Gerrit project name |
|
@@ -604,7 +592,7 @@ alignment between action inputs, environment variables, and CLI flags:
|
|
604
592
|
|
605
593
|
**Notes:**
|
606
594
|
|
607
|
-
1. Auto-derived when `G2G_ENABLE_DERIVATION=true` (default:
|
595
|
+
1. Auto-derived when `G2G_ENABLE_DERIVATION=true` (default: true in all contexts)
|
608
596
|
2. Optional if `.gitreview` file exists in repository
|
609
597
|
|
610
598
|
### Internal Environment Variables
|
@@ -614,7 +602,7 @@ The following environment variables control internal behavior but are not action
|
|
614
602
|
| Environment Variable | Description | Default |
|
615
603
|
|---------------------|-------------|---------|
|
616
604
|
| `G2G_LOG_LEVEL` | Logging level (DEBUG, INFO, WARNING, ERROR) | `"INFO"` |
|
617
|
-
| `G2G_ENABLE_DERIVATION` | Enable auto-derivation of Gerrit parameters | `"
|
605
|
+
| `G2G_ENABLE_DERIVATION` | Enable auto-derivation of Gerrit parameters | `"true"` |
|
618
606
|
| `G2G_CONFIG_PATH` | Path to organization configuration file | `~/.config/github2gerrit/config.ini` |
|
619
607
|
| `G2G_AUTO_SAVE_CONFIG` | Auto-save derived parameters to config | `"false"` (GitHub Actions), `"true"` (CLI) |
|
620
608
|
| `G2G_TARGET_URL` | Internal flag for direct URL mode | Set automatically |
|
@@ -680,6 +668,51 @@ variable.
|
|
680
668
|
**Note**: Unknown configuration keys will generate warnings to help catch typos
|
681
669
|
and missing functionality.
|
682
670
|
|
671
|
+
### Issue ID Lookup
|
672
|
+
|
673
|
+
> **Migration Note**: If you were using repository variables `ISSUE_ID_LOOKUP`
|
674
|
+
> and `ISSUE_ID_LOOKUP_JSON` directly, you now need to pass them as inputs to
|
675
|
+
> the action. See the example below.
|
676
|
+
|
677
|
+
The action supports automatic Issue ID resolution via JSON lookup when no
|
678
|
+
explicit `ISSUE_ID` exists:
|
679
|
+
|
680
|
+
```yaml
|
681
|
+
- uses: lfreleng-actions/github2gerrit-action@v1
|
682
|
+
with:
|
683
|
+
GERRIT_SSH_PRIVKEY_G2G: ${{ secrets.GERRIT_SSH_PRIVKEY_G2G }}
|
684
|
+
# Enable Issue ID lookup (pass repository variables as inputs)
|
685
|
+
ISSUE_ID_LOOKUP: ${{ vars.ISSUE_ID_LOOKUP }}
|
686
|
+
ISSUE_ID_LOOKUP_JSON: ${{ vars.ISSUE_ID_LOOKUP_JSON }}
|
687
|
+
# ... other inputs
|
688
|
+
```
|
689
|
+
|
690
|
+
**Setup Requirements:**
|
691
|
+
|
692
|
+
1. Set repository variables:
|
693
|
+
- `ISSUE_ID_LOOKUP`: `"true"` (enables lookup feature)
|
694
|
+
- `ISSUE_ID_LOOKUP_JSON`: JSON mapping of GitHub usernames to Issue IDs
|
695
|
+
|
696
|
+
2. **Example JSON format:**
|
697
|
+
|
698
|
+
```json
|
699
|
+
{
|
700
|
+
"dependabot[bot]": "AUTO-123",
|
701
|
+
"renovate[bot]": "AUTO-456",
|
702
|
+
"alice": "PROJ-789",
|
703
|
+
"bob": "PROJ-101"
|
704
|
+
}
|
705
|
+
```
|
706
|
+
|
707
|
+
**Lookup Logic:**
|
708
|
+
|
709
|
+
1. If `ISSUE_ID` input exists → use it directly
|
710
|
+
2. If `ISSUE_ID` is empty AND `ISSUE_ID_LOOKUP=true` → lookup using `github.actor`
|
711
|
+
3. If lookup fails → no Issue ID gets added (silent fallback)
|
712
|
+
|
713
|
+
This feature helps organizations automatically tag commits with
|
714
|
+
project-specific Issue IDs based on who creates the pull request.
|
715
|
+
|
683
716
|
## Behavior details
|
684
717
|
|
685
718
|
- Branch resolution
|