Andrushika commented on code in PR #77571:
URL: https://github.com/apache/airflow/pull/77571#discussion_r4691174376
##########
scripts/ci/prek/check_fork_ci_gate_config.py:
##########
@@ -183,16 +193,30 @@ def resolve_base_ref() -> str | None:
and _git("fetch", "--quiet", "--depth=1", "origin",
f"refs/heads/{base_branch}") is not None
):
return "FETCH_HEAD"
+ if not base_branch:
+ event_name = os.environ.get("GITHUB_EVENT_NAME")
+ if os.environ.get("GITHUB_REPOSITORY") == "apache/airflow" and
event_name in (
+ "push",
+ "schedule",
+ "workflow_dispatch",
+ ):
+ return "HEAD"
Review Comment:
`main()` says comparing with the change itself would accept any new past
instant. This returns `HEAD` on purpose, maybe worth one line here on why
that's fine for merged branches?
##########
scripts/ci/prek/check_fork_ci_gate_config.py:
##########
@@ -173,6 +174,15 @@ def _git(*args: str) -> str | None:
return result.stdout if result.returncode == 0 else None
+def get_airflow_branch() -> str:
Review Comment:
Looks like `upgrade_important_versions.py` already has the same
`get_airflow_branch()`, even the regex is identical. Could the two hooks share
one copy?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]