jason810496 commented on code in PR #69434:
URL: https://github.com/apache/airflow/pull/69434#discussion_r3527272296
##########
dev/breeze/src/airflow_breeze/utils/docs_publisher.py:
##########
@@ -91,6 +98,12 @@ def _publish_dir(self) -> str:
def publish(self, override_versioned: bool, airflow_site_dir: str):
"""Copy documentation packages files to airflow-site repository."""
get_console(output=self.output).print(f"Publishing docs for
{self.package_name}")
+ # Check the build dir before resolving _publish_dir: resolving the
version of a
+ # package whose docs were not built (no stable.txt staged) raises
SystemExit.
+ if not os.path.exists(self._build_dir):
+ get_console(output=self.output).print(f"Build directory
{self._build_dir} does not exist!")
+ get_console(output=self.output).print()
+ return 0, f"Skipping {self.package_name}: Build directory does not
exist"
Review Comment:
Yes. `_publish_dir` resolves `_current_version`, which can fail for a
package with nothing staged (e.g. java-sdk on a checkout that has no java-sdk/
to fall back to). And in the old position the check ran after the rmtree above
it, so publishing into an existing airflow-site clone could delete a previously
published directory and then skip with nothing to copy.
--
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]