You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Adaverse (via GitHub)" <gi...@apache.org> on 2023/07/10 18:49:31 UTC

[GitHub] [airflow] Adaverse commented on a diff in pull request #32495: Basic skeleton for publish docs breeze command

Adaverse commented on code in PR #32495:
URL: https://github.com/apache/airflow/pull/32495#discussion_r1258704378


##########
dev/breeze/src/airflow_breeze/commands/developer_commands.py:
##########
@@ -405,6 +408,52 @@ def build_docs(
     sys.exit(process.returncode)
 
 
+@main.command(name="publish-docs")
+@click.option("-d", "--disable-checks", help="Disables extra checks.", is_flag=True)
+@click.option("-s", "--override-versioned", help="Overrides versioned directories.", is_flag=True)
+@click.option(
+    "-s", "--airflow-site-directory", help="Local directory path of cloned airflow-site repo.", required=True
+)
+@click.option(
+    "--package-filter",
+    help="List of packages to consider.",
+    type=NotVerifiedBetterChoice(get_available_documentation_packages()),
+    multiple=True,
+)
+@option_verbose
+@option_dry_run
+def publish_docs(
+    disable_checks: bool,
+    override_versioned: bool,
+    airflow_site_directory: bool,
+    package_filter: tuple[str],
+):
+    """Publishes documentation to airflow-site."""
+    if not os.path.isdir(airflow_site_directory):
+        get_console().print(
+            "\n[error]location pointed by airflow_site_dir is not valid. "
+            "Provide the path of cloned airflow-site repo\n"
+        )
+
+    # set AIRFLOW_SITE_DIR env variable
+    os.environ["AIRFLOW_SITE_DIR"] = airflow_site_directory
+
+    available_packages = get_available_packages()
+    package_filters = package_filter

Review Comment:
   Seems like a redundunt reassignment. Maybe we can have `package_filters` in function signature itself?



##########
dev/breeze/src/airflow_breeze/commands/developer_commands.py:
##########
@@ -405,6 +408,52 @@ def build_docs(
     sys.exit(process.returncode)
 
 
+@main.command(name="publish-docs")
+@click.option("-d", "--disable-checks", help="Disables extra checks.", is_flag=True)
+@click.option("-s", "--override-versioned", help="Overrides versioned directories.", is_flag=True)
+@click.option(
+    "-s", "--airflow-site-directory", help="Local directory path of cloned airflow-site repo.", required=True
+)
+@click.option(
+    "--package-filter",
+    help="List of packages to consider.",
+    type=NotVerifiedBetterChoice(get_available_documentation_packages()),
+    multiple=True,
+)
+@option_verbose
+@option_dry_run
+def publish_docs(
+    disable_checks: bool,
+    override_versioned: bool,
+    airflow_site_directory: bool,
+    package_filter: tuple[str],
+):
+    """Publishes documentation to airflow-site."""
+    if not os.path.isdir(airflow_site_directory):
+        get_console().print(
+            "\n[error]location pointed by airflow_site_dir is not valid. "
+            "Provide the path of cloned airflow-site repo\n"
+        )
+
+    # set AIRFLOW_SITE_DIR env variable
+    os.environ["AIRFLOW_SITE_DIR"] = airflow_site_directory
+
+    available_packages = get_available_packages()
+    package_filters = package_filter

Review Comment:
   Seems like a redundant reassignment. Maybe we can have `package_filters` in the function signature itself?



-- 
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