github2gerrit 0.1.9__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.
@@ -1,13 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: github2gerrit
3
- Version: 0.1.9
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
- Keywords: github,gerrit,ci,actions,typer,cli
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: PyYAML>=6.0.1
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: 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
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 try SSH agent
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. **Gerrit API Errors**: Verify Gerrit server connectivity and project permissions
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
- | `DUPLICATES` | `DUPLICATES` | `--duplicates` | No | `"open"` | Comma-separated Gerrit statuses for duplicate detection |
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: false in GitHub Actions, true in CLI)
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 | `"false"` (GitHub Actions), `"true"` (CLI) |
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
@@ -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,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -1,24 +0,0 @@
1
- github2gerrit/__init__.py,sha256=N1Vj1HJ28LKCJLAynQdm5jFGQQAz9YSMzZhEfvbBgow,886
2
- github2gerrit/cli.py,sha256=ClwCOtMl9eecobeN6Bb1GFQ_E-kbILdxKFE89Vtvai4,45865
3
- github2gerrit/commit_normalization.py,sha256=u4AZigz3qOpz5XYpUOq3WUqsY-o08YrkgaT160eyIIs,16594
4
- github2gerrit/config.py,sha256=uRVVcofzojTayA8AyM_3rgSFsV0fWGjixWmK48aZsRA,21471
5
- github2gerrit/core.py,sha256=Mjo_TNocFE5HDmRTxh54LEHAEw5y1u6lc1qItEZ76GA,105180
6
- github2gerrit/duplicate_detection.py,sha256=5j6EDz2P3GnnT2JkR1tGbzWCjA6TV0l5VjsEMs-tfCM,26544
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=xPqdypI-Fmpeb74K4lcqZBxj17i8avS_x73dXckeicA,15268
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.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
20
- github2gerrit-0.1.9.dist-info/METADATA,sha256=QlTEhsWuTU9Yxim1Z__-aMr6GcGWmBzpcczbqzEyBNU,31006
21
- github2gerrit-0.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- github2gerrit-0.1.9.dist-info/entry_points.txt,sha256=MxN2_liIKo3-xJwtAulAeS5GcOS6JS96nvwOQIkP3W8,56
23
- github2gerrit-0.1.9.dist-info/top_level.txt,sha256=bWTYXjvuu4sSU90KLT1JlnjD7xV_iXZ-vKoulpjLTy8,14
24
- github2gerrit-0.1.9.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- github2gerrit