Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Storage][Spot] Resolving failure to exclude local files for managed spot jobs using git --ignored outputs #2018
[Storage][Spot] Resolving failure to exclude local files for managed spot jobs using git --ignored outputs #2018
Changes from 23 commits
b87ed7e
fd4ccbb
6492b98
8879355
40af8ed
45dc8ad
2db6df3
9eee64f
8b925ae
a0795bc
be85cd1
436bfd0
e478c1e
9aca4fa
d8283e5
c95a2ef
36a845f
5315a72
5919521
3de671c
4f18304
0f7ab57
ddc23b5
c79f7f2
96ed4c7
26596ef
da64fad
d73cf40
f624f91
de85068
4a6e435
f520aa9
b08cf44
5a6ca6c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not want to exclude .gitignore by default, since that is often a part of the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Why do we not apply the same logic to
.git/*
?.git/*
was excluded by default even before this update.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a strong reason to disable W1510? Instead, should we add
check=True
for L907, L911, L925 and L930? Good to explicitly handle any errors that may occur when running them.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Origianally, I thought the commands were causing inevitable errors, but found that it actually had some issues. They are currently fixed and removed
# pylint: disable=W1510
as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, no action needed:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may fail due to different reasons (e.g., user has read-only permissions in the dir). In that case, can we raise a warning and gracefully fall back to not excluding any files from .gitignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be printing a
logger.wanring()
message and return the defaultexcluded_list
with.git/*
in it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of checking if git exclude already existed, can we instead check if the .git directory already existed? If it did, we should leave it untouched (i.e., do not remove any files or directories). This is to avoid inadvertently deleting anything we shouldn't be deleting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
.git
alreday existed, thisif git_exclude_exists:
statement will not be entered. The outerif e.returncode == exceptions.GIT_UNINITIALIZED_CODE:
would be entered when.git
didn't exist in this directory. I'll leave a more detailed comment to note that this exception is caught only when.git
didn't exist(not a git repo).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand this comment and why separate handling for GCS is required.. can you include some example of why this is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
cli_count_name_in_bucket
for GCS by adding-r
option in the command so that GCS doesn't need separate handling. The issue was, originalgsutil ls
command was not counting the objects in the subdirectory,include_dir/included.log
, so I was handling them separately, but this was able to be fixed with-r
option.