Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Specify exactly what globbing patterns are allowed #147

Open
RubenVerborgh opened this issue Mar 26, 2019 · 9 comments
Open

Specify exactly what globbing patterns are allowed #147

RubenVerborgh opened this issue Mar 26, 2019 · 9 comments
Assignees

Comments

@RubenVerborgh
Copy link
Contributor

RubenVerborgh commented Mar 26, 2019

The spec does not specify what globbing patterns it allows. Is it just a single * at the end, or possibly more?

It does say that:

the aggregation process is not currently recursive, therefore it will not apply to children containers.

Inspired by solid/solid#253 (comment) (@melvincarvalho)

@RubenVerborgh
Copy link
Contributor Author

Related: do we have any more history on globbing besides c26141e ? @dmitrizagidulin

@melvincarvalho
Copy link
Member

I've been around solid a long time, and I've probably looked at every app ever made. I've never seen anything other than /* used to get the contents of a directory.

I think that is how it was supposed to be. Basically we organized things like putting stuff in a per monthly folder and so on. It would just be a pain to get every item from every day, which could be 100s. Also the queries change a bit.

I was a bit perplexed when I saw that globbing could be used as /foo* type queries. Because why would you do that? It seems overkill, and using it 'just because you can'. Better to design your app's data not to need it.

I might have seen @bblfish once make an argument around generic globbing, but unsure anything came of it. @deiu may also have some back ground on this.

I do think there is a path towards deprecating globbig, for more efficient methods, but I'd like to see that over a long period of time. And simple server side testing is not going to catch all the issues. I dont mind turning off globbing if everyone agrees its not needed anymore because we have something better.

@melvincarvalho
Copy link
Member

Recursive? I dont think it has ever been recursive, has it?

@RubenVerborgh
Copy link
Contributor Author

@melvincarvalho Thanks, this is super important.
Because currently, NSS uses glob, which supports much more complex patterns (and that was a major reason for my concerns). So it seems that NSS is implementing a superset of globbing as defined by the spec.

Questions:

  1. Do you have any objection to stating that a glob pattern can only contain one star?
  2. Do you have any objection to stating that this star can only occur at the end?
  3. Do you have any objection to stating that this star can only occur after a final slash?

@melvincarvalho
Copy link
Member

Do you have any objection to stating that a glob pattern can only contain one star?

No

Do you have any objection to stating that this star can only occur at the end?

No

Do you have any objection to stating that this star can only occur after a final slash?

No

This is really how I thought globbing worked. The idea is that how you fetch stuff influences how you design the data layout of your app. Once you get beyond simple apps, say for a social network or chat that grows over time, you need to archive things daily, monthly, yearly etc. Your ability to fetch from this kind of folder will influence the design of your data shapes and also your app.

It may be self evident that you could have 100s of items in a monthly LDPC, and that works well with globbing. That was the need for which is was introduced.

Any other need, I dont see right now, and looks to me like feature creep. Id genuinely be interested if there's a use case out there.

@RubenVerborgh
Copy link
Contributor Author

Thanks so much. PR forthcoming (which I will leave open for a bit until everyone agrees on the above answers).

This changes a lot 🙂 I have always seen the complex implementation of globbing (with multiple stars on arbitrary places and thus recursion). I'm opposed to including that; way less opposed to a "concatenate all in folder", which is what the current "globbing" does.

@melvincarvalho
Copy link
Member

melvincarvalho commented Mar 26, 2019

Ah right you should run this by @timbl because he uses the yyyy/mm/dd pattern so I could see he might want yyyy/*/*

However I've always used the yyyymmdd/ pattern for this very reason. A single glob is a nice to have, but 2 seems self indulgent! :)

@RubenVerborgh
Copy link
Contributor Author

RubenVerborgh commented Mar 26, 2019

@melvincarvalho Thanks, invited you and @timbl to review #148.

RubenVerborgh added a commit that referenced this issue Mar 26, 2019
@dmitrizagidulin
Copy link
Member

@RubenVerborgh

Related: do we have any more history on globbing

I'm not sure. I've never used it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants