shahar1 commented on code in PR #72162:
URL: https://github.com/apache/airflow/pull/72162#discussion_r4050375322
##########
providers/amazon/src/airflow/providers/amazon/aws/log/s3_task_handler.py:
##########
@@ -84,6 +84,18 @@ def upload(self, path: os.PathLike | str, ti: RuntimeTI |
None = None) -> None:
local_loc = self.base_log_folder.joinpath(path)
remote_loc = os.path.join(self.remote_base, path)
+ # The log path is supplied by the caller and is not guaranteed to stay
within
+ # ``base_log_folder``: ``joinpath`` and ``PurePath.relative_to`` are
purely lexical and
+ # do not normalise ``..``. Without this check a traversing path would
have its contents
+ # uploaded to the remote log store and, with ``delete_local_copy``,
its parent directory
+ # removed. Mirrors the containment check in
``CloudWatchRemoteLogIO.upload``.
Review Comment:
@Miretpl I'm responsible for the "comment sparingly..." instruction, so
thanks for the feedback :)
1. Before I added that it had been much worse.
2. Recently there has been an overall regression in LLM performance as the
AGENTS.md became too lengthy so instructions were ignored. Tried to fix it
here: https://redirect.github.com/apache/airflow/pull/73254)
3. Following your feedback I'll try to fine tune this specific instruciton.
4. I'm planning these days an "AI vaccum cleaner" to clean up all
unnecessary comments ever made by AI (or human).
--
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]