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

Build: fail builds without configuration file or using v1 #10355

Merged
merged 12 commits into from
Jun 14, 2023

Conversation

humitos
Copy link
Member

@humitos humitos commented May 25, 2023

Use a feature flag to decide whether or not hard fail the builds that are not
using a configuration file at all or are using v1.

This will be useful in the future when we want to make the builds to fail during
a reduced period of time to inform users/customers about this deprecation.

@agjohnson, I'd appreciate feedback on the copy for the message.

Note: there is no need to merge this PR right now, but I'm preparing everything required for the deprecation.

Related #10351

humitos added 3 commits May 25, 2023 13:40
When we detect a build is built without a Read the Docs configuration
file (`.readthedocs.yaml`) we show multiple notifications:

- a static warning message in the build detail's page
- a persistent on-site notification to all maintainers/admin of the project
- send a weekly email (at most)

This is the initial step to attempt making users to migrate to our config file
v2, giving them a enough window to do this and avoid breaking their builds in
the future.

Closes #10348
Use a feature flag to decide whether or not hard fail the builds that are not
using a configuration file at all or are using v1.

This will be useful in the future when we want to make the builds to fail during
a reduced period of time to inform users/customers about this deprecation.

Related #10351
@humitos humitos added the Status: blocked Issue is blocked on another issue label May 25, 2023
@humitos humitos requested a review from agjohnson May 25, 2023 13:56
@humitos humitos requested a review from a team as a code owner May 25, 2023 13:56
@humitos humitos requested a review from stsewd May 25, 2023 13:56
@humitos humitos changed the title Build: fail builds without configuration file or using v Build: fail builds without configuration file or using v1 May 25, 2023
@humitos humitos requested a review from agjohnson May 29, 2023 10:19
@humitos humitos requested review from a team as code owners May 30, 2023 11:22
@humitos
Copy link
Member Author

humitos commented May 30, 2023

The checks linter here is also failing with a weird error:

astroid.exceptions.AstroidImportError: Failed to import module builds.models with error:
No module named builds.models.

Maybe the astroid version it's installing is not compatible with prospector or similar?

humitos added a commit that referenced this pull request May 30, 2023
This is a continuation of the work done for

* #10351
* #10342
* #10348
* #10355

In that work we added notifications, warning messages and finally a feature flag
to start failing the builds without a configuration file or using v1.

This commit removes all the code for config file v1 and building without a
configuration file. Due to that, it also removes the code that allows users to
use the older Docker images (testing, latest, stable)

This work can be merged once we enable the feature flag to fail the builds for
all the projects and we are happy with the results.
Base automatically changed from humitos/build-without-config-deprecation to main June 6, 2023 07:33
humitos added a commit to readthedocs/common that referenced this pull request Jun 13, 2023
I had to deal with `PYTHONPATH` again and also with `DJANGO_SETTINGS_MODULE`
this time. Mainly, I did this work because my PR at
readthedocs/readthedocs.org#10355 is failing and it
doesn't make sense.

This fixed my issue locally and I hope it fixes the issue on CircleCI as well.
Let's see.
@humitos
Copy link
Member Author

humitos commented Jun 13, 2023

It seems I was able to fix the linting issues by updating the pre-commit dependencies 💪🏼

@humitos humitos removed the Status: blocked Issue is blocked on another issue label Jun 13, 2023
@humitos
Copy link
Member Author

humitos commented Jun 13, 2023

This is ready to review. We can merge at anytime since the logic is behind a feature flag. Then, on the days of brownout, we can enable the feature flag to all the projects during the hours we agreed on.

humitos added a commit to readthedocs/common that referenced this pull request Jun 13, 2023
* pre-commit: update our dependencies

I had to deal with `PYTHONPATH` again and also with `DJANGO_SETTINGS_MODULE`
this time. Mainly, I did this work because my PR at
readthedocs/readthedocs.org#10355 is failing and it
doesn't make sense.

This fixed my issue locally and I hope it fixes the issue on CircleCI as well.
Let's see.

* Update darker dependencies as well
Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

It's quite nice to have this all prepped and ready to go 👍

Just two notes for copy tweaks, the copy was already close.

readthedocs/doc_builder/exceptions.py Outdated Show resolved Hide resolved
readthedocs/projects/tasks/builds.py Show resolved Hide resolved
@humitos humitos enabled auto-merge (squash) June 14, 2023 09:14
@humitos humitos merged commit bfeb6d8 into main Jun 14, 2023
@humitos humitos deleted the humitos/fail-build-without-config branch June 14, 2023 09:27
humitos added a commit that referenced this pull request Oct 23, 2023
…10367)

* Deprecation: remove code for config file v1 and default config file

This is a continuation of the work done for

* #10351
* #10342
* #10348
* #10355

In that work we added notifications, warning messages and finally a feature flag
to start failing the builds without a configuration file or using v1.

This commit removes all the code for config file v1 and building without a
configuration file. Due to that, it also removes the code that allows users to
use the older Docker images (testing, latest, stable)

This work can be merged once we enable the feature flag to fail the builds for
all the projects and we are happy with the results.

* Deprecation: update documentation of config file

* Deprecation: update config file to remove old keys

* Deprecation: update config file v2 docs to deprecate keys

- python.version
- python.system_packages

People should not be using these keys.

* Remove auto-install requirements file found on project

* Make the deprecated fields read-only as discussed

* Remove tasks to send emails about deprecations

* Lint & Tests

* Remove reference to v1 config file docs

* Normalize `get_build_config()`

* Update tests for config file

* Update tests for collectors

* Update tests to follow the new deprecations

* Remove invalid tests

* More updates related to the config files

* Update more tests

* Lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants