mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Fix large git diff preview (artifact auxiliary_git_diff) is a single line per file, add option to control the artifact preview
This commit is contained in:
@@ -278,8 +278,13 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
|
||||
# if the git is too large to store on the task, we must store it as artifact:
|
||||
if result.auxiliary_git_diff:
|
||||
diff_preview = "# git diff too large to handle, storing as artifact. git diff summary:\n"
|
||||
diff_preview += '\n'.join(
|
||||
line for line in result.auxiliary_git_diff.split('\n') if line.startswith('diff --git '))
|
||||
self._artifacts_manager.upload_artifact(
|
||||
name='auxiliary_git_diff', artifact_object=result.auxiliary_git_diff)
|
||||
name='auxiliary_git_diff', artifact_object=result.auxiliary_git_diff,
|
||||
preview=diff_preview,
|
||||
)
|
||||
|
||||
# store original entry point
|
||||
entry_point = result.script.get('entry_point') if result.script else None
|
||||
|
||||
Reference in New Issue
Block a user