amoghrajesh commented on code in PR #33149:
URL: https://github.com/apache/airflow/pull/33149#discussion_r1285185904


##########
dev/breeze/src/airflow_breeze/commands/release_management_commands.py:
##########
@@ -821,38 +821,52 @@ def publish_docs(
     "-a",
     "--airflow-site-directory",
     envvar="AIRFLOW_SITE_DIRECTORY",
+    type=click.Path(exists=True, file_okay=False, dir_okay=True, 
resolve_path=True),
     help="Local directory path of cloned airflow-site repo.",
     required=True,
 )
 @click.option(
     "-g",
     "--gen-type",
-    help="Type of back references to generate, supports: [airflow | providers 
| helm]",
-    type=str,
-    required=True,
+    show_default=True,
+    help="Type of back references to generate. Forced to providers if 
providers specified as arguments.",

Review Comment:
   This helper text is not so clear. 
   Can we instead do:
   "Type of back references to generate. Defaults to all providers if providers 
are provided as argument"



##########
dev/breeze/src/airflow_breeze/commands/release_management_commands.py:
##########
@@ -821,38 +821,52 @@ def publish_docs(
     "-a",
     "--airflow-site-directory",
     envvar="AIRFLOW_SITE_DIRECTORY",
+    type=click.Path(exists=True, file_okay=False, dir_okay=True, 
resolve_path=True),
     help="Local directory path of cloned airflow-site repo.",
     required=True,
 )
 @click.option(
     "-g",
     "--gen-type",
-    help="Type of back references to generate, supports: [airflow | providers 
| helm]",
-    type=str,
-    required=True,
+    show_default=True,
+    help="Type of back references to generate. Forced to providers if 
providers specified as arguments.",
+    type=BetterChoice(
+        [e.name for e in GenerationType],

Review Comment:
   What does this evaluate to?



##########
dev/breeze/src/airflow_breeze/commands/release_management_commands.py:
##########
@@ -821,38 +821,52 @@ def publish_docs(
     "-a",
     "--airflow-site-directory",
     envvar="AIRFLOW_SITE_DIRECTORY",
+    type=click.Path(exists=True, file_okay=False, dir_okay=True, 
resolve_path=True),
     help="Local directory path of cloned airflow-site repo.",
     required=True,
 )
 @click.option(
     "-g",
     "--gen-type",
-    help="Type of back references to generate, supports: [airflow | providers 
| helm]",
-    type=str,
-    required=True,
+    show_default=True,
+    help="Type of back references to generate. Forced to providers if 
providers specified as arguments.",
+    type=BetterChoice(
+        [e.name for e in GenerationType],
+    ),
+    default=GenerationType.airflow.name,
 )
+@argument_packages
 @option_verbose
 @option_dry_run
 def add_back_references(
-    airflow_site_directory: bool,
+    airflow_site_directory: str,
     gen_type: str,
+    packages: list[str],
 ):
     """Adds back references for documentation generated by build-docs and 
publish-docs"""
-    if not os.path.isdir(airflow_site_directory):
+    site_path = Path(airflow_site_directory)
+    if not site_path.is_dir():
         get_console().print(
             "\n[error]location pointed by airflow_site_dir is not valid. "
             "Provide the path of cloned airflow-site repo\n"
         )
         sys.exit(1)
-
+    if len(packages) != 0 and gen_type != GenerationType.providers.name:
+        get_console().print(
+            [
+                f"[warning]Forcing gen type to "

Review Comment:
   Nit: Setting generation type 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to