You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/11/22 11:00:58 UTC
[GitHub] [airflow] ephraimbuddy opened a new pull request, #27829: Improving the release process
ephraimbuddy opened a new pull request, #27829:
URL: https://github.com/apache/airflow/pull/27829
This PR aims to automate some parts of the release process.
For RC, we have a command to run the release process:
breeze release-management start-rc-process --version 2.4.3rc1 --previous-version 2.4.2
For release, the below command runs the process:
breeze release-management start-release --release-candidate 2.4.3rc1 --previous-release <PREVIOUS RELEASE>
And there's a command for creating a version branch when releasing a minor version:
breeze release-management create-minor-branch --version-branch ${VERSION_BRANCH}
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
RE: [GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
Posted by Madilynn Flynn <ma...@clinkz.live>.
Hi,
Just checking, are you interested acquiring the list of attendees? Please respond my email. I'm waiting for your response.
We are discussing about Prices And, provide the discount cost.
Thank you,
-----Original Message-----
From: GitBox <gi...@apache.org>
Sent: Friday, November 25, 2022 2:05 AM
To: commits@airflow.apache.org
Subject: [GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
norm commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1032208801
##########
dev/breeze/src/airflow_breeze/utils/confirm.py:
##########
@@ -98,3 +98,20 @@ def user_confirm(
if quit_allowed:
return Answer.QUIT
sys.exit(1)
+
+
+def user_confirm_bool(
Review Comment:
Observation: At first glance having the name end `…_bool` didn't make me think it would do any more than return True/False, so having it exit on no/abort was unexpected. But I am also struggling to come up with an alternate name so this isn't a call to action.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
RE: [GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
Posted by Madilynn Flynn <ma...@clinkz.live>.
Hi,
Just checking, are you interested acquiring the list of attendees? Please respond my email. I'm waiting for your response.
We are discussing about Prices And, provide the discount cost.
Thank you,
-----Original Message-----
From: GitBox <gi...@apache.org>
Sent: Friday, November 25, 2022 2:05 AM
To: commits@airflow.apache.org
Subject: [GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
norm commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1032208801
##########
dev/breeze/src/airflow_breeze/utils/confirm.py:
##########
@@ -98,3 +98,20 @@ def user_confirm(
if quit_allowed:
return Answer.QUIT
sys.exit(1)
+
+
+def user_confirm_bool(
Review Comment:
Observation: At first glance having the name end `…_bool` didn't make me think it would do any more than return True/False, so having it exit on no/abort was unexpected. But I am also struggling to come up with an alternate name so this isn't a call to action.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068765818
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,183 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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 confirm_action("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 confirm_action(f"Create stable branch: v{version_branch}-stable?"):
+ run_command(["git", "checkout", "-b", f"v{version_branch}-stable"])
+ console_print(f"Created branch: v{version_branch}-stable")
+ else:
+ run_command(["git", "checkout", f"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 confirm_action("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"])
+ run_command(["git", "checkout", f"v{version_branch}-stable"])
+ run_command(["git", "push", "--set-upstream", "origin", f"v{version_branch}-stable"])
+
+
+def checkout_main():
+ if confirm_action("We now need to checkout main. Continue?"):
+ run_command(["git", "checkout", "main"])
+ run_command(["git", "pull"])
+
+
+def instruction_update_version_branch(version_branch):
+ if confirm_action("Now, we need to manually update the version branches in main. Continue?"):
+ console_print()
+ console_print(
+ f"Add v{version_branch}-stable and v{version_branch}-test branches "
+ "in codecov.yml (there are 2 places in the file!)"
+ )
+ console_print("Areas to add the branches will look like this:")
+ console_print(
+ """
+ branches:
+ - main
+ - v2-0-stable
+ - v2-0-test
+ - v2-1-stable
+ - v2-1-test
+ - v2-2-stable
+ - v2-2-test
+ """
+ )
+ console_print()
+ console_print(f"Add v{version_branch}-stable to .asf.yaml ({version_branch} is your new branch)")
+ console_print(
+ f"""
+ protected_branches:
+ main:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ ...
+ v{version_branch}-stable:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ """
+ )
+ console_print("Once you finish with the above. Commit the changes and make a PR against main")
+ confirm_action("I'm done with the changes. Continue?", abort=True)
+
+
+def create_constraints(version_branch):
+ if CI:
Review Comment:
Oh, yes, good eye. There are probably more of this class where we are skipping the whole thing vs the portion we can't do.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1053602147
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,181 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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 confirm_action("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 confirm_action(f"Create stable branch: v{version_branch}-stable?"):
Review Comment:
Should we checkout `v{version_branch}-stable` explicitly here, in case we've answered no to "Create version branch: {version_branch}?"?
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,181 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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 confirm_action("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 confirm_action(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 confirm_action("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"])
+ run_command(["git", "checkout", f"v{version_branch}-stable"])
+ run_command(["git", "push", "--set-upstream", "origin", f"v{version_branch}-stable"])
+
+
+def checkout_main():
+ if confirm_action("We now need to checkout main. Continue?"):
+ run_command(["git", "checkout", "main"])
+ run_command(["git", "pull"])
+
+
+def instruction_update_version_branch(version_branch):
+ if confirm_action("Now, we need to manually update the version branches in main. Continue?"):
+ console_print()
+ console_print(
+ f"Add v{version_branch}-stable and v{version_branch}-test branches "
+ "in codecov.yml (there are 2 places in the file!)"
+ )
+ console_print("Areas to add the branches will look like this:")
+ console_print(
+ """
+ branches:
+ - main
+ - v2-0-stable
+ - v2-0-test
+ - v2-1-stable
+ - v2-1-test
+ - v2-2-stable
+ - v2-2-test
+ """
+ )
+ console_print()
+ console_print(f"Add v{version_branch}-stable to .asf.yaml ({version_branch} is your new branch)")
+ console_print(
+ f"""
+ protected_branches:
+ main:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ ...
+ v{version_branch}-stable:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ """
+ )
+ console_print("Once you finish with the above. Commit the changes and make a PR against main")
+ confirm_action("I'm done with the changes. Continue?", abort=True)
+
+
+def create_constraints(version_branch):
+ if CI:
+ console_print("Skipping creating constraints in CI")
+ return
+ if confirm_action("Do you want to create branches from the constraints main?"):
+ run_command(["git", "checkout", "constraints-main"])
+ run_command(["git", "checkout", "-b", f"constraints-{version_branch}"])
+ if confirm_action("Push the new branch?"):
+ run_command(["git", "push", "--set-upstream", "origin", f"constraints-{version_branch}"])
+
+
+@click.command(
+ name="create-minor-branch",
+ help="Create a new version branch and update the default branches in main",
+ hidden=True,
+)
+@click.option("--version-branch", help="The version branch you want to create e.g 2-4", required=True)
+@option_answer
+def create_minor_version_branch(version_branch):
+ for obj in version_branch.split("-"):
+ assert isinstance(int(obj), int)
+ os.chdir(AIRFLOW_SOURCES_ROOT)
+ repo_root = os.getcwd()
+ console_print()
+ console_print(f"Repo root: {repo_root}")
+ console_print(f"Version branch: {version_branch}")
+ console_print("Below are your git remotes. We will push to origin:")
+ run_command(["git", "remote", "-v"])
+ console_print()
+ confirm_action("Verify that the above information is correct. Do you want to continue?", abort=True)
+ # Final confirmation
+ confirm_action("Pushes will be made to origin. Do you want to continue?", abort=True)
+ # Create a new branch from main
+ create_branch(version_branch)
+ # Build ci image
+ if confirm_action("Build latest breeze image?"):
Review Comment:
When would we not want to build the latest image?
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1400675244
> Feel free to merge if you think it's GOOD and useful :).
Been thinking about the useful side of it :) let @jedcunningham decide
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1400705889
> > Feel free to merge if you think it's GOOD and useful :).
>
> Been thinking about the useful side of it :) let @jedcunningham decide
Comment here - for @jedcunningham as well. But I wonder what others involved in the process think:
I personally think it is super-useful. It makes the process repeatable but also it is largely self documenting. It's far easier to reason about it than README docs. But it does have some potential traps.
Cons:
* it's a little magical. release manager will not have to know what's under-the hood and if there is a consistent problem, all might seem to work but the release might be "wrong"
* when things do not work, the release manager might easily say "it does not work" and rather than fix the problem, defer it to whoever can modify breeze (and knows how it work - at least a bit)
Pros:
* One of the useful parts of it is that it is going to be continuously tested (vast majority of it ) , so that you are not surprised by it not working any more due to unrelated changes
* With breeze's built-in dry-run functionality, it is actually self-explanatory and if it does not work it allows the release manager to follow the whole process manually. Even if it is a little magical, you can find out how it works by `--dry-run` and still try to fix it manually
My personal view:
I personally usually err on the side of automation for those kind of things (as you are probably all well aware of that). One of the "features" of the Breeze rewrite in Python was to make it a little less magical - so that generally everyone here might understand and fix things. The fact that @ephraimbuddy wrote it largely himself with a little of my help is kinda proof that it works. Maybe it took a bit long and maybe there were a few things that require a bit more knowledge of the "magic" under-the-hood (especially when it comes to CI integration), it was not that bad I think.
I think there is a big benefit of automating - it makes it actually possible to speed up cadence of releases. This is what we also see wiht @eladkal releasing the providers in increased cadence now - I think it would not be possible if not the automation of the process. There are still things there that could be improved and automated more. And "Release early, release often" is the mantra that I will continuously repeat as the way how we can improve things. The "provider" release process (after Elad's few improvements/teething problems when he started doing it) allows to run it as often as we want by anyone. We can share the burden of relases among many people, because the mundane, easy to make mistake parts of the process will be automated and only the "interesting" part remains (reviewing the changes, cherry-picking them, communicating with people about testing etc. etc. I find those parts really important and interesting and there are things I would not even want to automate (
rather to make it assisted by automation).
This change above I think automates what's not "interesting" thus potentially opening the release process for more participants.
Those my 3 cents.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1029202065
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,165 @@
+# 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.
+
+import os
+
+import click
+
+from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT
+from airflow_breeze.utils.run_utils import run_command
+
+
+def create_branch(version_branch):
+ if click.confirm(f"Create version branch: {version_branch}?"):
Review Comment:
Hi @potiuk, what are your thoughts on using `click.confirm` and `click.echo` in this PR? I looked at other breeze commands and it looks like you don't use these.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1327111335
I added a new function `user_confirm_bools` that returns a bool using `user_confirm` under the hood. This helped me reduce a lot of `if else` statements.
Also added `console_print` that uses `get_console().print` to print messages to the screen.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1030696177
##########
.github/workflows/ci.yml:
##########
@@ -737,6 +737,42 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
+ timeout-minutes: 80
+ name: "Test Airflow release commands"
+ runs-on: "${{needs.build-info.outputs.runs-on}}"
+ needs: [build-info, wait-for-ci-images]
+ env:
+ RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
+ PYTHON_MAJOR_MINOR_VERSION: "${{needs.build-info.outputs.default-python-version}}"
+ steps:
+ - name: Cleanup repo
+ run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ - name: >
+ Prepare breeze & CI image: ${{needs.build-info.outputs.default-python-version}}:${{env.IMAGE_TAG}}
+ uses: ./.github/actions/prepare_breeze_and_image
+ - name: "Cleanup dist files"
+ run: rm -fv ./dist/*
+ - name: Install subversion
+ shell: bash
+ run: sudo apt-get install libsvn-dev libapache2-mod-svn subversion-tools subversion
Review Comment:
You can try now and it should be fine. Our self-hosted images should have subversion installed.
But you should add a step with this condition:
```
if: needs.build-info.outputs.runs-in == 'self-hosted'
````
Only self-hosted has SVN installed, and I cannot imagine a non-committer changing it, so this should be ok.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
norm commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1032208801
##########
dev/breeze/src/airflow_breeze/utils/confirm.py:
##########
@@ -98,3 +98,20 @@ def user_confirm(
if quit_allowed:
return Answer.QUIT
sys.exit(1)
+
+
+def user_confirm_bool(
Review Comment:
Observation: At first glance having the name end `…_bool` didn't make me think it would do any more than return True/False, so having it exit on no/abort was unexpected. But I am also struggling to come up with an alternate name so this isn't a call to action.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1032267254
##########
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:
Yes. You have valid points. I usually do releases from a repo clone different from my dev repo. I think it's necessary to ask the user to consider cloning airflow at a different location for release, though I mentioned the remote where the script will push to
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1029241119
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,165 @@
+# 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.
+
+import os
+
+import click
+
+from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT
+from airflow_breeze.utils.run_utils import run_command
+
+
+def create_branch(version_branch):
+ if click.confirm(f"Create version branch: {version_branch}?"):
Review Comment:
Thank you so much for taking the time to explain this. They are much appreciated!
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068774299
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if confirm_action(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
Review Comment:
(backs away slowly)
I should have known...
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068772776
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if confirm_action(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
Review Comment:
You might be surprised how different SVN vs Git is and it's sometimes not obvious:
https://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.copy.html
You will find out that depending on the parameter FORMAT it's either:
* scheduling for chaning or
* commiting the change or
* complete server side copy
All while running the same `svn cp`.
If anything, I'd err on the side of caution and not do any svn operation. in CI.
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if confirm_action(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
Review Comment:
You might be surprised how different SVN vs Git is and it's sometimes not obvious:
https://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.copy.html
You will find out that depending on the parameter FORMAT it's either:
* scheduling for changing or
* commiting the change or
* complete server side copy
All while running the same `svn cp`.
If anything, I'd err on the side of caution and not do any svn operation. in CI.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068684138
##########
dev/breeze/src/airflow_breeze/commands/release_candidate_command.py:
##########
@@ -0,0 +1,343 @@
+# 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 confirm_action
+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 merge_pr(version_branch):
+ if CI:
+ console_print("Skipping merge PR in CI")
+ return
+ if confirm_action("Do you want to merge the Sync PR?"):
+ run_command(
+ [
+ "git",
+ "checkout",
+ f"v{version_branch}-stable",
+ ]
+ )
+ run_command(["git", "reset", "--hard", f"origin/v{version_branch}-stable"])
+ run_command(["git", "merge", "--ff-only", f"v{version_branch}-test"])
+ if confirm_action("Do you want to push the changes? Pushing the changes closes the PR"):
+ run_command(["git", "push", "origin", f"v{version_branch}-stable"])
+
+
+def git_tag(version):
+ if CI:
Review Comment:
Should be fine too.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1400625486
Feel free to merge if you think it's GOOD and useful :).
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1338958501
Apparently `breeze ci get-workflow-info` produced an output now that cannot be parsed by GitHub. likely this is because some extra output (print) is added to the output (it should be `<variable> = <value>` form
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1323643849
> > @ephraimbuddy - the "prepare-provider-documenation" step is added here #27832 - let's see if it works fine. `ANSWER="yes"` is passed from the job environments (see the top of the file) so it should simulate the user answering "yes" to all questions.
> > I think it will not work, I will have to add some other "bypass" there - becasue there is a question about the type of change as well, but I will add it when I see it (not)working. Something similar you will have to do in your PR, likely for some of the operations. i think it is entirely worthy of the effort - this way you do not have to worry during release if the tool still works or not.
>
> In my case, I wouldn't want to run some commands if the environment is CI, so I'm looking at sorting the commands that would run if `--answer yes` is passed. Or just check if we are on CI and use dry run
Yep. Checking for CI is a good idea.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1063217565
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I am not so sure about it. The breeze/tests are really "unit tests" and this is cool for some internal logic and behaviour (for example "selective-checks" logic is very thoroughly tested by unit tests).
What running the commands directly as "users" would use them, we are testing more - those are equivalent of "system tests" we have in AIP-47, and for breeze, just running the commands is much better way of doing it. It tests much more than any kind of unit tests can do:
* they test parsing of the commands/parameters passed
* they produce the colorful output that the user would see so that we can manually verify them in CI output
* finally - they provide examples of how you should run those commands when manually releasing, so that you can always refer to the commands we have in CI (I've used it multiple times in the past - to be sure about it
Most of the breeze command functionality is tested this way (and this is one of the main reasons breeze Python refactoring was specifically aimed to be able to run the same commands manually AND in CI - this was one of the decisions we made when rewriting breeze in Python - to be able to use exactly the same commands in the CI as we use manually, to avoid regressions. Previously we had a different approach - where we had "common" libraries in Bash and they were run by `breeze` bash CLI manually but the same functionality was run via separate "ci" scripts in CI and this caused multiple, multiple regressions for the users.
Right now pretty much ALL breeze commands are run in the CI precisely for that reason as part of the CI build even if they are not `strictly` needed - to prevent regressions.
A very good recent example of similar regression when we did NOT run breeze command has been recently fixed in https://github.com/apache/airflow/pull/28683 (@elradkal might confirm it added up to the pains of his release process). We did not have `breeze release-management generate-issue-content --only-available-in-dist` command run in CI and when Elad attempted to generate it at release time, it crashed (because an earlier refactor of mine introduced bugs).
My philosophy on Breeze and release process is that it shoudl **always** work when release manager attempts to do it and it should not add friction (that is the goal at least). And the only way to do be sure about it, is to run the command that release-manager uses as part of our CI. There is no other sane way to achieve it.
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
BTW. The decision about that (sharing CI and manual commands) have been recorded here:
https://github.com/apache/airflow/blob/main/dev/breeze/doc/adr/0002-implement-standalone-python-command.md
> There is enough overlap between the CI and Breeze to reuse a lot of commands for building images and other CI actions that they should be shared between Breeze and CI. Therefore dev/Breeze will also become a home for all the CI scripts that will be used in GitHubActions in CI.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1323635269
> @ephraimbuddy - the "prepare-provider-documenation" step is added here #27832 - let's see if it works fine. `ANSWER="yes"` is passed from the job environments (see the top of the file) so it should simulate the user answering "yes" to all questions.
>
> I think it will not work, I will have to add some other "bypass" there - becasue there is a question about the type of change as well, but I will add it when I see it (not)working. Something similar you will have to do in your PR, likely for some of the operations. i think it is entirely worthy of the effort - this way you do not have to worry during release if the tool still works or not.
In my case, I wouldn't want to run some commands if the environment is CI, so I'm looking at sorting the commands that would run if `--answer yes` is passed. Or just check if we are on CI and use dry run
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068683888
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,183 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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 confirm_action("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 confirm_action(f"Create stable branch: v{version_branch}-stable?"):
+ run_command(["git", "checkout", "-b", f"v{version_branch}-stable"])
+ console_print(f"Created branch: v{version_branch}-stable")
+ else:
+ run_command(["git", "checkout", f"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 confirm_action("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"])
+ run_command(["git", "checkout", f"v{version_branch}-stable"])
+ run_command(["git", "push", "--set-upstream", "origin", f"v{version_branch}-stable"])
+
+
+def checkout_main():
+ if confirm_action("We now need to checkout main. Continue?"):
+ run_command(["git", "checkout", "main"])
+ run_command(["git", "pull"])
+
+
+def instruction_update_version_branch(version_branch):
+ if confirm_action("Now, we need to manually update the version branches in main. Continue?"):
+ console_print()
+ console_print(
+ f"Add v{version_branch}-stable and v{version_branch}-test branches "
+ "in codecov.yml (there are 2 places in the file!)"
+ )
+ console_print("Areas to add the branches will look like this:")
+ console_print(
+ """
+ branches:
+ - main
+ - v2-0-stable
+ - v2-0-test
+ - v2-1-stable
+ - v2-1-test
+ - v2-2-stable
+ - v2-2-test
+ """
+ )
+ console_print()
+ console_print(f"Add v{version_branch}-stable to .asf.yaml ({version_branch} is your new branch)")
+ console_print(
+ f"""
+ protected_branches:
+ main:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ ...
+ v{version_branch}-stable:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ """
+ )
+ console_print("Once you finish with the above. Commit the changes and make a PR against main")
+ confirm_action("I'm done with the changes. Continue?", abort=True)
+
+
+def create_constraints(version_branch):
+ if CI:
Review Comment:
I think we could simply skip pushing the changes in CI.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068681488
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,183 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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:
Review Comment:
Commiting changes could be done in CI as well.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1346082707
> > cc: @ephraimbuddy
>
> Thanks. Have updated it. It seems like `inputimeout` is not installed in the image because it errors out during pre-commit run:
>
> ```
> File "/Users/ephraimbuddy/Documents/astronomer/airflow/dev/breeze/src/airflow_breeze/commands/main_command.py", line 159, in check_for_rosetta_environment
> from inputimeout import TimeoutOccurred, inputimeout
> ModuleNotFoundError: No module named 'inputimeout'
> ```
Which pre-commit ? This does not seem like it is run in image (it would be /opt/airflow path then). Eacj pre-commits has their own dependencies and you need to make sure they are installed when they are run - they heave their dependencies declrated in .pre-commit-config.yml file..
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1030610824
##########
.github/workflows/ci.yml:
##########
@@ -737,6 +737,42 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
+ timeout-minutes: 80
+ name: "Test Airflow release commands"
+ runs-on: "${{needs.build-info.outputs.runs-on}}"
+ needs: [build-info, wait-for-ci-images]
+ env:
+ RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
+ PYTHON_MAJOR_MINOR_VERSION: "${{needs.build-info.outputs.default-python-version}}"
+ steps:
+ - name: Cleanup repo
+ run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ - name: >
+ Prepare breeze & CI image: ${{needs.build-info.outputs.default-python-version}}:${{env.IMAGE_TAG}}
+ uses: ./.github/actions/prepare_breeze_and_image
+ - name: "Cleanup dist files"
+ run: rm -fv ./dist/*
+ - name: Install subversion
+ shell: bash
+ run: sudo apt-get install libsvn-dev libapache2-mod-svn subversion-tools subversion
Review Comment:
Hi @potiuk , what's the correct way to install subversion in the CI? I want the step where the ASF repo was cloned to be run in the CI but I can't get the subversion installed
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
norm commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1032217535
##########
dev/breeze/src/airflow_breeze/utils/confirm.py:
##########
@@ -98,3 +98,20 @@ def user_confirm(
if quit_allowed:
return Answer.QUIT
sys.exit(1)
+
+
+def user_confirm_bool(
Review Comment:
Maybe `user_can_continue`? Not sure it makes it that much clearer, mind you.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1338988325
basically: run `pre-commit run --all-files update-breeze-readme-config-hash`
This should modify README.md with new hash. Commit it and it should be fixed.
I am yet unable to figure out why it has not been updated automatically. But I will.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1053594395
##########
.github/workflows/ci.yml:
##########
@@ -746,6 +746,44 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
+ timeout-minutes: 80
+ name: "Test Airflow release commands"
+ runs-on: "${{needs.build-info.outputs.runs-on}}"
+ needs: [build-info, wait-for-ci-images]
+ if: needs.build-info.outputs.runs-on == 'self-hosted'
+ env:
+ RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
+ PYTHON_MAJOR_MINOR_VERSION: "${{needs.build-info.outputs.default-python-version}}"
+ steps:
+ - name: Cleanup repo
+ run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ - name: >
+ Prepare breeze & CI image: ${{needs.build-info.outputs.default-python-version}}:${{env.IMAGE_TAG}}
+ uses: ./.github/actions/prepare_breeze_and_image
+ - name: "Cleanup dist files"
+ run: rm -fv ./dist/*
+ - name: "Check Airflow RC process command"
+ run: |
+ pip install twine rich_click jinja2 gitpython
+ breeze release-management start-rc-process --version 2.4.3rc1 --previous-version 2.4.2 --answer y
+ - name: "Check Airflow release command"
+ run: |
+ pip install twine
Review Comment:
Do we need to do this repetitively? Can we have a single step that just installs what we need for the rest?
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068687097
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
Review Comment:
Yep. this we should skip. SVN is centralized system and it might fail without credentials
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1063217565
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I am not so sure about it. The breeze/tests are really "unit tests" and this is cool for some internal logic and behaviour (for example "selective-checks" logic is very thoroughly tested by unit tests).
By running the commands directly as "users" would use them, we are testing more - those are equivalent of "system tests" we have in AIP-47, and for breeze, just running the commands is much better way of doing it. It tests much more than any kind of unit tests can do:
* they test parsing of the commands/parameters passed
* they produce the colorful output that the user would see so that we can manually verify them in CI output
* finally - they provide examples of how you should run those commands when manually releasing, so that you can always refer to the commands we have in CI (I've used it multiple times in the past - to be sure about it
Most of the breeze command functionality is tested this way (and this is one of the main reasons breeze Python refactoring was specifically aimed to be able to run the same commands manually AND in CI - this was one of the decisions we made when rewriting breeze in Python - to be able to use exactly the same commands in the CI as we use manually, to avoid regressions. Previously we had a different approach - where we had "common" libraries in Bash and they were run by `breeze` bash CLI manually but the same functionality was run via separate "ci" scripts in CI and this caused multiple, multiple regressions for the users.
Right now pretty much ALL breeze commands are run in the CI precisely for that reason as part of the CI build even if they are not `strictly` needed - to prevent regressions.
A very good recent example of similar regression when we did NOT run breeze command has been recently fixed in https://github.com/apache/airflow/pull/28683 (@eladkal might confirm it added up to the pains of his release process). We did not have `breeze release-management generate-issue-content --only-available-in-dist` command run in CI and when Elad attempted to generate it at release time, it crashed (because an earlier refactor of mine introduced bugs).
My philosophy on Breeze and release process is that it shoudl **always** work when release manager attempts to do it and it should not add friction (that is the goal at least). And the only way to do be sure about it, is to run the command that release-manager uses as part of our CI. There is no other sane way to achieve it.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1063217565
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I am not so sure about it. The breeze/tests are really "unit tests" and this is cool for some internal logic and behaviour (for example "selective-checks" logic is very thoroughly tested by unit tests).
By running the commands directly as "users" would use them, we are testing more - those are equivalent of "system tests" we have in AIP-47, and for breeze, just running the commands is much better way of doing it. It tests much more than any kind of unit tests can do:
* they test parsing of the commands/parameters passed
* they produce the colorful output that the user would see so that we can manually verify them in CI output
* finally - they provide examples of how you should run those commands when manually releasing, so that you can always refer to the commands we have in CI (I've used it multiple times in the past - to be sure about it
Most of the breeze command functionality is tested this way (and this is one of the main reasons breeze Python refactoring was specifically aimed to be able to run the same commands manually AND in CI - this was one of the decisions we made when rewriting breeze in Python - to be able to use exactly the same commands in the CI as we use manually, to avoid regressions. Previously we had a different approach - where we had "common" libraries in Bash and they were run by `breeze` bash CLI manually but the same functionality was run via separate "ci" scripts in CI and this caused multiple, multiple regressions for the users.
Right now pretty much ALL breeze commands are run in the CI precisely for that reason as part of the CI build even if they are not `strictly` needed - to prevent regressions.
A very good recent example of similar regression when we did NOT run breeze command has been recently fixed in https://github.com/apache/airflow/pull/28683 (@elradkal might confirm it added up to the pains of his release process). We did not have `breeze release-management generate-issue-content --only-available-in-dist` command run in CI and when Elad attempted to generate it at release time, it crashed (because an earlier refactor of mine introduced bugs).
My philosophy on Breeze and release process is that it shoudl **always** work when release manager attempts to do it and it should not add friction (that is the goal at least). And the only way to do be sure about it, is to run the command that release-manager uses as part of our CI. There is no other sane way to achieve it.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on pull request #27829: Improving the release process
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1400801480
I'm not too concerned with it being "magic", I think we all can debug and carry on manually if things go sideways. Hopefully it doesn't, but historically we have improvements/fixes after most releases :)
I'm not sure we should use this to widen our release manager pool or speed up cadence though. The challenging part isn't this part after all. It will remove some of the tedium though, which is always good.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1386902562
> Hi @potiuk, It seems like there's something wrong with the breeze build on this PR. For example, here: https://github.com/apache/airflow/actions/runs/3947115412/jobs/6755756155#step:8:33 it's saying that the command does not exist.
I think the previous command cleaned up something or added something (egg.info?) that confused installed breeze. Try to reproduce it and run in the same sequence and see if you can repeat it. Also maybe the "hidden=True" confused it additionally - unhide it and see if it helps
* -rc and -prev-r are really wrongly defined at least in the way I understand "short" options. They should not be just "shorter". Single '-' indicates that the option is ONE_LETTER only - this is in order to allow to combine several flags together. So the `-rc` is really equivalent of `-r` and `-c` and those options. Maybe that also confuses click.
BTW. There is absolutely no reason to use short (or even shorter) options in CI. They only remove readability (longer options are more readable and give more context by just reading them - so I always try to - at least - use longer options in CI.
> Also, I have been having issues with post-breeze step
This is the same reason as above - there is a "git clean" and likely other steps that are used in the release process and they are in order to make sure that there are no accidental artifacts addedd while preparing the release. But those (in this case checked out submodules) are needed by the CI - so the clean command should be skipped on CI
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068688836
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
Oh Absolutely. We should limit what we skip in CI to absolute minimum.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068400583
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,183 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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 confirm_action("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 confirm_action(f"Create stable branch: v{version_branch}-stable?"):
+ run_command(["git", "checkout", "-b", f"v{version_branch}-stable"])
+ console_print(f"Created branch: v{version_branch}-stable")
+ else:
+ run_command(["git", "checkout", f"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 confirm_action("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"])
+ run_command(["git", "checkout", f"v{version_branch}-stable"])
+ run_command(["git", "push", "--set-upstream", "origin", f"v{version_branch}-stable"])
+
+
+def checkout_main():
+ if confirm_action("We now need to checkout main. Continue?"):
+ run_command(["git", "checkout", "main"])
+ run_command(["git", "pull"])
+
+
+def instruction_update_version_branch(version_branch):
+ if confirm_action("Now, we need to manually update the version branches in main. Continue?"):
+ console_print()
+ console_print(
+ f"Add v{version_branch}-stable and v{version_branch}-test branches "
+ "in codecov.yml (there are 2 places in the file!)"
+ )
+ console_print("Areas to add the branches will look like this:")
+ console_print(
+ """
+ branches:
+ - main
+ - v2-0-stable
+ - v2-0-test
+ - v2-1-stable
+ - v2-1-test
+ - v2-2-stable
+ - v2-2-test
+ """
+ )
+ console_print()
+ console_print(f"Add v{version_branch}-stable to .asf.yaml ({version_branch} is your new branch)")
+ console_print(
+ f"""
+ protected_branches:
+ main:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ ...
+ v{version_branch}-stable:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ """
+ )
+ console_print("Once you finish with the above. Commit the changes and make a PR against main")
+ confirm_action("I'm done with the changes. Continue?", abort=True)
+
+
+def create_constraints(version_branch):
+ if CI:
Review Comment:
This?
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if confirm_action(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
Review Comment:
This?
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,183 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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 confirm_action("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:
Review Comment:
This?
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
Review Comment:
This?
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,183 @@
+# 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 confirm_action
+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:
Review Comment:
Do we need to skip this in CI?
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,183 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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:
Review Comment:
This?
##########
dev/breeze/src/airflow_breeze/commands/release_candidate_command.py:
##########
@@ -0,0 +1,343 @@
+# 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 confirm_action
+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 merge_pr(version_branch):
+ if CI:
+ console_print("Skipping merge PR in CI")
+ return
+ if confirm_action("Do you want to merge the Sync PR?"):
+ run_command(
+ [
+ "git",
+ "checkout",
+ f"v{version_branch}-stable",
+ ]
+ )
+ run_command(["git", "reset", "--hard", f"origin/v{version_branch}-stable"])
+ run_command(["git", "merge", "--ff-only", f"v{version_branch}-test"])
+ if confirm_action("Do you want to push the changes? Pushing the changes closes the PR"):
+ run_command(["git", "push", "origin", f"v{version_branch}-stable"])
+
+
+def git_tag(version):
+ if CI:
Review Comment:
This?
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068683038
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,183 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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 confirm_action("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:
Review Comment:
I think this can be done as well in CI.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1062907718
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I think we should consider having some test coverage in `dev/breeze/tests` instead of a new job here. I think high level stuff is okay (like what you have here), but that'd be a better spot for it.
That'll also let us get rid of the "CI" conditional checks in the code.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1400284160
Previously, some of the commands used to check out branches were being executed in the CI. However, because this change was not in the checked-out branch, the codes could not be found and the process failed. To resolve this issue, the solution was to run the branch check-out commands in dry-run mode.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
norm commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1032263988
##########
dev/breeze/src/airflow_breeze/utils/confirm.py:
##########
@@ -98,3 +98,20 @@ def user_confirm(
if quit_allowed:
return Answer.QUIT
sys.exit(1)
+
+
+def user_confirm_bool(
Review Comment:
`user_must_confirm`?
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
norm commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1034581439
##########
dev/breeze/src/airflow_breeze/utils/confirm.py:
##########
@@ -98,3 +98,20 @@ def user_confirm(
if quit_allowed:
return Answer.QUIT
sys.exit(1)
+
+
+def user_confirm_bool(
Review Comment:
👍
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1030624579
##########
.github/workflows/ci.yml:
##########
@@ -737,6 +737,42 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
+ timeout-minutes: 80
+ name: "Test Airflow release commands"
+ runs-on: "${{needs.build-info.outputs.runs-on}}"
+ needs: [build-info, wait-for-ci-images]
+ env:
+ RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
+ PYTHON_MAJOR_MINOR_VERSION: "${{needs.build-info.outputs.default-python-version}}"
+ steps:
+ - name: Cleanup repo
+ run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ - name: >
+ Prepare breeze & CI image: ${{needs.build-info.outputs.default-python-version}}:${{env.IMAGE_TAG}}
+ uses: ./.github/actions/prepare_breeze_and_image
+ - name: "Cleanup dist files"
+ run: rm -fv ./dist/*
+ - name: Install subversion
+ shell: bash
+ run: sudo apt-get install libsvn-dev libapache2-mod-svn subversion-tools subversion
Review Comment:
I mean I will have to rebuild it so hold on
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy merged pull request #27829: Improving the release process
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy merged PR #27829:
URL: https://github.com/apache/airflow/pull/27829
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1323919978
> @potiuk, Concerning running this on the CI with `dry_option` and `--answer yes`, I think we should not. It looks risky and doesn't seem to give us information on whether the command is still ok. Like it just lists the commands that it should run without running them. I don't think it's useful considering that if there's any mistake on the `dry_option` or CI, we risk running the commands for real. The risk seems to outweigh the testing on CI
>
> The thought of a mistake makes me want to exclude it from what we should test on the CI.
Setting --dry-run for all makes no sense indeed. But I think it makes perfect to do all the steps except pushing the changes (this can be skipped if CI). There is no risk involved. The tokens we have on CI in regular job are read-only so there is no risk we will actually persist any changes. The local repo is checked out locally and wiped out after the job is finished so any changes to it are not persisted - from what I see just "pushing" any changes will have to be "dry-runed" based on CI, all the other steps can be safely executed (and if you try to push something or otherwise change the state of repo - you will see a failure because the CI job has no permissions to change anything other than in local copy of the workspace.
Those are the defauilt permissions in the ci.yml:
```
permissions:
# All other permissions are set to none
contents: read
packages: read
```
And in order for the job to have permission to change anything, it has to be given those permissions (this is for packages but `contents: write` needs to be set to be able to push to the repo:
```
build-ci-images:
permissions:
packages: write
```
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1323934130
Nice. Thanks once more!
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1055567220
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,181 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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 confirm_action("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 confirm_action(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 confirm_action("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"])
+ run_command(["git", "checkout", f"v{version_branch}-stable"])
+ run_command(["git", "push", "--set-upstream", "origin", f"v{version_branch}-stable"])
+
+
+def checkout_main():
+ if confirm_action("We now need to checkout main. Continue?"):
+ run_command(["git", "checkout", "main"])
+ run_command(["git", "pull"])
+
+
+def instruction_update_version_branch(version_branch):
+ if confirm_action("Now, we need to manually update the version branches in main. Continue?"):
+ console_print()
+ console_print(
+ f"Add v{version_branch}-stable and v{version_branch}-test branches "
+ "in codecov.yml (there are 2 places in the file!)"
+ )
+ console_print("Areas to add the branches will look like this:")
+ console_print(
+ """
+ branches:
+ - main
+ - v2-0-stable
+ - v2-0-test
+ - v2-1-stable
+ - v2-1-test
+ - v2-2-stable
+ - v2-2-test
+ """
+ )
+ console_print()
+ console_print(f"Add v{version_branch}-stable to .asf.yaml ({version_branch} is your new branch)")
+ console_print(
+ f"""
+ protected_branches:
+ main:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ ...
+ v{version_branch}-stable:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ """
+ )
+ console_print("Once you finish with the above. Commit the changes and make a PR against main")
+ confirm_action("I'm done with the changes. Continue?", abort=True)
+
+
+def create_constraints(version_branch):
+ if CI:
+ console_print("Skipping creating constraints in CI")
+ return
+ if confirm_action("Do you want to create branches from the constraints main?"):
+ run_command(["git", "checkout", "constraints-main"])
+ run_command(["git", "checkout", "-b", f"constraints-{version_branch}"])
+ if confirm_action("Push the new branch?"):
+ run_command(["git", "push", "--set-upstream", "origin", f"constraints-{version_branch}"])
+
+
+@click.command(
+ name="create-minor-branch",
+ help="Create a new version branch and update the default branches in main",
+ hidden=True,
+)
+@click.option("--version-branch", help="The version branch you want to create e.g 2-4", required=True)
+@option_answer
+def create_minor_version_branch(version_branch):
+ for obj in version_branch.split("-"):
+ assert isinstance(int(obj), int)
+ os.chdir(AIRFLOW_SOURCES_ROOT)
+ repo_root = os.getcwd()
+ console_print()
+ console_print(f"Repo root: {repo_root}")
+ console_print(f"Version branch: {version_branch}")
+ console_print("Below are your git remotes. We will push to origin:")
+ run_command(["git", "remote", "-v"])
+ console_print()
+ confirm_action("Verify that the above information is correct. Do you want to continue?", abort=True)
+ # Final confirmation
+ confirm_action("Pushes will be made to origin. Do you want to continue?", abort=True)
+ # Create a new branch from main
+ create_branch(version_branch)
+ # Build ci image
+ if confirm_action("Build latest breeze image?"):
Review Comment:
Probably built recently but subsequent command failed and you are rerunning
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1069133909
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if confirm_action(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
Review Comment:
I personally think SVN was a huge side-step when it comes to source control (even comparing to it's predecessor CSV (which i used a lot and have only good memories about). About the only good thing that SVN added was multi-file atomic changes. But it added so much complexity in terms of UX and did not solve evne basic commands for source maintenance especially when it comes to corrcting mistakes you've done. Luckily mercurial ,(now largely defunct) and git got it right. About the only thing SVN is better out-of-the-box is to keep large binary files history. So it's kinda ok to keep it for our artifacts. But it should be very simple set of commands to use :)
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1397483090
I think you might wan to re-install breeze (via the composite action we use elsewhere) just before "Fix ownership" job. This should fix the last problem @ephraimbuddy
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1399875924
> I think you might wan to re-install breeze (via the composite action we use elsewhere) just before "Fix ownership" job. This should fix the last problem @ephraimbuddy
Re-installing breeze didn't work. I will come back to debug it again, I believe it's from what now runs within the code in the CI unlike before when I skipped them.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1063217565
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I am not so sure about it. The breeze/tests are really "unit tests" and this is cool for some internal logic an behaviour (for example "selective-checks" logic is very thoroughly tested by unit tests).
What running the commands directly as "users" would use them, we are testing more - those are equivalent of "system tests" we have in AIP-47, and for breeze, just running the commands is much better way of doing it. It tests much more than any kind of unit tests can do:
* they test parsing of the commands passed
* they produce the colorful output that the user would see so that we can manually verify them in CI output
* finally - they provide examples of how you should run those commands when manually releasing, so that you can always refer to the commands we have in CI (I've used it multiple times in the past - to be sure about it
Most of the breeze command functionality is tested this way (and this is one of the main reasons breeze Python refactoring was specifically aimed to be able to run the same commands manually AND in CI - this was one of the decisions we made when rewriting breeze in Python - to be able to use exactly the same commands in the CI as we use manually, to avoid regressions. Previously we had a different approach - where we had "common" libraries in Bash and they were run by `breeze` bash CLI manually but the same functionality was run via separate "ci" scripts in CI and this caused multiple, multiple regressions for the users.
Right now pretty much ALL breeze commands are run in the CI precisely for that reason as part of the CI build even if they are not `strictly` needed - to prevent regressions.
A very good recent example of similar regression when we did NOT run breeze command has been recently fixed in https://github.com/apache/airflow/pull/28683 (@elradkal might confirm it added up to the pains of his release process). We did not have `breeze release-management generate-issue-content --only-available-in-dist` command run in CI and when Elad attempted to generate it at release time, it crashed (because an earlier refactor of mine introduced bugs).
My philosophy on Breeze and release process is that it shoudl **always** work when release manager attempts to do it and it should not add friction (that is the goal at least). And the only way to do be sure about it, is to run the command that release-manager uses as part of our CI. There is no other sane way to achieve it.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1338975540
The problem is that breeze is reinstalling itself because it sees that dependencies changed. For whatever reason, the information that tehre are new packages has not been updated. Looking at that.
Basically breeze in your branch now produces this output (and this confuses Github Actions because it parses it as output):
```
Breeze dependencies changed since the installation!
This might cause various problems!!
If you experience problems - reinstall Breeze with:
breeze setup self-upgrade
This should usually take couple of seconds.
Reinstalling Breeze from /home/jarek/code/airflow/dev/breeze
Installing to existing venv 'apache-airflow-breeze'
⚠️ Note: breeze was already on your PATH at /home/jarek/.pyenv/shims/breeze
installed package apache-airflow-breeze 0.0.1, installed using Python 3.9.13
These apps are now globally available
- breeze
done! ✨ 🌟 ✨
```
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1346119907
> Ok. I think I need to install it on my PC
Hmm. It should install itself automatically - maybe it is missing in one of the .pre-commits.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1345934132
> cc: @ephraimbuddy
Thanks. Have updated it. It seems like `inputimeout` is not installed in the image because it errors out during pre-commit run:
```
File "/Users/ephraimbuddy/Documents/astronomer/airflow/dev/breeze/src/airflow_breeze/commands/main_command.py", line 159, in check_for_rosetta_environment
from inputimeout import TimeoutOccurred, inputimeout
ModuleNotFoundError: No module named 'inputimeout'
```
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1323644895
Already in couple of places:
```
if os.environ.get("CI"):
```
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1323552652
Comment - this is super cool that breeze gets first "big" contribution like that :)
Before the previous comment, I think (as mentioned in the other comment) it would be great if the release process is automatically tested in our CI (similarly to what we do for other release-management commands) - as this is the only way we can actually make sure the commands still work after any refactor/fix/etc.
See for example here:
https://github.com/apache/airflow/blob/093345cb61cea623bffe6af5a41d6ba417dfcf6f/.github/workflows/ci.yml#L703
BTW. That made me realise that I lost the 'breeze release-management prepare-provider-documentation` command from CI and I need to restore it. PR for that shortly.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1323567848
@ephraimbuddy - the "prepare-provider-documenation" step is added here https://github.com/apache/airflow/pull/27832 - let's see if it works fine. `ANSWER="yes"` is passed from the job environments (see the top of the file) so it should simulate the user answering "yes" to all questions.
I think it will not work, I will have to add some other "bypass" there - becasue there is a question about the type of change as well, but I will add it when I see it working. Something similar you will have to do in your PR, likely for some of the operations. i think it is entirely worthy of that - this way you do not have to worry during release if the tool still works or not.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1033389686
##########
dev/breeze/src/airflow_breeze/utils/confirm.py:
##########
@@ -98,3 +98,20 @@ def user_confirm(
if quit_allowed:
return Answer.QUIT
sys.exit(1)
+
+
+def user_confirm_bool(
Review Comment:
Let me know if that makes sense
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1033388915
##########
dev/breeze/src/airflow_breeze/utils/confirm.py:
##########
@@ -98,3 +98,20 @@ def user_confirm(
if quit_allowed:
return Answer.QUIT
sys.exit(1)
+
+
+def user_confirm_bool(
Review Comment:
Changed to `confirm_action`
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1063217565
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I am not so sure about it. The breeze/tests are really "unit tests" and this is cool for some internal logic an behaviour (for example "selective-checks" logic is very thoroughly tested by unit tests).
What running the commands directly as "users" would use them, we are testing more - those are equivalent of "system tests" we have in AIP-47, and for breeze, just running the commands is much better way of doing it. It tests much more than any kind of unit tests can do:
* they test parsing of the commands/parameters passed
* they produce the colorful output that the user would see so that we can manually verify them in CI output
* finally - they provide examples of how you should run those commands when manually releasing, so that you can always refer to the commands we have in CI (I've used it multiple times in the past - to be sure about it
Most of the breeze command functionality is tested this way (and this is one of the main reasons breeze Python refactoring was specifically aimed to be able to run the same commands manually AND in CI - this was one of the decisions we made when rewriting breeze in Python - to be able to use exactly the same commands in the CI as we use manually, to avoid regressions. Previously we had a different approach - where we had "common" libraries in Bash and they were run by `breeze` bash CLI manually but the same functionality was run via separate "ci" scripts in CI and this caused multiple, multiple regressions for the users.
Right now pretty much ALL breeze commands are run in the CI precisely for that reason as part of the CI build even if they are not `strictly` needed - to prevent regressions.
A very good recent example of similar regression when we did NOT run breeze command has been recently fixed in https://github.com/apache/airflow/pull/28683 (@elradkal might confirm it added up to the pains of his release process). We did not have `breeze release-management generate-issue-content --only-available-in-dist` command run in CI and when Elad attempted to generate it at release time, it crashed (because an earlier refactor of mine introduced bugs).
My philosophy on Breeze and release process is that it shoudl **always** work when release manager attempts to do it and it should not add friction (that is the goal at least). And the only way to do be sure about it, is to run the command that release-manager uses as part of our CI. There is no other sane way to achieve it.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068772776
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if confirm_action(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
Review Comment:
You might be surprised how different (and not obvious) SVN behaviour vs Git is sometimes:
https://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.copy.html
You will find out that depending on the parameter FORMAT it's either:
* scheduling for changing or
* commiting the change or
* complete server side copy
All while running the same `svn cp`.
If anything, I'd err on the side of caution and not do any svn operation. in CI.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068687794
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if confirm_action(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
Review Comment:
this for sure. We might opt to display the command to run instead.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068766666
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if confirm_action(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
Review Comment:
Same with this, until we do the commit isn't this all local?
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1338728668
> I think you need to rebase @ephraimbuddy :)
Seems there's something I did wrong because the build info has always failed recently after each rebase. Any ideas?
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1323886749
@potiuk, Concerning running this on the CI with `dry_option` and `--answer yes`, I think we should not. It looks risky and doesn't seem to give us information on whether the command is still ok. Like it just lists the commands that it should run without running them. I don't think it's useful considering that if there's any mistake on the `dry_option` or CI, we risk running the commands for real. The risk seems to outweigh the testing on CI
The thought of a mistake makes me want to exclude it from what we should test on the CI.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1030620575
##########
.github/workflows/ci.yml:
##########
@@ -737,6 +737,42 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
+ timeout-minutes: 80
+ name: "Test Airflow release commands"
+ runs-on: "${{needs.build-info.outputs.runs-on}}"
+ needs: [build-info, wait-for-ci-images]
+ env:
+ RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
+ PYTHON_MAJOR_MINOR_VERSION: "${{needs.build-info.outputs.default-python-version}}"
+ steps:
+ - name: Cleanup repo
+ run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ - name: >
+ Prepare breeze & CI image: ${{needs.build-info.outputs.default-python-version}}:${{env.IMAGE_TAG}}
+ uses: ./.github/actions/prepare_breeze_and_image
+ - name: "Cleanup dist files"
+ run: rm -fv ./dist/*
+ - name: Install subversion
+ shell: bash
+ run: sudo apt-get install libsvn-dev libapache2-mod-svn subversion-tools subversion
Review Comment:
I can add svn to our AMI one moment
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1386903443
Please fix those - and if it still does not help - I might take a closer look.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1386921743
> Please fix those - and if it still does not help - I might take a closer look.
On it. Thanks
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1063218949
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
BTW. The decision about that (sharing CI and manual commands have been recorded here:
https://github.com/apache/airflow/blob/main/dev/breeze/doc/adr/0002-implement-standalone-python-command.md
> There is enough overlap between the CI and Breeze to reuse a lot of commands for building images and other CI actions that they should be shared between Breeze and CI. Therefore dev/Breeze will also become a home for all the CI scripts that will be used in GitHubActions in CI.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1063217565
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I am not so sure about it. The breeze/tests are really "unit tests" and this is cool for some internal logic and behaviour (for example "selective-checks" logic is very thoroughly tested by unit tests).
By running the commands directly as "users" would use them, we are testing more - those are equivalent of "system tests" we have in AIP-47, and for breeze, just running the commands is much better way of doing it. It tests much more than any kind of unit tests can do:
* they test parsing of the commands/parameters passed
* they produce the colorful output that the user would see so that we can manually verify them in CI output
* finally - they provide examples of how you should run those commands when manually releasing, so that you can always refer to the commands we have in CI (I've used it multiple times in the past - to be sure about it
Most of the breeze command functionality is tested this way (and this is one of the main reasons breeze Python refactoring was specifically aimed to be able to run the same commands manually AND in CI - this was one of the decisions we made when rewriting breeze in Python - to be able to use exactly the same commands in the CI as we use manually, to avoid regressions. Previously we had a different approach - where we had "common" libraries in Bash and they were run by `breeze` bash CLI manually but the same functionality was run via separate "ci" scripts in CI and this caused multiple, multiple regressions for the users.
Right now pretty much ALL breeze commands are run in the CI precisely for that reason as part of the CI build even if they are not `strictly` needed - to prevent regressions.
A very good recent example of similar regression when we did NOT run breeze command has been recently fixed in https://github.com/apache/airflow/pull/28683 (@eladkal might confirm it added up to the pains of his release process). We did not have `breeze release-management generate-issue-content --only-available-in-dist` command run in CI and when Elad attempted to generate it at release time, it crashed (because an earlier refactor of mine introduced bugs).
My philosophy on Breeze and release process is that it should **always** work when release manager attempts to do it and it should not add friction (that is the goal at least). And the only way to do be sure about it, is to run the command that release-manager uses as part of our CI. There is no other sane way to achieve it.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068772776
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if confirm_action(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
Review Comment:
You might be surprised how different SVN vs Git is and it's sometimes not obvious:
https://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.copy.html
You will find out that depending on the parameter FORMAT it's either:
* scheduling for chaning or
* commiting the change
* or complete server side copy
All while running the same `svn cp`.
If anything, I'd err on the side of caution and not do any svn operation. in CI.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068766395
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 confirm_action
+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 clone_asf_repo(working_dir):
+ if confirm_action("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
Review Comment:
Might be worth trying at least. I thought it didn't persist anything remote until you did the commit.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1336621231
I think you need to rebase @ephraimbuddy :)
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1338988657
cc: @ephraimbuddy
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1055569207
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,181 @@
+# 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 confirm_action
+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 confirm_action(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 confirm_action("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 confirm_action("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 confirm_action(f"Create stable branch: v{version_branch}-stable?"):
Review Comment:
Makes sense
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1063217565
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I am not so sure about it. The breeze/tests are really "unit tests" and this is cool for some internal logic and behaviour (for example "selective-checks" logic is very thoroughly tested by unit tests).
By running the commands directly as "users" would use them, we are testing more - those are equivalent of "system tests" we have in AIP-47, and for breeze, just running the commands is much better way of doing it. It tests much more than any kind of unit tests can do:
* they test parsing of the commands/parameters passed
* they produce the colorful output that the user would see so that we can manually verify them in CI output
* finally - they provide examples of how you should run those commands when manually releasing, so that you can always refer to the commands we have in CI (I've used it multiple times in the past - to be sure about it
Most of the breeze command functionality is tested this way (and this is one of the main reasons breeze Python refactoring was specifically aimed to be able to run the same commands manually AND in CI - this was one of the decisions we made when rewriting breeze in Python - to be able to use exactly the same commands in the CI as we use manually, to avoid regressions. Previously we had a different approach - where we had "common" libraries in Bash and they were run by `breeze` bash CLI manually but the same functionality was run via separate "ci" scripts in CI and this caused multiple, multiple regressions for the users.
Right now pretty much ALL breeze commands are run in the CI precisely for that reason as part of the CI build even if they are not `strictly` needed - to prevent regressions.
A very good recent example of similar regression when we did NOT run breeze command has been recently fixed in https://github.com/apache/airflow/pull/28683 (@eladkal might confirm it added up to the pains of his release process). We did not have `breeze release-management generate-issue-content --only-available-in-dist` command run in CI and when Elad attempted to generate it at release time, it crashed (because an earlier refactor of mine introduced bugs).
My philosophy on Breeze and release process is that it should **always** work when release manager attempts to do it and it should not add friction (that is the goal at least). And the only way to do be sure about it, is to run the command that release-manager uses as part of our CI. There is no other sane way to achieve it IMHO.
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I am not so sure about it. The breeze/tests are really "unit tests" and this is cool for some internal logic and behaviour (for example "selective-checks" logic is very thoroughly tested by unit tests).
By running the commands directly as "users" would use them, we are testing more - those are equivalent of "system tests" we have in AIP-47, and for breeze, just running the commands is much better way of doing it. It tests much more than any kind of unit tests can do:
* they test parsing of the commands/parameters passed
* they produce the colorful output that the user would see so that we can manually verify them in CI output
* finally - they provide examples of how you should run those commands when manually releasing, so that you can always refer to the commands we have in CI (I've used it multiple times in the past - to be sure about it
Most of the breeze command functionality is tested this way (and this is one of the main reasons breeze Python refactoring was specifically aimed to be able to run the same commands manually AND in CI - this was one of the decisions we made when rewriting breeze in Python - to be able to use exactly the same commands in the CI as we use manually, to avoid regressions. Previously we had a different approach - where we had "common" libraries in Bash and they were run by `breeze` bash CLI manually but the same functionality was run via separate "ci" scripts in CI and this caused multiple, multiple regressions for the users.
Right now pretty much ALL breeze commands are run in the CI precisely for that reason as part of the CI build even if they are not `strictly` needed - to prevent regressions.
A very good recent example of similar regression when we did NOT run breeze command has been recently fixed in https://github.com/apache/airflow/pull/28683 (@eladkal might confirm it added up to the pains of his release process). We did not have `breeze release-management generate-issue-content --only-available-in-dist` command run in CI and when Elad attempted to generate it at release time, it crashed (because an earlier refactor of mine introduced bugs).
My philosophy on Breeze and release process is that it should **always** work when release manager attempts to do it and it should not add friction (that is the goal at least). And the only way to do be sure about it, is to run the commands that release-manager uses as part of our CI. There is no other sane way to achieve it IMHO.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1063217565
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I am not so sure about it. The breeze/tests are really "unit tests" and this is cool for some internal logic an behaviour (for example "selective-checks" logic is very thoroughly tested by unit tests.
What running the commands directly as "users" would use them, we are testing more - those are equivalent of "system tests" we have in AIP-47, and for breeze, just running the commands is much better way of doing it. It tests much more than any kind of unit tests can do:
* they test parsing of the commands passed
* they produce the colorful output that the user would see so that we can manually verify them in CI output
* finally - they provide examples of how you should run those commands when manually releasing, so that you can always refer to the commands we have in CI (I've used it multiple times in the past - to be sure about it
Most of the breeze command functionality is tested this way (and this is one of the main reasons breeze Python refactoring was specifically aimed to be able to run the same commands manually AND in CI - this was one of the decisions we made when rewriting breeze in Python - to be able to use exactly the same commands in the CI as we use manually, to avoid regressions. Previously we had a different approach - where we had "common" libraries in Bash and they were run by `breeze` bash CLI manually but the same functionality was run via separate "ci" scripts in CI and this caused multiple, multiple regressions for the users.
Right now pretty much ALL breeze commands are run in the CI precisely for that reason as part of the CI build even if they are not `strictly` needed - to prevent regressions.
A very good recent example of similar regression when we did NOT run breeze command has been recently fixed in https://github.com/apache/airflow/pull/28683 (@elradkal might confirm it added up to the pains of his release process). We did not have `breeze release-management generate-issue-content --only-available-in-dist` command run in CI and when Elad attempted to generate it at release time, it crashed (because an earlier refactor of mine introduced bugs).
My philosophy on Breeze and release process is that it shoudl **always** work when release manager attempts to do it and it should not add friction (that is the goal at least). And the only way to do be sure about it, is to run the command that release-manager uses as part of our CI. There is no other sane way to achieve it.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1386750234
Hi @potiuk, It seems like there's something wrong with the breeze build on this PR. For example, here: https://github.com/apache/airflow/actions/runs/3947115412/jobs/6755756155#step:8:33 it's saying that the command does not exist. Also, I have been having issues with post-breeze step
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068340565
##########
.github/workflows/ci.yml:
##########
@@ -747,6 +747,41 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
Review Comment:
I see. Adding new jobs like this still feels like it could lead to unnecessary CI job growth, and I really don't like all the CI conditionally in the code, but you've clearly spent more time thinking through this area so I'll defer to you here.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1068681215
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,183 @@
+# 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 confirm_action
+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:
Review Comment:
We don't. Creating a branch is ok.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1400624961
Nice!
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1029227947
##########
dev/breeze/src/airflow_breeze/commands/minor_release_command.py:
##########
@@ -0,0 +1,165 @@
+# 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.
+
+import os
+
+import click
+
+from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT
+from airflow_breeze.utils.run_utils import run_command
+
+
+def create_branch(version_branch):
+ if click.confirm(f"Create version branch: {version_branch}?"):
Review Comment:
I think it will be better to plugin into the mechanisms we've implemented in Breeze for that `airflow_breeze.utils.confirm` and `airflow_breeze.utils.console`.
There are few reasons for it (and why I deliberately chose not to use them)
# Confirm
So far I always made sure that any command I run manually is also executed automatically in our CI process - this is the only way to keep it "working" especially if those are things that are rarely used (release process). The saying is "if there is something painful", run it more often.
My approach for a new command similar to what you are adding here is to add a CI job to actually run the command to some extent at least (i.e. not to make actual release) in CI - just to see that the command continues to work. This is also helpful in case of any future refactorings - if the command will continue to run and get a "green" PR mark, then any refactorings you might want to make is "safer".
For that purpose - our `confirm` has a built-in mechanism that rather than asking for input it can base it on `--answer` flag. You can add `--answer yes` and then any confirm operation will act as if user answered `yes`. This is much better solution than the click.confirm one where you would have to literally redirect input from a file or something to get similar result (this is main reason why we have our own util for that.
There are few more reasons why we have our own confirm (mostly about timeout) but all the reasons and architecture decision record documenting why and how are nicely documented in this ADR: https://github.com/apache/airflow/blob/main/dev/breeze/doc/adr/0012-asking-user-for-confirmation.md
# Echo
Regarding the echo, we also deliberately use `rich` console (in our `console` util), to be able to have unified communication mechanism and use colors to communicate with the user (and we even have a mechanism to change breeze configuration to convert it into color-blind-friendly communication). So whenever we communicate something to a user we have to choose what type of the message it is - info, warning, error and use the right rich style. Also the console works well in our CI with appropriate lenght of the screen etc. so it is better to use it for the CI reason.
More information about this unified communication style is in this ADR explaining what are the kinds of messages you should pass to the user and how the colour-blind-friendly approach is done: https://github.com/apache/airflow/blob/main/dev/breeze/doc/adr/0011-unified-communication-with-the-users.md
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1030635157
##########
.github/workflows/ci.yml:
##########
@@ -737,6 +737,42 @@ jobs:
run: breeze ci fix-ownership
if: always()
+ test-airflow-release-commands:
+ timeout-minutes: 80
+ name: "Test Airflow release commands"
+ runs-on: "${{needs.build-info.outputs.runs-on}}"
+ needs: [build-info, wait-for-ci-images]
+ env:
+ RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
+ PYTHON_MAJOR_MINOR_VERSION: "${{needs.build-info.outputs.default-python-version}}"
+ steps:
+ - name: Cleanup repo
+ run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ - name: >
+ Prepare breeze & CI image: ${{needs.build-info.outputs.default-python-version}}:${{env.IMAGE_TAG}}
+ uses: ./.github/actions/prepare_breeze_and_image
+ - name: "Cleanup dist files"
+ run: rm -fv ./dist/*
+ - name: Install subversion
+ shell: bash
+ run: sudo apt-get install libsvn-dev libapache2-mod-svn subversion-tools subversion
Review Comment:
Ok. Thanks
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] norm commented on a diff in pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
norm commented on code in PR #27829:
URL: https://github.com/apache/airflow/pull/27829#discussion_r1032252036
##########
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"])
+ run_command(["git", "checkout", f"v{version_branch}-stable"])
+ run_command(["git", "push", "--set-upstream", "origin", f"v{version_branch}-stable"])
+
+
+def checkout_main():
+ if user_confirm_bool("We now need to checkout main. Continue?"):
+ run_command(["git", "checkout", "main"])
+ run_command(["git", "pull"])
+
+
+def instruction_update_version_branch(version_branch):
+ if user_confirm_bool("Now, we need to manually update the version branches in main. Continue?"):
+ console_print()
+ console_print(
+ f"Add v{version_branch}-stable and v{version_branch}-test branches "
+ "in codecov.yml (there are 2 places in the file!)"
+ )
+ console_print(
+ """
+ branches:
+ - main
+ - v2-0-stable
+ - v2-0-test
+ - v2-1-stable
+ - v2-1-test
+ - v2-2-stable
+ - v2-2-test
+ """
+ )
+ console_print(f"Add v{version_branch}-stable to .asf.yaml ({version_branch} is your new branch)")
+ console_print(
+ f"""
+ protected_branches:
+ main:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ ...
+ v{version_branch}-stable:
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ """
+ )
+ console_print("Once you finish with the above. Commit the changes and make a PR against main")
+ user_confirm_bool("I'm done with the changes. Continue?", abort=True)
+
+
+def create_constraints(version_branch):
+ if CI:
+ console_print("Skipping creating constraints in CI")
+ return
+ if user_confirm_bool("Do you want to create branches from the constraints main?"):
+ run_command(["git", "checkout", "constraints-main"])
+ run_command(["git", "checkout", "-b", f"constraints-{version_branch}"])
+ if user_confirm_bool("Push the new branch?"):
+ run_command(["git", "push", "--set-upstream", "origin", f"constraints-{version_branch}"])
+
+
+@click.command(
+ name="create-minor-branch",
+ help="Create a new version branch and update the default branches in main",
+ hidden=True,
+)
+@click.option("--version-branch", help="The version branch you want to create e.g 2-4", required=True)
+@option_answer
+def create_minor_version_branch(version_branch):
+ for obj in version_branch.split("-"):
+ assert isinstance(int(obj), int)
+ os.chdir(AIRFLOW_SOURCES_ROOT)
+ repo_root = os.getcwd()
+ console_print()
+ console_print(f"Repo root: {repo_root}")
+ console_print(f"Version branch: {version_branch}")
+ user_confirm_bool("Verify that the above information are correct. Do you want to continue?", abort=True)
Review Comment:
s/are/is/ — information is singular in English :)
##########
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"])
+ run_command(["git", "checkout", f"v{version_branch}-stable"])
+ run_command(["git", "push", "--set-upstream", "origin", f"v{version_branch}-stable"])
+
+
+def checkout_main():
+ if user_confirm_bool("We now need to checkout main. Continue?"):
+ run_command(["git", "checkout", "main"])
+ run_command(["git", "pull"])
+
+
+def instruction_update_version_branch(version_branch):
+ if user_confirm_bool("Now, we need to manually update the version branches in main. Continue?"):
+ console_print()
+ console_print(
+ f"Add v{version_branch}-stable and v{version_branch}-test branches "
+ "in codecov.yml (there are 2 places in the file!)"
+ )
+ console_print(
+ """
+ branches:
Review Comment:
I assume this is illustrating what to look for, so it could be a little clearer that this is not the code to *add* but the areas to *add to*.
##########
dev/breeze/src/airflow_breeze/commands/release_command.py:
##########
@@ -0,0 +1,284 @@
+# 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 clone_asf_repo(working_dir):
+ if user_confirm_bool("Clone ASF repo?"):
+ run_command(["rm", "-rf", f"{working_dir}/asf-dist"])
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ dev_dir = f"{working_dir}/asf-dist/dev/airflow"
+ release_dir = f"{working_dir}/asf-dist/release/airflow"
+ run_command(["svn", "update", "--set-depth", "infinity", dev_dir])
+ run_command(["svn", "update", "--set-depth", "infinity", release_dir])
+
+
+def create_version_dir(version):
+ if CI:
+ console_print("Skipping creation of version dir in CI")
+ return
+ if user_confirm_bool(f"Create SVN version directory for {version}?"):
+ run_command(["svn", "mkdir", f"{version}"])
+ console_print(f"{version} directory created")
+
+
+def copy_artifacts_to_svn(rc, svn_dev_repo):
+ if CI:
+ console_print("Skipping copying artifacts to SVN in CI")
+ return
+ if user_confirm_bool(f"Copy artifacts to SVN for {rc}?"):
+ run_command(
+ [
+ "for",
+ "f",
+ "in",
+ f"{svn_dev_repo}/{rc}/*",
+ ";",
+ "do",
+ "svn",
+ "cp",
+ "$f",
+ "${$(basename $f)/}",
+ "done",
+ ]
+ )
+ console_print("Artifacts copied to SVN:")
+ run_command(["ls"])
+
+
+def commit_release(version, rc, svn_release_version_dir):
+ if CI:
+ console_print("Skipping commit in CI")
+ return
+ if user_confirm_bool(f"Commit release {version} to SVN?"):
+ run_command(["svn", "commit", "-m", f"'Release Airflow {version} from {rc}'"])
+
+
+def remove_old_release(previous_release):
+ if CI:
+ console_print("Skipping removing old release in CI")
+ return
+ if user_confirm_bool(f"Remove old release {previous_release}?"):
+ run_command(["svn", "rm", f"'{previous_release}'"])
+ run_command(["svn", "commit", "-m", f"'Remove old release: {previous_release}'"])
+ user_confirm_bool(
+ "Verify that the packages appear in "
+ "[airflow](https://dist.apache.org/repos/dist/release/airflow/). Continue?",
+ abort=True,
+ )
+
+
+def verify_pypi_package(version):
+ if user_confirm_bool("Verify PyPI package?"):
+ run_command(["twine", "check", "*.whl", f"*{version}.tar.gz"])
+
+
+def upload_to_pypi_test(version):
+ if CI:
+ console_print("Skipping upload to PyPI test in CI")
+ return
+ if user_confirm_bool("Upload to PyPI test?"):
+ run_command(["twine", "upload", "-r", "pypitest", "*.whl", f"*{version}.tar.gz"])
+ console_print("Packages pushed to test PyPI")
+ console_print(
+ "Verify that the test package looks good by downloading it and installing it into a virtual "
+ "environment. The package download link is available at: "
+ "https://test.pypi.org/project/apache-airflow/#files"
+ )
+
+
+def upload_to_pypi(version):
+ if CI:
+ console_print("Skipping upload to PyPI in CI")
+ return
+ if user_confirm_bool("Upload to PyPI?"):
+
+ user_confirm_bool(
+ "I have tested the package I uploaded to test PyPI. "
+ "I installed and ran a dag with it and there's no issue. Do you agree to the above?",
Review Comment:
I think dag is written DAG in (most of) the documentation, do the same here?
##########
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:
Oh, I see later that that is already called out in the script. Never mind :)
##########
dev/breeze/src/airflow_breeze/commands/release_candidate_command.py:
##########
@@ -0,0 +1,343 @@
+# 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 merge_pr(version_branch):
+ if CI:
+ console_print("Skipping merge PR in CI")
+ return
+ if user_confirm_bool("Do you want to merge the Sync PR?"):
+ run_command(
+ [
+ "git",
+ "checkout",
+ f"v{version_branch}-stable",
+ ]
+ )
+ run_command(["git", "reset", "--hard", f"origin/v{version_branch}-stable"])
+ run_command(["git", "merge", "--ff-only", f"v{version_branch}-test"])
+ if user_confirm_bool("Do you want to push the changes? Pushing the changes closes the PR"):
+ run_command(["git", "push", "origin", f"v{version_branch}-stable"])
+
+
+def git_tag(version):
+ if CI:
+ console_print("Skipping git tag in CI")
+ return
+ if user_confirm_bool(f"Tag {version}?"):
+ run_command(["git", "tag", "-s", f"{version}", "-m", f"'Apache Airflow {version}'"])
+ console_print("Tagged")
+
+
+def git_clean():
+ if user_confirm_bool("Clean git repo?"):
+ run_command(["git", "clean", "-fxd"])
+ console_print("Git repo cleaned")
+
+
+def tarball_release(version, version_without_rc):
+ if user_confirm_bool("Create tarball?"):
+ run_command(["rm", "-rf", "dist"])
+
+ run_command(["mkdir", "dist"])
+ run_command(
+ [
+ "git",
+ "archive",
+ "--format=tar.gz",
+ f"{version}",
+ f"--prefix=apache-airflow-{version_without_rc}/",
+ "-o",
+ f"dist/apache-airflow-{version_without_rc}-source.tar.gz",
+ ]
+ )
+ console_print("Tarball created")
+
+
+def create_artifacts_with_sdist():
+ run_command(["python3", "setup.py", "compile_assets", "sdist", "bdist_wheel"])
+ console_print("Artifacts created")
+
+
+def create_artifacts_with_breeze():
+ run_command(["breeze", "release-management", "prepare-airflow-package", "--package-format", "both"])
+ console_print("Artifacts created")
+
+
+def sign_the_release(repo_root):
+ if CI:
+ console_print("Skipping sign the release in CI")
+ return
+ if user_confirm_bool("Do you want to sign the release?"):
+ os.chdir(repo_root)
+ run_command(["pushd", "dist"])
+ run_command(["./dev/sign.sh", "*"])
+ run_command("popd")
+ console_print("Release signed")
+
+
+def tag_and_push_constraints(version, version_branch):
+ if CI:
+ console_print("Skipping tag and push constraints in CI")
+ return
+ if user_confirm_bool("Do you want to tag and push constraints?"):
+ run_command(["git", "checkout", f"origin/constraints-{version_branch}"])
+ run_command(
+ [
+ "git",
+ "tag",
+ "-s",
+ f"'constraints-{version}'",
+ "-m",
+ f"'Constraints for Apache Airflow {version}'",
+ ]
+ )
+ run_command(["git", "push", "origin", "tag", f"'constraints-{version}'"])
+ console_print("Constraints tagged and pushed")
+
+
+def clone_asf_repo(version, repo_root):
+ if user_confirm_bool("Do you want to clone asf repo?"):
+ os.chdir(repo_root)
+ run_command(
+ ["svn", "checkout", "--depth=immediates", "https://dist.apache.org/repos/dist", "asf-dist"]
+ )
+ run_command(["svn", "update", "--set-depth=infinity", "asf-dist/dev/airflow"])
+ console_print("Cloned ASF repo successfully")
+
+
+def move_artifacts_to_svn(version, repo_root):
+ if CI:
+ console_print("Skipping move artifacts to svn in CI")
+ return
+ if user_confirm_bool("Do you want to move artifacts to SVN?"):
+ os.chdir(f"{repo_root}/asf-dist/dev/airflow")
+ run_command(["svn", "mkdir", f"{version}"])
+ run_command(["mv", f"{repo_root}/dist/*", f"{version}/"])
+ console_print("Moved artifacts to SVN:")
+ run_command(["ls"])
+
+
+def push_artifacts_to_asf_repo(version, repo_root):
+ if CI:
+ console_print("Skipping push artifacts to ASF repo in CI")
+ return
+ if user_confirm_bool("Do you want to push artifacts to ASF repo?"):
+ console_print("Files to push to svn:")
+ os.chdir(f"{repo_root}/asf-dist/dev/airflow/{version}")
+ run_command(["ls"])
+ user_confirm_bool("Do you want to continue?", abort=True)
+ run_command(["svn", "add", "*"])
+ run_command(["svn", "commit", "-m", f"'Add artifacts for Airflow {version}'"])
+ console_print("Files pushed to svn")
+ os.chdir(repo_root)
+ run_command(["rm", "-rf", "asf-dist"])
+
+
+def prepare_pypi_packages(version, version_suffix, repo_root):
+ if user_confirm_bool("Prepare pypi packages?"):
+ console_print("Preparing PyPI packages")
+ os.chdir(repo_root)
+ run_command(["git", "checkout", f"{version}"])
+ run_command(
+ [
+ "breeze",
+ "release-management",
+ "prepare-airflow-package",
+ "--version-suffix-for-pypi",
+ f"{version_suffix}",
+ "--package-format",
+ "both",
+ ]
+ )
+ run_command(["twine", "check", "dist/*"])
+ console_print("PyPI packages prepared")
+
+
+def push_packages_to_test_pypi():
+ if CI:
+ console_print("Skipping push packages to test PyPI in CI")
+ return
+ if user_confirm_bool("Do you want to push packages to test PyPI?"):
+ run_command(["twine", "upload", "-r", "pypitest", "dist/*"])
+ console_print("Packages pushed to test PyPI")
+ console_print(
+ "Verify that the test package looks good by downloading it and installing it into a virtual "
+ "environment. The package download link is available at: "
+ "https://test.pypi.org/project/apache-airflow/#files"
+ )
+
+
+def push_packages_to_pypi():
+ if CI:
+ console_print("Skipping push packages to PyPI in CI")
+ return
+ if user_confirm_bool("Do you want to push packages to production PyPI?"):
+ user_confirm_bool(
+ "I have tested the package I uploaded to test PyPI. "
+ "I installed and ran a dag with it and there's no issue. Do you agree to the above?",
Review Comment:
Another lower-case dag.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1346084903
And static checks seemed to succeed in this run BTW :) ?
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1346094951
> Which pre-commit ? This does not seem like it is run in image (it would be /opt/airflow path then). Each pre-commit has their own dependencies and you need to make sure they are installed when they are run - they heave their dependencies declrated in .pre-commit-config.yml file..
```
Update output of breeze commands in BREEZE.rst.........................................Failed
- hook id: update-breeze-cmd-output
- exit code: 1
OK. The setup_autocomplete screenshot is embedded in BREEZE.rst.
OK. The testing_helm-tests screenshot is embedded in BREEZE.rst.
OK. The release-management_generate-constraints screenshot is embedded in BREEZE.rst.
OK. The static-checks screenshot is embedded in BREEZE.rst.
OK. The exec screenshot is embedded in BREEZE.rst.
OK. The setup screenshot is embedded in BREEZE.rst.
OK. The prod-image_pull screenshot is embedded in BREEZE.rst.
OK. The ci-image_build screenshot is embedded in BREEZE.rst.
OK. The release-management_verify-provider-packages screenshot is embedded in BREEZE.rst.
OK. The ci screenshot is embedded in BREEZE.rst.
OK. The prod-image_build screenshot is embedded in BREEZE.rst.
OK. The k8s_build-k8s-image screenshot is embedded in BREEZE.rst.
OK. The ci-image screenshot is embedded in BREEZE.rst.
OK. The k8s screenshot is embedded in BREEZE.rst.
OK. The release-management_prepare-airflow-package screenshot is embedded in BREEZE.rst.
OK. The k8s_run-complete-tests screenshot is embedded in BREEZE.rst.
OK. The ci_free-space screenshot is embedded in BREEZE.rst.
OK. The release-management_prepare-provider-packages screenshot is embedded in BREEZE.rst.
OK. The testing_tests screenshot is embedded in BREEZE.rst.
OK. The k8s_upload-k8s-image screenshot is embedded in BREEZE.rst.
OK. The ci-image_pull screenshot is embedded in BREEZE.rst.
OK. The setup_self-upgrade screenshot is embedded in BREEZE.rst.
OK. The release-management_release-prod-images screenshot is embedded in BREEZE.rst.
OK. The ci_resource-check screenshot is embedded in BREEZE.rst.
OK. The compile-www-assets screenshot is embedded in BREEZE.rst.
OK. The ci_get-workflow-info screenshot is embedded in BREEZE.rst.
OK. The prod-image screenshot is embedded in BREEZE.rst.
OK. The k8s_configure-cluster screenshot is embedded in BREEZE.rst.
OK. The k8s_tests screenshot is embedded in BREEZE.rst.
OK. The ci_selective-check screenshot is embedded in BREEZE.rst.
OK. The k8s_deploy-airflow screenshot is embedded in BREEZE.rst.
OK. The k8s_setup-env screenshot is embedded in BREEZE.rst.
OK. The stop screenshot is embedded in BREEZE.rst.
OK. The shell screenshot is embedded in BREEZE.rst.
OK. The ci-image_verify screenshot is embedded in BREEZE.rst.
OK. The testing screenshot is embedded in BREEZE.rst.
OK. The release-management screenshot is embedded in BREEZE.rst.
OK. The k8s_logs screenshot is embedded in BREEZE.rst.
OK. The ci_fix-ownership screenshot is embedded in BREEZE.rst.
OK. The ci_find-newer-dependencies screenshot is embedded in BREEZE.rst.
OK. The k8s_shell screenshot is embedded in BREEZE.rst.
OK. The k8s_status screenshot is embedded in BREEZE.rst.
OK. The release-management_prepare-provider-documentation screenshot is embedded in BREEZE.rst.
OK. The prod-image_verify screenshot is embedded in BREEZE.rst.
OK. The k8s_k9s screenshot is embedded in BREEZE.rst.
OK. The setup_config screenshot is embedded in BREEZE.rst.
OK. The k8s_delete-cluster screenshot is embedded in BREEZE.rst.
OK. The testing_docker-compose-tests screenshot is embedded in BREEZE.rst.
OK. The setup_regenerate-command-images screenshot is embedded in BREEZE.rst.
OK. The k8s_create-cluster screenshot is embedded in BREEZE.rst.
OK. The start-airflow screenshot is embedded in BREEZE.rst.
OK. The cleanup screenshot is embedded in BREEZE.rst.
OK. The build-docs screenshot is embedded in BREEZE.rst.
OK. The setup_version screenshot is embedded in BREEZE.rst.
OK. The testing_integration-tests screenshot is embedded in BREEZE.rst.
Traceback (most recent call last):
File "/Users/ephraimbuddy/Documents/astronomer/airflow/dev/breeze/src/airflow_breeze/breeze.py", line 49, in <module>
main()
File "/Users/ephraimbuddy/.cache/pre-commit/repofp_wavck/py_env-python3/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/Users/ephraimbuddy/.cache/pre-commit/repofp_wavck/py_env-python3/lib/python3.10/site-packages/rich_click/rich_group.py", line 21, in main
rv = super().main(*args, standalone_mode=False, **kwargs)
File "/Users/ephraimbuddy/.cache/pre-commit/repofp_wavck/py_env-python3/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/ephraimbuddy/.cache/pre-commit/repofp_wavck/py_env-python3/lib/python3.10/site-packages/click/core.py", line 1654, in invoke
super().invoke(ctx)
File "/Users/ephraimbuddy/.cache/pre-commit/repofp_wavck/py_env-python3/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/ephraimbuddy/.cache/pre-commit/repofp_wavck/py_env-python3/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/ephraimbuddy/.cache/pre-commit/repofp_wavck/py_env-python3/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/ephraimbuddy/Documents/astronomer/airflow/dev/breeze/src/airflow_breeze/commands/main_command.py", line 113, in main
check_for_rosetta_environment()
File "/Users/ephraimbuddy/Documents/astronomer/airflow/dev/breeze/src/airflow_breeze/commands/main_command.py", line 159, in check_for_rosetta_environment
from inputimeout import TimeoutOccurred, inputimeout
ModuleNotFoundError: No module named 'inputimeout'
Some of the commands changed since last time images were generated.
Image generation is needed. Please run this command:
breeze setup regenerate-command-images
```
Ok. I think I need to install it on my PC
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #27829: Improving the release process
Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27829:
URL: https://github.com/apache/airflow/pull/27829#issuecomment-1346127852
Fix in https://github.com/apache/airflow/pull/28299
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org