Conversation
humitos
left a comment
There was a problem hiding this comment.
gh_installation.extra_data = {"installation": gh_installation.raw_data}
Why are we saving this data under a installation key, the object is the installation already, there is no need to have a nested field inside it. We should just do gh_installation.extra_data = gh_installation.raw_data for simplification.
| target_login = models.CharField( | ||
| help_text=_("The account login the installation belongs to"), | ||
| default="", | ||
| null=True, | ||
| max_length=255, | ||
| ) |
There was a problem hiding this comment.
What are the options for this field? user and organization only?
There was a problem hiding this comment.
This is the login of the user/organization.
There was a problem hiding this comment.
the username of the user/organization.
readthedocs/oauth/models.py
Outdated
| default="", | ||
| null=True, |
There was a problem hiding this comment.
| default="", | |
| null=True, | |
| null=True, | |
| blank=True, |
Remove the default="" so it uses None by default. Also add blank so we can define it from the admin.
There was a problem hiding this comment.
All objects in production will have this field populated after the data migration.
Extra data can contain more info related to event when the installation was created. |
In that case, we should call |
During the migration yeah, after that it's fine to override. |
|
In that case, after the migration we won't have other fields inside the JSON... that goes back to my original question? Why are we saving it as |
After the migration we will still have extra fields in the data field, that's from when the installation was updated readthedocs.org/readthedocs/oauth/tasks.py Line 819 in 8221425 At the end, this is just extra metadata to debug, or make it easy to inspect some fields without re-fetching the installation. |
We could also make these extra properties that dynamically get the information from extra_data as well (they are present in all objects). Since we weren't updating the extra data field after the integration was created we will need to update all of them (we have less than 2K installations).
Closes https://github.com/readthedocs/readthedocs-corporate/issues/2046