Skip to content

Commit ab42e49

Browse files
potiukjscheffl
andauthored
[v3-2-test] Bugfix/skip commit checks on automated ci upgrades (#64856) (#64916)
* Skip pre-commit checks on automated CI tool upgrades * Skip pre-commit checks on automated CI tool upgrades * Review feedback, attempt with checks once, collect auto-fixes and commit again * Shorten code (cherry picked from commit 93552c2) Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
1 parent 2eeff98 commit ab42e49

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

dev/breeze/src/airflow_breeze/commands/ci_commands.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,23 @@ def upgrade(
849849

850850
run_command(["git", "checkout", "-b", branch_name])
851851
run_command(["git", "add", "."])
852-
run_command(["git", "commit", "-m", f"[{target_branch}] CI: Upgrade important CI environment"])
852+
try:
853+
run_command(
854+
["git", "commit", "--message", f"[{target_branch}] CI: Upgrade important CI environment"]
855+
)
856+
except subprocess.CalledProcessError:
857+
console_print("[info]Commit failed, assume some auto-fixes might have been made...[/]")
858+
run_command(["git", "add", "."])
859+
run_command(
860+
[
861+
"git",
862+
"commit",
863+
# postpone pre-commit checks to CI, not to fail in automation if e.g. mypy changes force code checks
864+
"--no-verify",
865+
"--message",
866+
f"[{target_branch}] CI: Upgrade important CI environment",
867+
]
868+
)
853869

854870
# Push the branch to origin (use detected origin or fallback to 'origin')
855871
push_remote = origin_remote_name if origin_remote_name else "origin"

0 commit comments

Comments
 (0)