You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pre-commit check frequently fails on Copybara pushes to main, blocking external contributors #5963
The pre-commit CI check frequently fails on commits pushed to main by copybara-service. Filtering the Actions tab by is:failure branch:main shows 90+ failures, all from the internal pipeline.
Since pre-commit/action runs --all-files, any external PR that touches .py files inherits these pre-existing failures and cannot pass CI — even when the PR's own changes are correctly formatted.
The check ran and failed, but since the changes were pushed directly, the check is just informational. As a result, contributor branches are now also failing — see here.
Ask: Could the internal pipeline run isort and pyink before syncing to GitHub, to match the public pre-commit checks?
GitHub Issue #5963 Analysis: pre-commit check frequently fails on Copybara pushes to main, blocking external contributors
Detailed Analysis
1. Root Cause Analysis ("What is broken?")
The ADK-Python repository utilizes a GitHub Actions workflow defined in pre-commit.yml which executes pre-commit/action@v3.0.1. By default, this action runs: pre-commit run --all-files
under both push and pull_request triggers to verify compliance with the formatting and style rules defined in .pre-commit-config.yaml.
The breakdown occurs due to a mismatch between Google's internal pipeline and the open-source GitHub workflow:
Direct Pushes to Main: The Google-internal repository changes are pushed directly to main via copybara-service automation.
Formatting Bypassed: This automated export/sync pipeline often bypasses or incorrectly formats Python files, neglecting rules specified in .pre-commit-config.yaml (such as Google-style pyink formatting or isort sorting).
Failing Checks on Main: Direct pushes trigger the Pre-commit Checks on push. Since style violations are present, the CI check fails (resulting in 90+ informational failures on main), but since it's a direct push, it doesn't block the commit itself.
Blocking PR Contributors: When external contributors open a PR touching any files, the workflow runs on the pull_request event. Because the pre-commit action runs --all-files, it runs on the entire repo including the misconfigured files on main, failing the contributor's PR CI check despite their own changes being perfectly formatted.
2. Legitimacy Analysis
Status: Legitimate Bug / Infrastructure Flaw
Evidence:
CI execution uses pre-commit.yml, running pre-commit/action@v3.0.1 (which defaults to scanning --all-files).
Strict formatters are enforced in .pre-commit-config.yaml (isort, pyink).
Example failures occur in:
base_llm_flow.py
basic.py
gemini_llm_connection.py
test_base_llm_flow.py
test_gemini_llm_connection.py
This is verified by PR #5962, where the author successfully resolves the current failure by running manual formatting on those specific files.
3. Fix Recommendation
Recommendation: Should Fix (High Priority) / Pipeline Configuration Fix
Rationale:
Impact: High. It adds significant friction to external collaboration. Contributors find their PRs blocked by unrelated style violations on the main branch.
Solution Strategy:
Short-Term Workaround: Merge PR #5962 to immediately clean formatting in current files and unblock all pending and newly opened PRs.
Long-Term Corrective Action: Update Google's internal Piper/Copybara sync pipeline to automatically execute isort and pyink formatting on outgoing Python files before pushing them to GitHub.
Alternative CI Refactoring: Alternatively, the pre-commit workflow could be refactored to limit execution to changed files only on Pull Requests (e.g. using extra_args). However, correcting formatting at the Copybara boundary is the preferred architectural solution to maintain clean code and prevent style drift.
Analysis: Opened by the same author to fix the current formatting failures in the repository by running isort and pyink on the 5 affected files. It successfully restores formatting cleanliness but is only an immediate fix; future Copybara synchronization commits could re-introduce formatting discrepancies.
Executive Summary
What is broken? Style checks in GitHub CI fail on external PRs because direct main branch syncs via copybara-service bypass style formatting, and pre-commit scans all files in the repository.
Is the issue legitimate? Yes, it is a legitimate infrastructure issue that blocks external contributors from successfully passing pre-commit CI validations.
Should we fix it? Yes, High Priority. The immediate files should be reformatted by merging PR #5962, and the Copybara pipeline should be configured to run formatters on outgoing code.
Is there a linked PR that fixes this issue? Yes, PR #5962 resolves the immediate styling issue, currently awaiting review from maintainers.
Activity
adk-bot commentedon Jun 4, 2026
GitHub Issue #5963 Analysis:
pre-commitcheck frequently fails on Copybara pushes tomain, blocking external contributorsDetailed Analysis
1. Root Cause Analysis ("What is broken?")
The ADK-Python repository utilizes a GitHub Actions workflow defined in pre-commit.yml which executes
pre-commit/action@v3.0.1. By default, this action runs:pre-commit run --all-filesunder both
pushandpull_requesttriggers to verify compliance with the formatting and style rules defined in .pre-commit-config.yaml.The breakdown occurs due to a mismatch between Google's internal pipeline and the open-source GitHub workflow:
mainviacopybara-serviceautomation.pyinkformatting orisortsorting).Pre-commit Checksonpush. Since style violations are present, the CI check fails (resulting in 90+ informational failures onmain), but since it's a direct push, it doesn't block the commit itself.pull_requestevent. Because the pre-commit action runs--all-files, it runs on the entire repo including the misconfigured files onmain, failing the contributor's PR CI check despite their own changes being perfectly formatted.2. Legitimacy Analysis
pre-commit/action@v3.0.1(which defaults to scanning--all-files).isort,pyink).3. Fix Recommendation
mainbranch.isortandpyinkformatting on outgoing Python files before pushing them to GitHub.extra_args). However, correcting formatting at the Copybara boundary is the preferred architectural solution to maintain clean code and prevent style drift.4. Existing Pull Requests
open)isortandpyinkon the 5 affected files. It successfully restores formatting cleanliness but is only an immediate fix; future Copybara synchronization commits could re-introduce formatting discrepancies.Executive Summary
mainbranch syncs viacopybara-servicebypass style formatting, and pre-commit scans all files in the repository.Summary of Work Done
pre-commitcheck frequently fails on Copybara pushes tomain, blocking external contributors #5963.copybara-servicedirect pushes create a discrepancy with--all-filespre-commit checks on external PR branches.DeanChensj commentedon Jun 9, 2026
Thanks for reporting this, we have enforced the pre-commit check internally