Skip to content
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

members: only use base attrs in user relationship #1069

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

egabancho
Copy link
Member

@egabancho egabancho commented Nov 10, 2023

❤️ Thank you for your contribution!

Description

Please describe briefly your pull request.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Third-party code

If you've added third-party code (copy/pasted or new dependencies), please reach out to an architect.

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@egabancho egabancho requested a review from max-moser November 10, 2023 16:12
@egabancho
Copy link
Member Author

Sorry @max-moser, you seemed to be the one who made that change on the user schema, inveniosoftware/invenio-users-resources@492f14b ☺️

@egabancho
Copy link
Member Author

I'm not sure how to write a test to verify it, I can duplicate the one on https://github.com/inveniosoftware/invenio-accounts/blob/master/tests/test_models.py#L120, but I'm not sure how useful it will be.

@egabancho egabancho requested a review from TLGINO November 10, 2023 16:42
@egabancho egabancho force-pushed the 2198-sync-user-schemas branch from 1c953b2 to af2469e Compare November 13, 2023 19:34
@@ -62,7 +62,8 @@
"affiliations": {
"type": "text"
}
}
},
"dynamic": true
Copy link
Member

Choose a reason for hiding this comment

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

I would not go with dynamic here. I just had a large mishap with a custom field that wasn't created in the mapping, then a user filling some data into and voila, had to reindex 70GB of data because you cannot change the type once added to the mapping :-(

These models are also supposed to only contain basic info, not everything, so perhaps it's just a matter to make sure we don't get the full profile when we index in members? In principle it should only index the stuff in https://github.com/inveniosoftware/invenio-communities/blob/master/invenio_communities/members/records/api.py#L70-L76

Copy link
Member Author

Choose a reason for hiding this comment

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

What you say makes a lot of sense. Now I just need to figure out how to do actually do it 😂
Thanks for the feedback!

@egabancho egabancho self-assigned this Jan 9, 2024
@egabancho egabancho force-pushed the 2198-sync-user-schemas branch from af2469e to 1f8e6ee Compare April 15, 2024 18:28
@egabancho egabancho changed the title members: sync schemas with user-resources members: only use base attrs in user relationship Apr 15, 2024
* Limits the user fields send for indexing to avoid issues when
  extending the user profile or preferences. (closes
  invenio-app-rdm#2198)
@egabancho egabancho force-pushed the 2198-sync-user-schemas branch from 1f8e6ee to 3e26f5a Compare April 15, 2024 19:22
@egabancho
Copy link
Member Author

Hey @lnielsen, I changed the approach as you suggested. I explicitly list the fields we want from the two customizable parts: profile and preferences.
The only drawback I see is that if the overlay's custom code removes those fields from their custom schemas. However, I think other parts might depend on these fields too ...
Let me know what you think.

@egabancho egabancho requested a review from lnielsen April 16, 2024 14:07
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.

Invenio indexer task process_bulk_queue fails with extended user profile
2 participants