-
Notifications
You must be signed in to change notification settings - Fork 49
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
Allow for File objects to describe directories #618
Conversation
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 disagree simply extending the definition so that a File
can be a directory without any other extra information. Too many things may potentially break -- or we will have to update lots of pieces of documentation to specify that we are really meaning files and not directories. Off the top of my head: typical hashes do not work any more (what's the md5 of a directory?); snippets can't blindly point to files any more (snippet in a dir?), etc. etc.
Why can't we use a Package
to represent a directory?
If we can't, should we create a specific Directory
class (subclassing Package
)? Having it as a subclass of File
unfortunately will also have all the issues mentioned above.
If this is also not possible, and it has to be a File
, at the very least we should introduce a boolean property isDirectory
and update texts to say "...File
with isDirectory
false"
I agree that simply changing the definition to implicitly make File either a file or a directory without clarity of which is likely to cause lots of problems. I would strongly support the last proposed approach above (adding a boolean |
@goneall I had read #83, but I still don't understand. Let me state what I understand.
Is the above correct? Did I misunderstand something? What am I missing? we also have the alternatives:
Thinking a little more, I actually prefer the last approach. Have it simply as a string.
But there might not be a need to have it as an object; the property as string will do. |
That is correct - the issue is we do not have a migration for the In terms of the alternatives:
I'm not quite sure how that would work - the package content is already a directory - seems a bit recursive
Same concerns as above - i just get confused as to how this would actually work - seems complex to me
This is also my favorite solution. I have a feeling this was discussed previously and was rejected. @sbarnum - any opinion on putting back the string? |
I added the isDirectory property to this pull request. |
f5eb85f
to
d20e3ef
Compare
Signed-off-by: Gary O'Neall <[email protected]>
d20e3ef
to
3cde742
Compare
@zvr - I found the minutes where we decided to use the file relationship: https://github.com/spdx/meetings/blob/main/tech/2023-02-21.md Are you OK with the current PR where I added the |
I had read that, because it was included in #83. And I should note that (text copied from those minutes):
do not seem like a final decision on the matter, more like a reporting that some discussion had happened. Can we please discuss option (3) above? Meaning, keeping it as a string. What is the problem with this approach? As I said in my first comment above, if we change to |
I'm not thrilled with the isdirectory property, but from discussion with @goneall, my suggestion of making it an enumeration doesn't quite match the semantics, so will go along with what others decide. |
Consensus of the Feb 06, 2024 Tech call was to pursue adding the A separate issue will be opened to explore, discuss and solve the questions around potentially needed file system objects beyond files and directories post RC2. |
@sbarnum - can you add a formal approval in a review. And we'll get it merged, if no additional issues with the PR. |
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.
Consensus of the Feb 06, 2024 Tech call was to pursue adding the isDirectory boolean property to the File class.
Done |
That issue is now created at #630. |
@kestewart - if you agree with this - please go ahead and approve - your last review was just a comment and not a formal approval. |
Discussion on call, was "why" is this needed. Discussion ended up on SPDX 2, artifacts can point to a file - which could be a folder or plain file. For migration compatibilities, we need to add this in. ie. my package is the following folder. How do you express this without a directory, is what this is addressing. |
Fixes #83