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

[Squeak] MCGitHubRepository >> #versionNamed: raises various errors from DosFileDirectory #543

Open
LinqLover opened this issue May 8, 2021 · 0 comments
Labels

Comments

@LinqLover
Copy link
Collaborator

Steps to reproduce:

  1. repo := MCRepositoryGroup default repositories detect: [:x | x isKindOf: MCGitHubRepository].
    repo versionNamed: 'foo'.

    Expected output: nil, as the method comment in MCRepository >> #versionNamed: states:

    Answer the MCVersion with name, aMCVersionName, or nil if it doesn't exist in this repository.

    Actual behavior: MessageNotUnderstood: DosFileDirectory>>resolveString: from TonelFileSystemUtils class>>directoryFromPath:relativeTo:. It might be worth noting that in [] in MCGitHubRepository(MCFileBasedRepository)>>versionReaderForFileNamed:do:, s is a subinstance of FileDirectory (from the Files package, not squeak-filesystem).

  2. repo := MCRepositoryGroup default repositories detect: [:x | x isKindOf: MCGitHubRepository].
    repo versionNamed: 'foo.mcz'.

    Expected output: nil, for the same reason as above.

    Actual behavior: DosFileDirectory(Object)>>errorNotIndexable. Like above, in [] in MCGitHubRepository(MCFileBasedRepository)>>versionReaderForFileNamed:do:, s is a subinstance of FileDirectory so MCMczReader>>zip fails to read a ZipArchive from that directory.

Maybe a bit of background: The provision of MCRepository >> #versonNamed: not to raise an error but to nil is actually important because various senders, including MCRepositoryGroup >> #versionNamed: depend on this functionality in order to search for a version which's location is unknown. Since there is still a large number of senders to the MCRepositoryGroup default, a single violation of this rule like this one is enough to break the entire version search.

I'm not familiar at all with this domain but it would great if we could add a simple type check to avoid this error and maybe signal a FileDoesNotExistException somewhere in #loadVersionFromFileNamed: or below. Unfortunately, I did not find any valid usage examples of any MCFileTreeRepository subclass in combination with FileDirectory so I don't know where the invalidation begins. Maybe all these github repository instances should not be part of the default repository group at all?

Looking forward to your help!

@LinqLover LinqLover added the bug label May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant