-
-
Notifications
You must be signed in to change notification settings - Fork 104
Add the ability to import/export users via CSV #1971
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
base: main
Are you sure you want to change the base?
Conversation
|
@jnptk thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment: To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
|
DO NOT MERGE YET Notes:
|
stevepiercy
left a comment
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.
Minor docs tweaks. Looking good so far. Thank you!
Co-authored-by: Steve Piercy <web@stevepiercy.com>
stevepiercy
left a comment
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.
Docs LGTM so far.
stevepiercy
left a comment
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.
Additional new docs look good!
https://plonerestapi--1971.org.readthedocs.build/en/1971/endpoints/users.html#list-all-users-via-csv
Needs a technical review.
|
@jenkins-plone-org please run jobs |
stevepiercy
left a comment
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.
This looks really good. Thank you! Please see my suggestions.
https://plonerestapi--1971.org.readthedocs.build/en/1971/endpoints/users.html#create-users-via-csv
Co-authored-by: Steve Piercy <web@stevepiercy.com>
stevepiercy
left a comment
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.
Docs changes look great! I'm glad you caught the empty roles response. I missed that.
|
@davisagli we set the |
stevepiercy
left a comment
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.
Roles now appear in the response.
https://plonerestapi--1971.org.readthedocs.build/en/1971/endpoints/users.html#create-users-via-csv
Thank you!
davisagli
left a comment
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.
we set the Location header with the location of the newly created user, but in the case of a csv one might create more than one user. Should we set the header in this case or abandon it?
No, I don't think it makes sense to redirect to one particular user if multiple users were created.
| "id": "Reviewers", | ||
| "title": "Reviewers" | ||
| } | ||
| { |
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 see the format changed from a list of users to an object with @id, items, and items_total. That's more consistent with what we try to do in the REST API, but unfortunately it's a backwards-incompatible change that will break existing scripts. We can only change this in a major release of plone.restapi.
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.
So should I undo the format change or do we just wait until the next major release?
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.
@jnptk Now I remember that we currently are on 10.0.0a1, so we can make other breaking changes in a new alpha release. Make sure we add release note with the .breaking extension for this change, separate from the other new feature.
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.
@jnptk Hmm, but this change will break everything in Volto that uses the @users endpoint to list users.
We have two options:
- Go ahead with the change in plone.restapi -- but then we have to first make changes in Volto (at least Volto 19) to handle both the old and new format, before we can merge this.
- Change this PR back to returning the old format with just a list.
Co-authored-by: David Glick <david@glicksoftware.com>
Co-authored-by: jnptk <110389276+jnptk@users.noreply.github.com>
davisagli
left a comment
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 think this is just about ready!
📚 Documentation preview 📚: https://plonerestapi--1971.org.readthedocs.build/