-
Notifications
You must be signed in to change notification settings - Fork 3
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
Database format for registry ( Mongodb ) #1
Comments
We were thinking about having proper namespaces for all packages to avoid name collisions and name squatting. Like for example a fortran-lang namespace under which the fpm package is published by a user admin42. Would it make sense to have namespaces as a separate collection? |
@awvwgk sure sir, either we could make a new collection |
I think you might not want to include that here, as you've listed the packages a user is maintainer of, and you don't want duplicate, potentially conflicting info in your database. |
This refers to the entry gathered from the manifest (https://fpm.fortran-lang.org/en/spec/manifest.html#project-maintainer). I also don't really like to specify it in the manifest (see fortran-lang/fpm-registry#24). If it feels redundant or conflicting in the manifest, maybe we should drop it from fpm. |
I think the |
@milancurcic sir, may be we could add another field in the |
I see other repositories that distinguish between plugins, applications, and libraries. Of course, a single fpm(1) package may include all of these; but wondering if there should be a separate list for an entry. In a related vein, "fpm install" should allow executables to be selected (does not make as much sense for libraries and modules), potentially with a rename option. |
@urbanjost sir, we ( me and @minhqdao and @awvwgk ) had discussed this yesterday itself, we had decided that currently the API would give the options to CLI which in turn would handle them by showing the options in CLI. @minhqdao for the CLI side I currently I am giving the API with json response and options of packages. |
That would be fine; I do not necessarily think multiple repositories are required; just some way to search and display by those categories. So the output of a query will be JSON? That makes sense for allowing applications to process the information, but I hope a default beautifier will be available to show the results as a nice ASCII table at a minimum. Having to install a bunch of infrastructure to just see the result of a query in a nice format would be a significant drawback, I would think. Great to know you have been considering the topic. Good luck! |
We have been thinking of making our own global package repository ( like PyPI, crates.io ) , this repo would work as a backend repository to that website and also to the local registry which would be integrated into fpm by @minhqdao .
Response to a API calls ( please Refer #5 ) to the backend would be a json , but it would be rendered beautifully by a website or a fpm cli.
The CLI would be integrated into fpm directly and the website can be easily accessible by a browser, so we would not have to install any infrastructure to get the result of the query. |
A few remarks on the
|
Considering the
We are not going so save all the
You could use the user
Don't forget to mark certain fields as optional. As the registry is supposed to be independent from |
Yes, I agree. I think |
@minhqdao Thanks for the suggstions, some points to ponder :
1.The convention for Mongodb is Camelcase.
|
@minhqdao , Some more points to refer :
|
The point was to be consistent. Then let's change all the remaining keys to camel case:
I can't see the point how
I don't quite understand how a second
This seems to be part of analytics, so I thought we had decided to defer it until later. Besides, if it's not actual users with ids as indicated, then it should be named something as
I'm not sure whether an application (or a plugin) can be, e.g., a library, too. If yes, then using an array is definitely the way to go. However, I'm still in favor of calling it |
@minhqdao Some points to refer :
I am majorly targeting the APIs currently but I would like to have an Idea How would you integrate them into the terminal/fpm ? Thanks and Regards, |
Based on discussions so far, I had a couple of thoughts. In my experience designing database schemas (which is fairly limited), it's (usually) better for each item to say which collection it belongs to than for a collection to say which items it contains. Kind of the opposite from the way you'd typically design data structures in a programming language. And for many-to-many relationships it's often beneficial to have a separate table to track those (i.e. a user may maintain many packages, and packages may have many maintainers). You will almost instantly want users with different levels of permissions/access. Having a |
@everythingfunctional Sure sir we can add them, actually we had discussed this point in the last meeting in brief and we had agreed upon 3 Roles ( user,maintainer,admin). But I would still be cautious about granting the various privileges to roles ( we would have to discuss them). |
I was just thinking that it's easier for you to have it there right away instead of postponing part of the discussion for another time. Considering the response format, I think that json should be the standard. The main goal in the beginning will be the resolution of a package, and the entire document should be parsed as a json. Everything that follows (deserialization of the JSON, mapping to objects, handling of the objects, such as retrieving the tarball from the bucket via its url etc.) will be done in the frontend. However, I'm still somewhat puzzled by Custom APIs will make sense later, e.g. in combination with |
Thanks and Regards, |
@fortran-lang/admins @fortran-lang/fpm @minhqdao
|
Not really. Where a package tarball comes from is not the registry's responsibility. I think we should allow maintainers to specify url that gets displayed on a package's page for informational purposes, but it shouldn't have any influence on system behavior.
I think that's a feature that would be useful for developers, but shouldn't be used for version constraint resolution by the registry. It would result in unresolvable version conflicts.
I think the answer is yes, all packages must reside in a namespace. |
The idea of the registry is that its packages do not depend on any git repository. However, I would prefer having a |
I agree, but I wouldn't name it |
So will different releases have different version numbers? I'd prefer that for simpler version resolution. |
@minhqdao yes, I had also been considering the same . |
Sorry for the confusion and late response. This has probably been resolved through the discussion so far. What I meant by "release" is synonymous with "version", e.g. "0.1.0", "0.1.1", "0.2.0" etc. This would map to a git tag if the package is maintained on GitHub. I don't know if there's a need for a "release" that is separate from "version". |
Yes, then a Seems like we'd now stick to the |
I think one missing point of this discussion is what level of integration the backend database should enable with fpm. MongoDB has a C api, so it would be straightforward to implement Fortran wrappers. However that is additional work, while other choices (SQLite) have Fortran APIs already |
@perazz we had considered that we would use the backend (flask) to interact with the mongodb and then use REST APIs to communicate with fpm, like when user searches for a package a |
I'm going to guess there are security implications for why we wouldn't want to expose the database directly. |
So the dependencies wouldn’t be sorted out by fpm, but the package maintainer would need to specify them in the manifest? That seems what msys does afaict |
Indeed, a client such as fpm or a browser frontend should never access a centralized DB directly because that would require the DB secrets (access keys) to be made available to the user. To solve this problem, a backend holds the DB secrets and sits between the client and the DB. |
Does this
|
Taking some inspiration from pub.dev again, How about having This might be useful for the packages that are already published and other projects are dependent on them but since they cannot be maintained, Author or any user with some amount of authorization can mark it as discontinued. |
Yes, I also like the idea of an |
I like the idea of a |
Looks good. But, I am not able to understand whether that would help @minhqdao and you in For example: Just like @awvwgk mentioned different orgs have their own |
I think we've agreed on having In fpm, we'd do sth like mapping a dependency to a |
We are thinking to add This will help to approve and reject the request in the backend. So, for example : if the user approves to join in as maintainer for package_id -> package_id gets remove from the else -> just remove the |
@arteevraina we would also have to add the user's |
@arteevraina we would also have to make the user's name field unique as we would have to show the user's page on |
I think it makes sense to maintain a list of |
I have considered the following format for Mongo database :
fpmregistry
as the Database.users
,packages
,namespaces
.users
collection4.suggested format for
packages
collection5.suggested format for
namespaces
collectionI would like to request all the Community members to review and add suggestions on this format of database.
Thanks and Regards,
Henil
CC @awvwgk @fortran-lang/admins @fortran-lang/fpm
The text was updated successfully, but these errors were encountered: