github2gerrit 0.1.10__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.10 → github2gerrit-0.1.11}/.pre-commit-config.yaml +5 -4
- github2gerrit-0.1.11/LICENSE +1 -0
- {github2gerrit-0.1.10/src/github2gerrit.egg-info → github2gerrit-0.1.11}/PKG-INFO +76 -24
- github2gerrit-0.1.10/PKG-INFO → github2gerrit-0.1.11/README.md +56 -45
- github2gerrit-0.1.11/REVISION_PLAN.md +387 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/action.yaml +12 -5
- github2gerrit-0.1.11/docs/COMPOSITE_ACTION_TESTING.md +219 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/pyproject.toml +59 -9
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/sitecustomize.py +7 -2
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/cli.py +793 -198
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/commit_normalization.py +44 -15
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/config.py +76 -30
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/core.py +1571 -267
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/duplicate_detection.py +222 -98
- {github2gerrit-0.1.10 → 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.10 → github2gerrit-0.1.11}/src/github2gerrit/gerrit_rest.py +53 -18
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/gerrit_urls.py +90 -33
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/github_api.py +19 -6
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/gitutils.py +43 -14
- github2gerrit-0.1.11/src/github2gerrit/mapping_comment.py +345 -0
- {github2gerrit-0.1.10 → 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.10 → 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.10 → github2gerrit-0.1.11}/src/github2gerrit/similarity.py +65 -19
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/ssh_agent_setup.py +59 -22
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/ssh_common.py +30 -11
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/ssh_discovery.py +67 -20
- github2gerrit-0.1.11/src/github2gerrit/trailers.py +340 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/utils.py +6 -2
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/conftest.py +16 -6
- {github2gerrit-0.1.10 → 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.10 → github2gerrit-0.1.11}/tests/test_change_id_deduplication.py +68 -23
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_cli.py +91 -35
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_cli_helpers.py +14 -15
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_cli_outputs_file.py +75 -16
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_cli_url_and_dryrun.py +43 -5
- {github2gerrit-0.1.10 → 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.10 → github2gerrit-0.1.11}/tests/test_config_and_reviewers.py +5 -2
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_config_helpers.py +93 -32
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_core_close_pr_policy.py +21 -7
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_core_config_and_errors.py +54 -18
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_core_gerrit_backref_comment.py +18 -6
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_core_gerrit_push_errors.py +22 -10
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_core_gerrit_rest_results.py +35 -12
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_core_integration_fixture_repo.py +8 -3
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_core_prepare_commits.py +57 -19
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_core_ssh_setup.py +73 -24
- {github2gerrit-0.1.10 → 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.10 → github2gerrit-0.1.11}/tests/test_external_api_framework.py +33 -11
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_gerrit_change_id_footer.py +66 -17
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_gerrit_rest_client.py +39 -13
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_gerrit_urls.py +136 -36
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_gerrit_urls_more.py +83 -26
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_ghe_and_gitreview_args.py +18 -6
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_github_api_helpers.py +8 -3
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_github_api_retry_and_helpers.py +3 -1
- {github2gerrit-0.1.10 → 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.10 → 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.10 → github2gerrit-0.1.11}/tests/test_pr_content_filter.py +17 -6
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_pr_content_filter_integration.py +42 -16
- 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.10 → github2gerrit-0.1.11}/tests/test_ssh_agent.py +84 -27
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_ssh_common.py +18 -6
- {github2gerrit-0.1.10 → 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.10 → github2gerrit-0.1.11}/tests/test_url_parser.py +3 -1
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/tests/test_utils.py +110 -23
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/uv.lock +80 -0
- github2gerrit-0.1.10/.github/actionlint.yaml +0 -11
- github2gerrit-0.1.10/.github/dependabot.yml +0 -12
- github2gerrit-0.1.10/.github/release-drafter.yml +0 -68
- github2gerrit-0.1.10/.github/workflows/build-test-release.yaml +0 -324
- github2gerrit-0.1.10/.github/workflows/build-test.yaml +0 -108
- github2gerrit-0.1.10/.github/workflows/dependencies.yaml +0 -47
- github2gerrit-0.1.10/.github/workflows/github2gerrit.yaml +0 -221
- github2gerrit-0.1.10/.github/workflows/release-drafter.yaml +0 -63
- github2gerrit-0.1.10/.github/workflows/semantic-pull-request.yaml +0 -55
- github2gerrit-0.1.10/.github/workflows/sha-pinned-actions.yaml +0 -29
- github2gerrit-0.1.10/.github/workflows/testing.yaml +0 -305
- github2gerrit-0.1.10/LICENSE +0 -201
- github2gerrit-0.1.10/README.md +0 -780
- github2gerrit-0.1.10/setup.cfg +0 -4
- github2gerrit-0.1.10/src/github2gerrit.egg-info/SOURCES.txt +0 -88
- github2gerrit-0.1.10/src/github2gerrit.egg-info/dependency_links.txt +0 -1
- github2gerrit-0.1.10/src/github2gerrit.egg-info/entry_points.txt +0 -2
- github2gerrit-0.1.10/src/github2gerrit.egg-info/requires.txt +0 -15
- github2gerrit-0.1.10/src/github2gerrit.egg-info/top_level.txt +0 -1
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/.editorconfig +0 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/.gitignore +0 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/.gitlint +0 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/.markdownlint.yaml +0 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/.readthedocs.yml +0 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/.yamllint +0 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/LICENSES/Apache-2.0.txt +0 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/REUSE.toml +0 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/docs/github2gerrit_token_permissions_classic.png +0 -0
- {github2gerrit-0.1.10 → github2gerrit-0.1.11}/src/github2gerrit/__init__.py +0 -0
- {github2gerrit-0.1.10 → 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
|
@@ -330,6 +331,8 @@ jobs:
|
|
330
331
|
ORGANIZATION: ${{ github.repository_owner }}
|
331
332
|
REVIEWERS_EMAIL: ""
|
332
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
|
333
336
|
```
|
334
337
|
|
335
338
|
The action reads `.gitreview`. If `.gitreview` is absent, you must
|
@@ -425,13 +428,15 @@ Common issues and solutions:
|
|
425
428
|
|
426
429
|
2. **SSH Permission Denied**:
|
427
430
|
- Ensure `GERRIT_SSH_PRIVKEY_G2G` and `GERRIT_KNOWN_HOSTS` are properly set
|
428
|
-
- If you see "Permissions 0644 for 'gerrit_key' are too open", the action will automatically
|
429
|
-
authentication
|
431
|
+
- If you see "Permissions 0644 for 'gerrit_key' are too open", the action will automatically
|
432
|
+
try SSH agent authentication
|
430
433
|
- For persistent file permission issues, ensure `G2G_USE_SSH_AGENT=true` (default)
|
431
434
|
|
432
435
|
3. **Branch Not Found**: Check that the target branch exists in both GitHub and Gerrit
|
433
436
|
4. **Change-Id Issues**: Enable debug logging to see Change-Id generation and validation
|
434
|
-
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
|
435
440
|
|
436
441
|
> **Note**: The tool displays configuration errors cleanly without Python tracebacks.
|
437
442
|
> If you see a traceback in the output, please report it as a bug.
|
@@ -614,6 +619,8 @@ alignment between action inputs, environment variables, and CLI flags:
|
|
614
619
|
| `ALLOW_DUPLICATES` | `ALLOW_DUPLICATES` | `--allow-duplicates` | No | `"false"` | Allow submitting duplicate changes without error |
|
615
620
|
| `CI_TESTING` | `CI_TESTING` | `--ci-testing` | No | `"false"` | Enable CI testing mode (overrides .gitreview) |
|
616
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 |
|
617
624
|
| `G2G_USE_SSH_AGENT` | `G2G_USE_SSH_AGENT` | N/A | No | `"true"` | Use SSH agent for authentication |
|
618
625
|
| `DUPLICATE_TYPES` | `DUPLICATE_TYPES` | `--duplicate-types` | No | `"open"` | Comma-separated Gerrit change states to check for duplicate detection |
|
619
626
|
| `GERRIT_SERVER` | `GERRIT_SERVER` | `--gerrit-server` | No² | `""` | Gerrit server hostname (auto-derived if enabled) |
|
@@ -626,7 +633,7 @@ alignment between action inputs, environment variables, and CLI flags:
|
|
626
633
|
|
627
634
|
**Notes:**
|
628
635
|
|
629
|
-
1. Auto-derived when `G2G_ENABLE_DERIVATION=true` (default:
|
636
|
+
1. Auto-derived when `G2G_ENABLE_DERIVATION=true` (default: true in all contexts)
|
630
637
|
2. Optional if `.gitreview` file exists in repository
|
631
638
|
|
632
639
|
### Internal Environment Variables
|
@@ -636,7 +643,7 @@ The following environment variables control internal behavior but are not action
|
|
636
643
|
| Environment Variable | Description | Default |
|
637
644
|
|---------------------|-------------|---------|
|
638
645
|
| `G2G_LOG_LEVEL` | Logging level (DEBUG, INFO, WARNING, ERROR) | `"INFO"` |
|
639
|
-
| `G2G_ENABLE_DERIVATION` | Enable auto-derivation of Gerrit parameters | `"
|
646
|
+
| `G2G_ENABLE_DERIVATION` | Enable auto-derivation of Gerrit parameters | `"true"` |
|
640
647
|
| `G2G_CONFIG_PATH` | Path to organization configuration file | `~/.config/github2gerrit/config.ini` |
|
641
648
|
| `G2G_AUTO_SAVE_CONFIG` | Auto-save derived parameters to config | `"false"` (GitHub Actions), `"true"` (CLI) |
|
642
649
|
| `G2G_TARGET_URL` | Internal flag for direct URL mode | Set automatically |
|
@@ -702,6 +709,51 @@ variable.
|
|
702
709
|
**Note**: Unknown configuration keys will generate warnings to help catch typos
|
703
710
|
and missing functionality.
|
704
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
|
+
|
705
757
|
## Behavior details
|
706
758
|
|
707
759
|
- Branch resolution
|
@@ -1,43 +1,3 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: github2gerrit
|
3
|
-
Version: 0.1.10
|
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
|
@@ -330,6 +290,8 @@ jobs:
|
|
330
290
|
ORGANIZATION: ${{ github.repository_owner }}
|
331
291
|
REVIEWERS_EMAIL: ""
|
332
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
|
333
295
|
```
|
334
296
|
|
335
297
|
The action reads `.gitreview`. If `.gitreview` is absent, you must
|
@@ -425,13 +387,15 @@ Common issues and solutions:
|
|
425
387
|
|
426
388
|
2. **SSH Permission Denied**:
|
427
389
|
- Ensure `GERRIT_SSH_PRIVKEY_G2G` and `GERRIT_KNOWN_HOSTS` are properly set
|
428
|
-
- If you see "Permissions 0644 for 'gerrit_key' are too open", the action will automatically
|
429
|
-
authentication
|
390
|
+
- If you see "Permissions 0644 for 'gerrit_key' are too open", the action will automatically
|
391
|
+
try SSH agent authentication
|
430
392
|
- For persistent file permission issues, ensure `G2G_USE_SSH_AGENT=true` (default)
|
431
393
|
|
432
394
|
3. **Branch Not Found**: Check that the target branch exists in both GitHub and Gerrit
|
433
395
|
4. **Change-Id Issues**: Enable debug logging to see Change-Id generation and validation
|
434
|
-
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
|
435
399
|
|
436
400
|
> **Note**: The tool displays configuration errors cleanly without Python tracebacks.
|
437
401
|
> If you see a traceback in the output, please report it as a bug.
|
@@ -614,6 +578,8 @@ alignment between action inputs, environment variables, and CLI flags:
|
|
614
578
|
| `ALLOW_DUPLICATES` | `ALLOW_DUPLICATES` | `--allow-duplicates` | No | `"false"` | Allow submitting duplicate changes without error |
|
615
579
|
| `CI_TESTING` | `CI_TESTING` | `--ci-testing` | No | `"false"` | Enable CI testing mode (overrides .gitreview) |
|
616
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 |
|
617
583
|
| `G2G_USE_SSH_AGENT` | `G2G_USE_SSH_AGENT` | N/A | No | `"true"` | Use SSH agent for authentication |
|
618
584
|
| `DUPLICATE_TYPES` | `DUPLICATE_TYPES` | `--duplicate-types` | No | `"open"` | Comma-separated Gerrit change states to check for duplicate detection |
|
619
585
|
| `GERRIT_SERVER` | `GERRIT_SERVER` | `--gerrit-server` | No² | `""` | Gerrit server hostname (auto-derived if enabled) |
|
@@ -626,7 +592,7 @@ alignment between action inputs, environment variables, and CLI flags:
|
|
626
592
|
|
627
593
|
**Notes:**
|
628
594
|
|
629
|
-
1. Auto-derived when `G2G_ENABLE_DERIVATION=true` (default:
|
595
|
+
1. Auto-derived when `G2G_ENABLE_DERIVATION=true` (default: true in all contexts)
|
630
596
|
2. Optional if `.gitreview` file exists in repository
|
631
597
|
|
632
598
|
### Internal Environment Variables
|
@@ -636,7 +602,7 @@ The following environment variables control internal behavior but are not action
|
|
636
602
|
| Environment Variable | Description | Default |
|
637
603
|
|---------------------|-------------|---------|
|
638
604
|
| `G2G_LOG_LEVEL` | Logging level (DEBUG, INFO, WARNING, ERROR) | `"INFO"` |
|
639
|
-
| `G2G_ENABLE_DERIVATION` | Enable auto-derivation of Gerrit parameters | `"
|
605
|
+
| `G2G_ENABLE_DERIVATION` | Enable auto-derivation of Gerrit parameters | `"true"` |
|
640
606
|
| `G2G_CONFIG_PATH` | Path to organization configuration file | `~/.config/github2gerrit/config.ini` |
|
641
607
|
| `G2G_AUTO_SAVE_CONFIG` | Auto-save derived parameters to config | `"false"` (GitHub Actions), `"true"` (CLI) |
|
642
608
|
| `G2G_TARGET_URL` | Internal flag for direct URL mode | Set automatically |
|
@@ -702,6 +668,51 @@ variable.
|
|
702
668
|
**Note**: Unknown configuration keys will generate warnings to help catch typos
|
703
669
|
and missing functionality.
|
704
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
|
+
|
705
716
|
## Behavior details
|
706
717
|
|
707
718
|
- Branch resolution
|