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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
