Skip to content

Conversation

@humitos
Copy link
Member

@humitos humitos commented Dec 23, 2025

This is the continuation work to finally make usage of the BuildConfig model instead of saving the readthedocs.yaml file inside Build._config itself.

The next step here is to delete the _config field once we are settled here and happy with this solution 👍🏼

References:

@humitos humitos changed the title Initial plan Use BuildConfig model in our code Jan 20, 2026
@humitos humitos self-assigned this Jan 20, 2026
@github-project-automation github-project-automation bot moved this to Planned in 📍Roadmap Jan 20, 2026
@humitos humitos moved this from Planned to In progress in 📍Roadmap Jan 20, 2026
We can remove this method in the future if we want, but I'm keeping it
for backwards compatibility for now since I wasn't able to change it.
@humitos humitos marked this pull request as ready for review January 22, 2026 11:49
@humitos humitos requested a review from a team as a code owner January 22, 2026 11:49
@humitos humitos requested a review from stsewd January 22, 2026 11:49
@humitos humitos moved this from In progress to Needs review in 📍Roadmap Jan 22, 2026
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Would be good to have @stsewd review as well, but did a quick look.

@ericholscher
Copy link
Member

@stsewd waiting on review from you to 👍 it

Copy link
Member

@stsewd stsewd left a comment

Choose a reason for hiding this comment

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

We should change how the index is created #12704 before switching to this new modeling. Otherwise, it would be harder to change later.

)
.order_by("-date")
.only("_config")
.only("readthedocs_yaml_config")
Copy link
Member

Choose a reason for hiding this comment

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

This was used because we needed to query other builds. You can change this to just values_list("readthedocs_yaml_config", flat=True)


def save(self, *args, **kwargs): # noqa
if self._readthedocs_yaml_config_changed:
build_config, _ = BuildConfig.objects.get_or_create(data=self._readthedocs_yaml_config)
Copy link
Member

Choose a reason for hiding this comment

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

_readthedocs_yaml_config could have been assigned to None. In that case we won't have a build_config object.

@humitos
Copy link
Member Author

humitos commented Jan 30, 2026

We should change how the index is created #12704 before switching to this new modeling. Otherwise, it would be harder to change later.

I'm fine moving forward without that index for now. That was a test and it's not strictly required. I can do it later if it's required. It shouldn't be a lot of data. We have created 500k BuildConfig objects only from 24M Build. Also, we plan to delete old builds, so the number of BuildConfig will be reduced as well.

@humitos humitos requested review from ericholscher and removed request for ericholscher February 2, 2026 09:33
@humitos humitos requested a review from stsewd February 2, 2026 09:33
@stsewd
Copy link
Member

stsewd commented Feb 2, 2026

I'd prefer if we deal with that now and not when the DB is overloaded in the future.

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

Labels

None yet

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

4 participants