github2gerrit 0.1.14__tar.gz → 0.1.16__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.14 → github2gerrit-0.1.16}/PKG-INFO +1 -1
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/action.yaml +7 -2
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/cli.py +56 -3
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/core.py +611 -28
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/ssh_agent_setup.py +40 -6
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_core_ssh_setup.py +37 -28
- github2gerrit-0.1.16/tests/test_metadata_trailer_separation_bug.py +323 -0
- github2gerrit-0.1.16/tests/test_ssh_artifact_prevention.py +357 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/.editorconfig +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/.gitignore +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/.gitlint +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/.markdownlint.yaml +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/.pre-commit-config.yaml +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/.readthedocs.yml +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/.yamllint +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/LICENSE +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/LICENSES/Apache-2.0.txt +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/README.md +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/REUSE.toml +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/REVISION_PLAN.md +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/docs/COMPOSITE_ACTION_TESTING.md +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/docs/github2gerrit_token_permissions_classic.png +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/pyproject.toml +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/sitecustomize.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/__init__.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/commit_normalization.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/config.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/duplicate_detection.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/external_api.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/gerrit_query.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/gerrit_rest.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/gerrit_urls.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/github_api.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/gitutils.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/mapping_comment.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/models.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/orchestrator/__init__.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/orchestrator/reconciliation.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/pr_content_filter.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/reconcile_matcher.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/rich_display.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/rich_logging.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/similarity.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/ssh_common.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/ssh_discovery.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/trailers.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/src/github2gerrit/utils.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/conftest.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/fixtures/__init__.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/fixtures/make_repo.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_action_environment_mapping.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_action_outputs.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_action_pr_number_handling.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_action_step_validation.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_change_id_deduplication.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_cli.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_cli_helpers.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_cli_outputs_file.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_cli_url_and_dryrun.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_commit_normalization.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_composite_action_coverage.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_config_and_reviewers.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_config_helpers.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_core_close_pr_policy.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_core_config_and_errors.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_core_gerrit_backref_comment.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_core_gerrit_push_errors.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_core_gerrit_rest_results.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_core_integration_fixture_repo.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_core_prepare_commits.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_duplicate_detection.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_email_case_normalization.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_external_api_framework.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_gerrit_change_id_footer.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_gerrit_rest_client.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_gerrit_urls.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_gerrit_urls_more.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_ghe_and_gitreview_args.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_github_api_helpers.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_github_api_retry_and_helpers.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_gitutils_helpers.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_mapping_comment_additional.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_mapping_comment_digest_and_backref.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_metadata_and_reconciliation.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_misc_small_coverage.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_orphan_rest_side_effects.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_pr_content_filter.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_pr_content_filter_integration.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_reconciliation_extracted_module.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_reconciliation_plan_and_orphans.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_reconciliation_scenarios.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_ssh_agent.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_ssh_common.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_ssh_discovery.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_trailers_additional.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_url_parser.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/tests/test_utils.py +0 -0
- {github2gerrit-0.1.14 → github2gerrit-0.1.16}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: github2gerrit
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.16
|
4
4
|
Summary: Submit a GitHub pull request to a Gerrit repository.
|
5
5
|
Project-URL: Homepage, https://github.com/lfreleng-actions/github2gerrit
|
6
6
|
Project-URL: Repository, https://github.com/lfreleng-actions/github2gerrit
|
@@ -81,6 +81,10 @@ inputs:
|
|
81
81
|
description: "Normalize commit messages to conventional commit format"
|
82
82
|
required: false
|
83
83
|
default: "false"
|
84
|
+
VERBOSE:
|
85
|
+
description: "Enable verbose output (sets log level to DEBUG)"
|
86
|
+
required: false
|
87
|
+
default: "false"
|
84
88
|
GERRIT_SERVER:
|
85
89
|
description: "Gerrit server hostname; derived if not supplied explicitly"
|
86
90
|
required: false
|
@@ -130,13 +134,13 @@ runs:
|
|
130
134
|
steps:
|
131
135
|
- name: Setup Python
|
132
136
|
# yamllint disable-line rule:line-length
|
133
|
-
uses: actions/setup-python@
|
137
|
+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
|
134
138
|
with:
|
135
139
|
python-version-file: '${{ github.action_path }}/pyproject.toml'
|
136
140
|
|
137
141
|
- name: Setup uv
|
138
142
|
# yamllint disable-line rule:line-length
|
139
|
-
uses: astral-sh/setup-uv@
|
143
|
+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
|
140
144
|
|
141
145
|
- name: Checkout repository
|
142
146
|
# yamllint disable-line rule:line-length
|
@@ -280,6 +284,7 @@ runs:
|
|
280
284
|
DUPLICATE_TYPES: ${{ inputs.DUPLICATE_TYPES }}
|
281
285
|
NORMALISE_COMMIT: ${{ inputs.NORMALISE_COMMIT }}
|
282
286
|
G2G_USE_SSH_AGENT: ${{ inputs.G2G_USE_SSH_AGENT }}
|
287
|
+
G2G_VERBOSE: ${{ inputs.VERBOSE }}
|
283
288
|
|
284
289
|
# Optional Gerrit overrides (when .gitreview is missing)
|
285
290
|
GERRIT_SERVER: ${{ inputs.GERRIT_SERVER }}
|
@@ -36,6 +36,7 @@ from .github_api import get_pr_title_body
|
|
36
36
|
from .github_api import get_pull
|
37
37
|
from .github_api import get_repo_from_env
|
38
38
|
from .github_api import iter_open_pulls
|
39
|
+
from .gitutils import CommandError
|
39
40
|
from .gitutils import run_cmd
|
40
41
|
from .models import GitHubContext
|
41
42
|
from .models import Inputs
|
@@ -51,6 +52,7 @@ from .ssh_common import build_non_interactive_ssh_env
|
|
51
52
|
from .utils import append_github_output
|
52
53
|
from .utils import env_bool
|
53
54
|
from .utils import env_str
|
55
|
+
from .utils import is_verbose_mode
|
54
56
|
from .utils import log_exception_conditionally
|
55
57
|
from .utils import parse_bool_env
|
56
58
|
|
@@ -245,7 +247,7 @@ if "--help" in sys.argv or _is_github_actions_context():
|
|
245
247
|
|
246
248
|
app: typer.Typer = typer.Typer(
|
247
249
|
add_completion=False,
|
248
|
-
no_args_is_help=
|
250
|
+
no_args_is_help=True,
|
249
251
|
cls=cast(Any, _SingleUsageGroup),
|
250
252
|
rich_markup_mode="rich",
|
251
253
|
help="Tool to convert GitHub pull requests into Gerrit changes",
|
@@ -989,9 +991,60 @@ def _process_single(
|
|
989
991
|
else:
|
990
992
|
progress_tracker.change_updated()
|
991
993
|
except Exception as exc:
|
994
|
+
# Enhanced error handling for CommandError to show git command
|
995
|
+
# details
|
996
|
+
if isinstance(exc, CommandError):
|
997
|
+
# Always show the basic error message
|
998
|
+
cmd_str = " ".join(exc.cmd) if exc.cmd else "unknown command"
|
999
|
+
basic_error = f"Git command failed: {cmd_str}"
|
1000
|
+
if exc.returncode is not None:
|
1001
|
+
basic_error += f" (exit code: {exc.returncode})"
|
1002
|
+
|
1003
|
+
# In verbose mode, show detailed stdout/stderr
|
1004
|
+
if is_verbose_mode():
|
1005
|
+
detailed_msg = basic_error
|
1006
|
+
if exc.stdout and exc.stdout.strip():
|
1007
|
+
detailed_msg += f"\nGit stdout: {exc.stdout.strip()}"
|
1008
|
+
if exc.stderr and exc.stderr.strip():
|
1009
|
+
detailed_msg += f"\nGit stderr: {exc.stderr.strip()}"
|
1010
|
+
|
1011
|
+
# Show debugging suggestion for merge failures
|
1012
|
+
if "merge --squash" in " ".join(exc.cmd or []):
|
1013
|
+
detailed_msg += (
|
1014
|
+
"\n💡 For local debugging: python "
|
1015
|
+
"test_merge_failure.py --verbose"
|
1016
|
+
)
|
1017
|
+
|
1018
|
+
safe_console_print(f"❌ {detailed_msg}", style="red")
|
1019
|
+
if progress_tracker:
|
1020
|
+
progress_tracker.add_error(basic_error)
|
1021
|
+
if exc.stderr and exc.stderr.strip():
|
1022
|
+
progress_tracker.add_error(
|
1023
|
+
f"Details: {exc.stderr.strip()}"
|
1024
|
+
)
|
1025
|
+
else:
|
1026
|
+
# In non-verbose mode, show basic error with hint to enable
|
1027
|
+
# verbose
|
1028
|
+
hint_msg = (
|
1029
|
+
basic_error
|
1030
|
+
+ "\n💡 Run with VERBOSE=true for detailed git output"
|
1031
|
+
)
|
1032
|
+
safe_console_print(f"❌ {hint_msg}", style="red")
|
1033
|
+
if progress_tracker:
|
1034
|
+
progress_tracker.add_error(basic_error)
|
1035
|
+
else:
|
1036
|
+
# For other exceptions, use original handling
|
1037
|
+
error_msg = str(exc)
|
1038
|
+
if progress_tracker:
|
1039
|
+
progress_tracker.add_error(f"Execution failed: {error_msg}")
|
1040
|
+
else:
|
1041
|
+
safe_console_print(f"❌ Error: {error_msg}", style="red")
|
1042
|
+
|
992
1043
|
log.debug("Execution failed; continuing to write outputs: %s", exc)
|
993
|
-
|
994
|
-
|
1044
|
+
|
1045
|
+
# In verbose mode, also log the full exception with traceback
|
1046
|
+
if is_verbose_mode():
|
1047
|
+
log.exception("Full exception details:")
|
995
1048
|
|
996
1049
|
result = SubmissionResult(
|
997
1050
|
change_urls=[], change_numbers=[], commit_shas=[]
|