potiuk commented on code in PR #33149:
URL: https://github.com/apache/airflow/pull/33149#discussion_r1285187410
##########
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:
That's where we are forcing it actually. Default setting for gen-type is now
"airflow" (and we do not have to explain it even becaue I added
"show_default=True" and it is printed automatically in htelp strig. So we are
actually forcing it here, because user chose provider packages individually.
This is mostly a test feature to speed up testing, so I am not too worried
about slight inconsistency where you specifiy both gen-type and providers, I
will just force it because the user running it knows what they want.
--
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]