norm commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1032241234


##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,174 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import os
+
+import click
+
+from airflow_breeze.utils.common_options import option_answer
+from airflow_breeze.utils.confirm import user_confirm_bool
+from airflow_breeze.utils.console import console_print
+from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT
+from airflow_breeze.utils.run_utils import run_command
+
+CI = os.environ.get("CI")
+
+
+def create_branch(version_branch):
+    if CI:
+        console_print("Skipping creating branch in CI")
+        return
+    if user_confirm_bool(f"Create version branch: {version_branch}?"):
+        run_command(["git", "checkout", "main"])
+        run_command(["git", "checkout", "-b", f"v{version_branch}-test"])
+        console_print(f"Created branch: v{version_branch}-test")
+
+
+def update_default_branch(version_branch):
+    if user_confirm_bool("Update default branches?"):
+        console_print()
+        console_print("You need to update the default branch at:")
+        console_print("./dev/breeze/src/airflow_breeze/branch_defaults.py")
+        console_print("Change the following:")
+        console_print("AIRFLOW_BRANCH = 'main'")
+        console_print("DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH = 
'constraints-main'")
+        console_print()
+        console_print("To:")
+        console_print()
+        console_print(f"AIRFLOW_BRANCH = 'v{version_branch}-test'")
+        console_print(f"DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH = 
'constraints-{version_branch}'")
+
+
+def commit_changes(version_branch):
+    if CI:
+        console_print("Skipping committing changes in CI")
+        return
+    if user_confirm_bool("Commit the above changes?"):
+        run_command(["git", "add", "-p", "."])
+        run_command(["git", "commit", "-m", f"Update default branches for 
{version_branch}"])
+
+
+def create_stable_branch(version_branch):
+    if CI:
+        console_print("Skipping creating stable branch in CI")
+        return
+    if user_confirm_bool(f"Create stable branch: v{version_branch}-stable?"):
+        run_command(["git", "branch", f"v{version_branch}-stable"])
+        console_print(f"Created branch: v{version_branch}-stable")
+
+
+def push_test_and_stable_branch(version_branch):
+    if CI:
+        console_print("Skipping pushing test and stable branches in CI")
+        return
+    if user_confirm_bool("Push test and stable branches?"):
+        run_command(["git", "checkout", f"v{version_branch}-test"])
+        run_command(["git", "push", "--set-upstream", "origin", 
f"v{version_branch}-test"])

Review Comment:
   In more places than just here, it is assumed that `origin` is the correct 
remote to do operations against. Not that I can do a release as a 
non-committer, but my local checkout has `apache` as the remote name because I 
need to differentiate between different upstreams.
   
   I might be alone in this, but equally it might be worth documenting the 
expectation of the remote being `origin` in the instructions?



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to