Skip to content

Conversation

@jnptk
Copy link
Member

@jnptk jnptk commented Jan 12, 2026

  • As site administrator I can create Plone users by uploading a CSV file
  • As site administrator I can export all existing Plone users as CSV file
  • Update documentation
  • More tests!!

📚 Documentation preview 📚: https://plonerestapi--1971.org.readthedocs.build/

@mister-roboto
Copy link

@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:

@jenkins-plone-org please run jobs

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!

@jnptk jnptk marked this pull request as draft January 12, 2026 15:18
@jnptk jnptk changed the title Add the ability to import/export users as csv file Add the ability to import/export users via CSV Jan 13, 2026
@jnptk jnptk requested a review from davisagli January 15, 2026 14:12
@jnptk jnptk marked this pull request as ready for review January 15, 2026 14:15
@jnptk
Copy link
Member Author

jnptk commented Jan 16, 2026

DO NOT MERGE YET

Notes:

  • test_list_users_via_csv seems to be flaky
  • roles don't seem to be applied
  • location response header when multiple user are created?

Copy link
Contributor

@stevepiercy stevepiercy left a 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>
Copy link
Contributor

@stevepiercy stevepiercy left a 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.

Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jnptk jnptk requested a review from davisagli January 27, 2026 12:01
@jnptk
Copy link
Member Author

jnptk commented Jan 27, 2026

@jenkins-plone-org please run jobs

Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jnptk and others added 2 commits January 28, 2026 09:10
@jnptk
Copy link
Member Author

jnptk commented Jan 28, 2026

While writing the docs, I noticed that the roles included in the request are not part of the response, I will investigate...

Copy link
Contributor

@stevepiercy stevepiercy left a 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.

@jnptk
Copy link
Member Author

jnptk commented Jan 29, 2026

@davisagli 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?

Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@davisagli davisagli left a 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"
}
{
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member

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:

  1. 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.
  2. Change this PR back to returning the old format with just a list.

Co-authored-by: David Glick <david@glicksoftware.com>
@jnptk jnptk requested a review from davisagli February 10, 2026 12:48
Copy link
Member

@davisagli davisagli left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants