Skip to content
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

DM-24314: Read through symlinks when ingesting as symlinks #250

Merged
merged 2 commits into from Apr 3, 2020

Conversation

timj
Copy link
Member

@timj timj commented Apr 2, 2020

This prevents us from having a repository that has multiple indirections to the real dataset.

This prevents us from having a repository that has
multiple indirections to the real dataset.
@timj timj requested a review from kfindeisen April 2, 2020 22:51
Copy link
Member

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself looks good. Why can't you create a unit test for it? Is it because every Gen 2 repository needs to be associated with an obs package?

@timj
Copy link
Member Author

timj commented Apr 2, 2020

Yes, obs packages are where a lot of the ingest stuff happens. I'll take a look to see if the butler ingest tests of symlink can be modified to make a double symlink.

Comment on lines 464 to 472
os.symlink(os.path.abspath(realpath), sympath)
datastore = self.makeDatastore()
datastore.ingest(FileDataset(path=os.path.abspath(sympath), refs=ref), transfer=mode)
uri = ButlerURI(datastore.getUri(ref))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding blank lines as follows:

Suggested change
os.symlink(os.path.abspath(realpath), sympath)
datastore = self.makeDatastore()
datastore.ingest(FileDataset(path=os.path.abspath(sympath), refs=ref), transfer=mode)
uri = ButlerURI(datastore.getUri(ref))
os.symlink(os.path.abspath(realpath), sympath)
datastore = self.makeDatastore()
datastore.ingest(FileDataset(path=os.path.abspath(sympath), refs=ref), transfer=mode)
uri = ButlerURI(datastore.getUri(ref))

I think that would make it easier to follow the logic (setup, operation being tested, tests).

@timj timj merged commit ef6457b into master Apr 3, 2020
@timj timj deleted the tickets/DM-24314 branch April 3, 2020 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants