-
Notifications
You must be signed in to change notification settings - Fork 45
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
Make collection name unique at a project level #2865
Comments
@theroinaochieng please I would like for us to prioritize this. It is a blocker for users. ![]() |
Hi Ayo, this is well noted. I'll have someone in the team pick this up. |
@christad92 could you elaborate why this is a blocker for users? The error is clear that the collection already exists. The reason why a collection is globally unique is for a few reasons. When accessing a collection via the job, the user specifies it using its name: It would be easy to determine which collection the job is referring to via the project the job exists in. However given the existence of #2855, where users would be able to share collections between projects; we run into issues of disambiguation. You would see two collections with the same name in the UI, and job code would not be able to distinguish which one is being referred to. This can be solved using namespacing, so in a job you would write something like: This would also impact the CLI, the current access pattern is like this:
This would have issues even if the collection wasn't shared with other projects, since you're accessing the collection as a user - we'd have to disambiguate from other projects they are collaborators in. Again, this can be solved with namespacing. But this would be a breaking change for the CLI and jobs. We could perhaps try and naively look up the collection name for the user or project and throw an error if it's ambiguous, thats better but still leaves users to have jobs or cli commands suddenly failing because someone made a collection in some other project they don't spend much time in. So yeah, this is a little bit of a minefield. Does this change the appetite for this request? |
Thanks @stu
No, it doesn't change the appetite of the request. We should make collection names unique at project level not across the instance. |
Dropping some implementation notes here, to be turned into issues once discussed: Allow Collections API to handle ambiguous collection namesWe need to change the router to be able to resolve the difference between:
Provisioner ChangesEnsure we have good errors? I think this is fine already. Collections Adaptor ChangesWe need to check that if a user writes the following operation: collections.get('my-project-name/my-specific-collection') That the request is correctly built to call CLI ChangesWhen a user calls: openfn collections get my-collection \* --token $MY_OPENFN_PAT And there are two openfn collections get project-name/my-collection ... or: openfn collections get my-collection ... --project project-name
I prefer the |
Thank you @stuartc and @theroinaochieng ! Here's the mockup from our call today with @christad92 . This is really an epic that touches credential sharing, the cli, the collections list view, and the way collections are referenced in runs. It's 3-4 days of work. ![]() |
Here's a perspective on this. I'm not sure it's been considered. This has implications for managing prod/staging versions of projects! Something I've been thinking about a lot this week. My staging project uses a collection called When we deploy that project to prod, we want to use exactly the same code as on staging. But we almost definitely don't want to use the same actual collection. So this I think is a vote for:
We can't rename a project, right? |
Currently, we enforce uniqueness for collection names at an instance level but it would be great to keep the uniqueness at that project level. No two collections in a project should have the same name but two or more collections in an OpenFn instance can have the same name.
When sharing a collection with another project, we should block the share if the receiving project has a collection that has the same name as the shared collection.
The text was updated successfully, but these errors were encountered: