github2gerrit 0.1.10__py3-none-any.whl → 0.1.11__py3-none-any.whl
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/cli.py +793 -198
- github2gerrit/commit_normalization.py +44 -15
- github2gerrit/config.py +76 -30
- github2gerrit/core.py +1571 -267
- github2gerrit/duplicate_detection.py +222 -98
- github2gerrit/external_api.py +76 -25
- github2gerrit/gerrit_query.py +286 -0
- github2gerrit/gerrit_rest.py +53 -18
- github2gerrit/gerrit_urls.py +90 -33
- github2gerrit/github_api.py +19 -6
- github2gerrit/gitutils.py +43 -14
- github2gerrit/mapping_comment.py +345 -0
- github2gerrit/models.py +15 -1
- github2gerrit/orchestrator/__init__.py +25 -0
- github2gerrit/orchestrator/reconciliation.py +589 -0
- github2gerrit/pr_content_filter.py +65 -17
- github2gerrit/reconcile_matcher.py +595 -0
- github2gerrit/rich_display.py +502 -0
- github2gerrit/rich_logging.py +316 -0
- github2gerrit/similarity.py +65 -19
- github2gerrit/ssh_agent_setup.py +59 -22
- github2gerrit/ssh_common.py +30 -11
- github2gerrit/ssh_discovery.py +67 -20
- github2gerrit/trailers.py +340 -0
- github2gerrit/utils.py +6 -2
- {github2gerrit-0.1.10.dist-info → github2gerrit-0.1.11.dist-info}/METADATA +76 -24
- github2gerrit-0.1.11.dist-info/RECORD +31 -0
- {github2gerrit-0.1.10.dist-info → github2gerrit-0.1.11.dist-info}/WHEEL +1 -2
- github2gerrit-0.1.10.dist-info/RECORD +0 -24
- github2gerrit-0.1.10.dist-info/top_level.txt +0 -1
- {github2gerrit-0.1.10.dist-info → github2gerrit-0.1.11.dist-info}/entry_points.txt +0 -0
- {github2gerrit-0.1.10.dist-info → github2gerrit-0.1.11.dist-info}/licenses/LICENSE +0 -0
@@ -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
|
@@ -0,0 +1,31 @@
|
|
1
|
+
github2gerrit/__init__.py,sha256=N1Vj1HJ28LKCJLAynQdm5jFGQQAz9YSMzZhEfvbBgow,886
|
2
|
+
github2gerrit/cli.py,sha256=iI-e229TOuDKEA9NJ7mDTLr96aJDuRnEnCOXJ4l645k,65285
|
3
|
+
github2gerrit/commit_normalization.py,sha256=5HqUJ7p3WQzUYNTkganIsu82aW1wZrh7J7ivQvdCYXw,17033
|
4
|
+
github2gerrit/config.py,sha256=khuXAfmOc2wqO4r1Cpp8PYk04AO-JpmnJvSWQZ3fdL8,22315
|
5
|
+
github2gerrit/core.py,sha256=bu65-_fJ53Nd2P9FeYt0iIeAEI8t3Yd6db8J1ZAQCLk,147167
|
6
|
+
github2gerrit/duplicate_detection.py,sha256=FaYtftmABdNofdZIi-kfgI4DlWvfvDS87gLj7hx0Jvo,29152
|
7
|
+
github2gerrit/external_api.py,sha256=9483kkgIs1ECOl_f0lcGb8GrJQF9IfYmWfBQwUJT9hk,18480
|
8
|
+
github2gerrit/gerrit_query.py,sha256=7AR9UEwZxtTb9V-l17UDdtWvlvROlnIeJVMa57ilf6s,8343
|
9
|
+
github2gerrit/gerrit_rest.py,sha256=Yv1a0vqEuP1dvx16AB6BKSOb01o3FfOxEVzRzTND6gE,11009
|
10
|
+
github2gerrit/gerrit_urls.py,sha256=aoPuUOCysHffVr9qkBRIPCZEUoSBMHmfviydy1U1uSQ,13843
|
11
|
+
github2gerrit/github_api.py,sha256=3aexJhZy-YlodwX7YuLubaZAa2qR8OOcgRwrZHK_a_g,8565
|
12
|
+
github2gerrit/gitutils.py,sha256=yNV1Nxa5VVYItc9DuNf5xLmwu-OBzwMANxYV151fpqk,26456
|
13
|
+
github2gerrit/mapping_comment.py,sha256=5d37Xtqa7yU9PqIpjMrvPpNfHqdomtJJhs2exqRM8e0,9597
|
14
|
+
github2gerrit/models.py,sha256=oOznuagfEXxvkiXRyLSB9h3CsWqmCjkPHPrat7AiMcs,2446
|
15
|
+
github2gerrit/pr_content_filter.py,sha256=Brgf1HoGzdvQR5OrikuNCrbNout8kxwmds2AiHzEF6U,17990
|
16
|
+
github2gerrit/reconcile_matcher.py,sha256=UpFAGqOD0NSKJKqKN_ErpNtqG0MEXxVEMywnKWcNnnI,20185
|
17
|
+
github2gerrit/rich_display.py,sha256=hA2lXdbG3FOPozI_JTyU52o67oCS9LMUyc2odEpaAjo,15466
|
18
|
+
github2gerrit/rich_logging.py,sha256=AEcPksmg2kj3eFOZHuU-_kWzGCKh-m__ZgDzwECBtaY,10281
|
19
|
+
github2gerrit/similarity.py,sha256=-YHnscTrVh1jdfA3JRLPkbVjaZ5FpFdmXe8UPlTG1ss,15888
|
20
|
+
github2gerrit/ssh_agent_setup.py,sha256=Wni94Zs86AVYalmVKfZ8lRzBnWybtJUwDltdpMC4Qnw,12864
|
21
|
+
github2gerrit/ssh_common.py,sha256=ClABtIqXiYIfUn58Shw7uHZ6Ham1ysHn0EpcUHjQ8D8,8261
|
22
|
+
github2gerrit/ssh_discovery.py,sha256=jz5sn8Eiehr1QtR8zDTyQ7dZ_w54WC8km8y0cDbHaDg,13496
|
23
|
+
github2gerrit/trailers.py,sha256=9w0vIxPNBNQp56sIy-MF62d22Rm6vY-msh9ao1lX0rQ,8384
|
24
|
+
github2gerrit/utils.py,sha256=1CKTsQo_FO3eyVjzNUT3XyFnyObIxyEFLeSmVKzavVo,3397
|
25
|
+
github2gerrit/orchestrator/__init__.py,sha256=HAEcdCAHOFr8LsdIwAdcIcFZn_ayMbX9rdVUULp8410,864
|
26
|
+
github2gerrit/orchestrator/reconciliation.py,sha256=qLhmjnIblSa_PVmBblWJ1gSvJ6Gto2AIVOVdYvT6zbk,18364
|
27
|
+
github2gerrit-0.1.11.dist-info/METADATA,sha256=7sk9TSOqHuH00NaJQl3Sv6zUv66ZAr17BZZFb9Rn3iw,33833
|
28
|
+
github2gerrit-0.1.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
29
|
+
github2gerrit-0.1.11.dist-info/entry_points.txt,sha256=MxN2_liIKo3-xJwtAulAeS5GcOS6JS96nvwOQIkP3W8,56
|
30
|
+
github2gerrit-0.1.11.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
31
|
+
github2gerrit-0.1.11.dist-info/RECORD,,
|
@@ -1,24 +0,0 @@
|
|
1
|
-
github2gerrit/__init__.py,sha256=N1Vj1HJ28LKCJLAynQdm5jFGQQAz9YSMzZhEfvbBgow,886
|
2
|
-
github2gerrit/cli.py,sha256=WlEOfomSxXOvSbN58ti2J-R4PA9_ZV6ZbyHQDC_JUQs,45980
|
3
|
-
github2gerrit/commit_normalization.py,sha256=u4AZigz3qOpz5XYpUOq3WUqsY-o08YrkgaT160eyIIs,16594
|
4
|
-
github2gerrit/config.py,sha256=Jxo2q9qZZwEWc_kLYnO_hJ9ToSthYlyYxQnmN_yJRcY,21494
|
5
|
-
github2gerrit/core.py,sha256=4BDh4jm7gjDcVEIrY_3xkrMomDypdp8KYKRdkjugEGs,105660
|
6
|
-
github2gerrit/duplicate_detection.py,sha256=_CHVCaxqLoDBuk3wq2SIsekPtqRzmOwCZTQfe2ZbVgI,26554
|
7
|
-
github2gerrit/external_api.py,sha256=EVHh__v6lRq_ojpBI_nkGZ31AQSZ9NG8tDqVUid23XY,17638
|
8
|
-
github2gerrit/gerrit_rest.py,sha256=NmC95hb2hLpnko8Uu3OwPEKktNv-k3qrmuA7A2q-H0Y,10562
|
9
|
-
github2gerrit/gerrit_urls.py,sha256=pw4rjIQeQ-i-vbPqsOZjZpdz7FO03pnMUMWc8L9Mcic,12893
|
10
|
-
github2gerrit/github_api.py,sha256=6S9DRt-Dza78cgxQwZ3_ujI0yPPozDGBIKnYgHan760,8388
|
11
|
-
github2gerrit/gitutils.py,sha256=3ob1K7dlKeWYYYOPXIIJ56p2N49lm1yj8XHHg2zSlhw,25929
|
12
|
-
github2gerrit/models.py,sha256=sRS4rPMF_wjV19HMFTzhHXFMfsLFzm9TFb1JydJsSyQ,1875
|
13
|
-
github2gerrit/pr_content_filter.py,sha256=w4MqSZ4uLX-3Da1DL_A56zVQa7xJ4h5jHMNteOOG2AE,16896
|
14
|
-
github2gerrit/similarity.py,sha256=Gf8xDQzDDsgauhYNGueUFaQRnzt7PJ27AaLVo-Bpa7M,15332
|
15
|
-
github2gerrit/ssh_agent_setup.py,sha256=fvKuMdF9Hv5ioaSu_alzLcjeoQLGGFRLS2wb46KdNzE,11889
|
16
|
-
github2gerrit/ssh_common.py,sha256=f0QQmnj6yIW74N3ZjGkYmJryEstjEOmq41EIXOZdGTM,8102
|
17
|
-
github2gerrit/ssh_discovery.py,sha256=zH0tX9VN1pn8DLM1J9QQquoKBhA9gk5drXHvMSHNNLg,13021
|
18
|
-
github2gerrit/utils.py,sha256=ADE5YZe1h3PB3cgfxbsCuYU-Xs-1CMHrDHxfIdariFE,3369
|
19
|
-
github2gerrit-0.1.10.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
20
|
-
github2gerrit-0.1.10.dist-info/METADATA,sha256=D3HNkThf9wbgtqo-K0SxaaT0DLaLW20fA2CMFFi6vn4,31914
|
21
|
-
github2gerrit-0.1.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
22
|
-
github2gerrit-0.1.10.dist-info/entry_points.txt,sha256=MxN2_liIKo3-xJwtAulAeS5GcOS6JS96nvwOQIkP3W8,56
|
23
|
-
github2gerrit-0.1.10.dist-info/top_level.txt,sha256=bWTYXjvuu4sSU90KLT1JlnjD7xV_iXZ-vKoulpjLTy8,14
|
24
|
-
github2gerrit-0.1.10.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
github2gerrit
|
File without changes
|
File without changes
|