-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add a project-level configuration for PR builds #7090
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
Changes from 7 commits
f239442
0460585
6c42f64
c777599
8c13dc1
4e1d1f5
a274a05
43c0bac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,11 @@ Autobuild Documentation for Pull Requests | |
========================================= | ||
|
||
Read the Docs allows autobuilding documentation for pull/merge requests for GitHub or GitLab projects. | ||
This feature is currently available under a :doc:`Feature Flag </guides/feature-flags>`. | ||
So, you can enable this feature by sending us an `email <mailto:[email protected]>`__ including your project URL. | ||
This feature is currently enabled for a subset of our projects while being rolled out. | ||
You can check to see if your project has it enabled by looking at the :guilabel:`Admin > Advanced settings` and look for :guilabel:`Build pull requests for this project`. | ||
We are rolling this feature out based on the projects age on Read the Docs, | ||
so older projects will get it first. | ||
You can also ask for this feature by sending us an `email <mailto:[email protected]>`__ including your project URL. | ||
|
||
Features | ||
-------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.10 on 2020-05-21 22:18 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('projects', '0048_remove_version_privacy_field'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='project', | ||
name='external_builds_enabled', | ||
field=models.BooleanField(default=False, help_text='More information in <a href="https://docs.readthedocs.io/en/latest/guides/autobuild-docs-for-pull-requests.html">our docs</a>', null=True, verbose_name='Build pull requests for this project'), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 2.2.10 on 2020-05-19 13:24 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def migrate_features(apps, schema_editor): | ||
# Enable the PR builder for projects with the feature flag | ||
Feature = apps.get_model('projects', 'Feature') | ||
ericholscher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if Feature.objects.filter(feature_id='external_version_build').exists(): | ||
for project in Feature.objects.get(feature_id='external_version_build').projects.all(): | ||
project.external_builds_enabled = True | ||
project.save() | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('projects', '0049_add_external_build_enabled'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(migrate_features), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,6 +202,14 @@ class Project(models.Model): | |
), | ||
) | ||
|
||
external_builds_enabled = models.BooleanField( | ||
_('Build pull requests for this project'), | ||
default=False, | ||
# TODO: Remove this after migrations | ||
null=True, | ||
Comment on lines
+208
to
+209
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed when using a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That only works on the new code though, when we run the migration and the old code is still running, it will blow up the DB. |
||
help_text=_('More information in <a href="https://docs.readthedocs.io/en/latest/guides/autobuild-docs-for-pull-requests.html">our docs</a>') # noqa | ||
) | ||
ericholscher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Project features | ||
cdn_enabled = models.BooleanField(_('CDN Enabled'), default=False) | ||
analytics_code = models.CharField( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
-r local-docs-build.txt | ||
|
||
django-dynamic-fixture==3.1.0 | ||
pytest==5.2.2 | ||
pytest==5.4.2 | ||
pytest-custom-exit-code==0.3.0 | ||
pytest-django==3.6.0 | ||
pytest-django==3.8.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I upgraded these because then it gave me proper failures on the migrations instead of blowing up :) |
||
pytest-xdist==1.30.0 | ||
pytest-cov==2.8.1 | ||
apipkg==1.5 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always confuse this, so maybe I'm wrong here :)