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

Merge initial work from Pull Request Builder GSOC #5823

Merged
merged 201 commits into from
Jul 19, 2019
Merged
Changes from 1 commit
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
31b9bf2
Version Type Added
saadmk11 May 30, 2019
bd11994
Version Model Methods Updated
saadmk11 May 30, 2019
8f3e64b
Internal and External Version Manager added
saadmk11 Jun 4, 2019
66200a0
lint fix
saadmk11 Jun 4, 2019
34e4134
All Version Querysets Updated with InternalVersionManager
saadmk11 Jun 4, 2019
3a3cfdf
Manager names moved to Constants
saadmk11 Jun 5, 2019
3d3de29
Tests added
saadmk11 Jun 6, 2019
b55983f
Version Update, Delete Html and wipe updated to exclude PR Versions
saadmk11 Jun 6, 2019
6187272
Updated migrations
saadmk11 Jun 6, 2019
386ca07
footer API updated
saadmk11 Jun 8, 2019
29348ef
manager tests updated
saadmk11 Jun 11, 2019
11a0583
_override_setting removed from new managers
saadmk11 Jun 13, 2019
c100c81
BuildTriggerMixin updated
saadmk11 Jun 13, 2019
c1c03bb
More Update
saadmk11 Jun 13, 2019
5ea5f67
lint fix
saadmk11 Jun 13, 2019
73a46a5
Merge branch 'master' into version-update
saadmk11 Jun 13, 2019
56493fa
removed unused import
saadmk11 Jun 14, 2019
d8cff7e
Merge branch 'master' into version-update
saadmk11 Jun 17, 2019
84a6975
External version name added everywhere
saadmk11 Jun 17, 2019
05951cf
Migration name changed
saadmk11 Jun 17, 2019
e192300
Sitemap sort order priorities updated
saadmk11 May 23, 2019
d5ec837
ordering fix
saadmk11 May 25, 2019
1f13be1
doc string fix
saadmk11 May 25, 2019
e0232b3
sort_by_priority function added to sitemap
saadmk11 May 29, 2019
fdcfcf6
lint fix
saadmk11 May 29, 2019
ef13214
Sorting by swapping positions
saadmk11 Jun 11, 2019
736a337
index out of range issue fix
saadmk11 Jun 12, 2019
c18f381
Use a real SessionBase object on FooterNoSessionMiddleware
humitos Jun 12, 2019
908860a
Version Type Added
saadmk11 May 30, 2019
f81bcf0
Version Model Methods Updated
saadmk11 May 30, 2019
66377c2
Internal and External Version Manager added
saadmk11 Jun 4, 2019
8bdf75c
lint fix
saadmk11 Jun 4, 2019
21f96de
All Version Querysets Updated with InternalVersionManager
saadmk11 Jun 4, 2019
014477d
Manager names moved to Constants
saadmk11 Jun 5, 2019
d3f5254
Tests added
saadmk11 Jun 6, 2019
6bca1e4
Version Update, Delete Html and wipe updated to exclude PR Versions
saadmk11 Jun 6, 2019
8830a18
Updated migrations
saadmk11 Jun 6, 2019
5ed38c4
footer API updated
saadmk11 Jun 8, 2019
2d8b072
manager tests updated
saadmk11 Jun 11, 2019
89f3c8a
_override_setting removed from new managers
saadmk11 Jun 13, 2019
7b63973
BuildTriggerMixin updated
saadmk11 Jun 13, 2019
3a2fc6d
More Update
saadmk11 Jun 13, 2019
bca152a
lint fix
saadmk11 Jun 13, 2019
5f90052
Move search functions
stsewd Jun 13, 2019
120eb5d
removed unused import
saadmk11 Jun 14, 2019
ef3d061
External version name added everywhere
saadmk11 Jun 17, 2019
5b33bbd
Migration name changed
saadmk11 Jun 17, 2019
5180743
Build Managers added
saadmk11 Jun 8, 2019
8301679
Managers used in all the places
saadmk11 Jun 13, 2019
7b75ee8
build manager tests added
saadmk11 Jun 13, 2019
8c7b02b
More Tests added
saadmk11 Jun 13, 2019
5d6c750
External version name added
saadmk11 Jun 17, 2019
c5d1c09
Merge branch 'gsoc-19-pr-builder' into build-manager-update
saadmk11 Jun 17, 2019
5329036
Sitemap sort order priorities updated
saadmk11 May 23, 2019
d64e2d0
ordering fix
saadmk11 May 25, 2019
51ad395
doc string fix
saadmk11 May 25, 2019
884857b
sort_by_priority function added to sitemap
saadmk11 May 29, 2019
43b24d7
lint fix
saadmk11 May 29, 2019
3e278a2
Sorting by swapping positions
saadmk11 Jun 11, 2019
7d3f934
index out of range issue fix
saadmk11 Jun 12, 2019
4194a42
Use a real SessionBase object on FooterNoSessionMiddleware
humitos Jun 12, 2019
5572dee
Version Type Added
saadmk11 May 30, 2019
7f90a88
Version Model Methods Updated
saadmk11 May 30, 2019
19e7fa1
Internal and External Version Manager added
saadmk11 Jun 4, 2019
bd256fd
lint fix
saadmk11 Jun 4, 2019
fef7191
All Version Querysets Updated with InternalVersionManager
saadmk11 Jun 4, 2019
0dd9eb2
Manager names moved to Constants
saadmk11 Jun 5, 2019
f267881
Tests added
saadmk11 Jun 6, 2019
cc1297f
Version Update, Delete Html and wipe updated to exclude PR Versions
saadmk11 Jun 6, 2019
20ca139
Updated migrations
saadmk11 Jun 6, 2019
cb17a79
footer API updated
saadmk11 Jun 8, 2019
f687302
manager tests updated
saadmk11 Jun 11, 2019
bf9bd5e
_override_setting removed from new managers
saadmk11 Jun 13, 2019
12cd686
BuildTriggerMixin updated
saadmk11 Jun 13, 2019
d7330c1
More Update
saadmk11 Jun 13, 2019
eed1a9c
lint fix
saadmk11 Jun 13, 2019
f3f86dc
Move search functions
stsewd Jun 13, 2019
3d62248
removed unused import
saadmk11 Jun 14, 2019
09a09a2
External version name added everywhere
saadmk11 Jun 17, 2019
119a3ae
Migration name changed
saadmk11 Jun 17, 2019
df4705a
Removed PR Versions from Elasticsearch Indexing
saadmk11 Jun 14, 2019
9140a57
HTMLFile manager added
saadmk11 Jun 14, 2019
f902d65
typo fix
saadmk11 Jun 14, 2019
afd5e47
lint fix
saadmk11 Jun 17, 2019
f03db54
External naming updated
saadmk11 Jun 18, 2019
1173718
Merge branch 'master' into version-update
saadmk11 Jun 18, 2019
5a05b6c
naming update
saadmk11 Jun 18, 2019
7607268
Merge branch 'gsoc-19-pr-builder' into build-manager-update
saadmk11 Jun 18, 2019
560cfef
Merge branch 'gsoc-19-pr-builder' into remove-pr-from-es
saadmk11 Jun 18, 2019
75efef8
naming updated
saadmk11 Jun 18, 2019
3c13c38
naming update for External
saadmk11 Jun 18, 2019
51188e7
fix
saadmk11 Jun 18, 2019
3bdf03c
fix
saadmk11 Jun 18, 2019
9b99538
vcs_url() update
saadmk11 Jun 18, 2019
cfd085c
tests updated
saadmk11 Jun 18, 2019
0beaad6
Merge pull request #5779 from saadmk11/build-manager-update
ericholscher Jun 18, 2019
13c5330
Merge branch 'gsoc-19-pr-builder' into remove-pr-from-es
saadmk11 Jun 19, 2019
6fd5f68
lint fix
saadmk11 Jun 19, 2019
be8f4de
Sync External versions to our database
ericholscher Jun 18, 2019
30ac6ba
Remove unused patterns
ericholscher Jun 18, 2019
df122da
Small whitespace cleanup
ericholscher Jun 18, 2019
da4f71d
Clean up fetch logic a bit
ericholscher Jun 18, 2019
1207afb
Add Comment
ericholscher Jun 18, 2019
c74d294
Initial changes for PR Builder
saadmk11 Jun 19, 2019
e7c7417
removed _default_class for BuildManager
saadmk11 Jun 20, 2019
5fb2e4e
Only build external version from webhook payload
saadmk11 Jun 21, 2019
a859eac
fix
saadmk11 Jun 21, 2019
5b883df
need to pass verbose_name as a list for get_response_push
saadmk11 Jun 21, 2019
12f6658
Merge pull request #5828 from saadmk11/pr-builder
ericholscher Jun 21, 2019
7bcb3e1
Merge pull request #5805 from saadmk11/remove-pr-from-es
ericholscher Jun 21, 2019
a166563
Merge branch 'master' of github.com:rtfd/readthedocs.org into gsoc-19…
ericholscher Jun 21, 2019
31041a3
add all versions and builds to version and build listing
saadmk11 Jun 21, 2019
9cf8ec3
fix tests
saadmk11 Jun 21, 2019
711ed9a
fix tests
saadmk11 Jun 21, 2019
65697cb
refine webhook handling
saadmk11 Jun 22, 2019
7fa5a01
lint fix
saadmk11 Jun 22, 2019
5718ea7
Doc string updated
saadmk11 Jun 22, 2019
5663dc3
Doc string updated
saadmk11 Jun 22, 2019
e5d9725
Updated Action
saadmk11 Jun 24, 2019
7c6abc7
Merge pull request #5837 from saadmk11/remove-internal-filtering
ericholscher Jun 24, 2019
3427564
Pull Request Closed webhook handled
saadmk11 Jun 25, 2019
2f739f0
More refining
saadmk11 Jun 26, 2019
9fbb839
tests added
saadmk11 Jun 27, 2019
cdd38a1
vcs_repo updated
saadmk11 Jun 27, 2019
7ef5175
vcs_repo more update
saadmk11 Jun 27, 2019
30390fe
updated event handling
saadmk11 Jun 27, 2019
694a27b
vcs_repo method updated
saadmk11 Jun 27, 2019
d721fc0
fix
saadmk11 Jun 27, 2019
1692dfb
use named args
saadmk11 Jun 27, 2019
7b2bc6c
Docstring added and some changes added
saadmk11 Jun 27, 2019
d38e44a
Merge pull request #5838 from saadmk11/refine-pr-building
ericholscher Jun 27, 2019
70be132
Merge branch 'master' into gsoc-19-pr-builder
saadmk11 Jul 4, 2019
6400305
migrations updated
saadmk11 Jul 4, 2019
04d4dca
fix typo
saadmk11 Jul 4, 2019
40fb6ee
Send Build Status using Github Status API
saadmk11 Jun 28, 2019
c561486
docstring update
saadmk11 Jun 28, 2019
3cf07f2
Updated Constants and notification sending
saadmk11 Jun 29, 2019
d9a867b
cleanup
saadmk11 Jun 29, 2019
ef6707b
task update
saadmk11 Jul 2, 2019
66526be
send_build_status updated
saadmk11 Jul 2, 2019
8f2505a
updated get full url
saadmk11 Jul 2, 2019
ac67805
changed to PRODUCTION_DOMAIN
saadmk11 Jul 2, 2019
95264e0
tasks updated
saadmk11 Jul 2, 2019
1c0dda5
some tests added
saadmk11 Jul 3, 2019
9b10ea6
send_build_status tests added
saadmk11 Jul 4, 2019
e8098fb
tests for tasks added
saadmk11 Jul 4, 2019
e7a1641
try catch added to task
saadmk11 Jul 4, 2019
917b2e5
exception log updated
saadmk11 Jul 4, 2019
3f500e3
storage updated for external versions
saadmk11 Jul 6, 2019
f9634b6
update send_build_status process
saadmk11 Jul 9, 2019
ec1c6a4
removed gitlab build status constants
saadmk11 Jul 9, 2019
edab9b3
lint fix
saadmk11 Jul 9, 2019
1d4e0db
version type passed to function
saadmk11 Jul 9, 2019
7629360
only build html for external versions
saadmk11 Jul 9, 2019
b436ed1
doc string update
saadmk11 Jul 10, 2019
1117caa
remove log test
saadmk11 Jul 10, 2019
21bc227
add check for external version in conf.py.tmpl
saadmk11 Jul 10, 2019
d7b1d0c
remove external versions from get_latest_build
saadmk11 Jul 10, 2019
c4f06dc
Merge pull request #5865 from saadmk11/github-status-api
ericholscher Jul 10, 2019
9f492da
Merge branch 'gsoc-19-pr-builder' into update-storage
ericholscher Jul 10, 2019
92215ce
Merge pull request #5886 from saadmk11/update-storage
ericholscher Jul 10, 2019
f2719b5
Merge pull request #5901 from saadmk11/get-latest-build-update
ericholscher Jul 10, 2019
9bc0e33
Pass the build_pk to the task instead of the build object itself
ericholscher Jul 10, 2019
23a215e
added Feature flag to enable External version building
saadmk11 Jul 11, 2019
219e0df
lint fix
saadmk11 Jul 11, 2019
64174f4
Apply suggestions from code review
ericholscher Jul 11, 2019
9b23646
Merge pull request #5904 from readthedocs/pass-version-github-notific…
ericholscher Jul 11, 2019
b4a39aa
update conditions
saadmk11 Jul 11, 2019
5466b14
tests fixed
saadmk11 Jul 11, 2019
a6f4dd1
Merge pull request #5914 from saadmk11/test-fix
ericholscher Jul 11, 2019
b577d63
Merge pull request #5910 from saadmk11/feature-flag
ericholscher Jul 11, 2019
f03d076
Merge branch 'master' into gsoc-19-pr-builder
saadmk11 Jul 11, 2019
1167c40
Update build list and detail page
saadmk11 Jul 11, 2019
d5af035
added commit url
saadmk11 Jul 11, 2019
1dd6bf2
Added commit url for build details page
saadmk11 Jul 12, 2019
2166770
Added tests
saadmk11 Jul 12, 2019
9af5521
setting commit url updated
saadmk11 Jul 12, 2019
8310e58
lint fix
saadmk11 Jul 12, 2019
ddf5259
Merge branch 'master' into gsoc-19-pr-builder
saadmk11 Jul 12, 2019
9f593f2
Merge pull request #5916 from saadmk11/fix-build-ux
ericholscher Jul 15, 2019
763b857
commit url return updated
saadmk11 Jul 16, 2019
2537fc3
small updates according to suggestions
saadmk11 Jul 16, 2019
9e643dc
Send failure status when build state in unknown
saadmk11 Jul 16, 2019
999070b
Test Fix
saadmk11 Jul 16, 2019
4f1709e
build details page UI fix
saadmk11 Jul 16, 2019
ce1353e
Added get_or_create for external version creation
saadmk11 Jul 16, 2019
f84ee69
create external version updated
saadmk11 Jul 16, 2019
b1fe82f
comments updated
saadmk11 Jul 16, 2019
8ed0345
log message updated
saadmk11 Jul 16, 2019
290bab8
log mistake fix
saadmk11 Jul 16, 2019
bf8247f
test fix
saadmk11 Jul 16, 2019
ea09b41
Merge pull request #5933 from saadmk11/refine-pr-builder
ericholscher Jul 16, 2019
249e393
update build status message
saadmk11 Jul 17, 2019
008051a
small updates
saadmk11 Jul 17, 2019
b3128ae
external version feature flag fix
saadmk11 Jul 17, 2019
7861b0e
Merge pull request #5948 from saadmk11/pr-builder-update
ericholscher Jul 17, 2019
9c5a756
Merge pull request #5900 from saadmk11/external-version-warning
ericholscher Jul 17, 2019
a25be20
Merge branch 'gsoc-19-pr-builder' into update-status-msg
saadmk11 Jul 18, 2019
49e3fe4
update status msg
saadmk11 Jul 18, 2019
0b454bb
Merge branch 'master' into gsoc-19-pr-builder
saadmk11 Jul 19, 2019
d89d519
Merge pull request #5947 from saadmk11/update-status-msg
ericholscher Jul 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tasks updated
saadmk11 committed Jul 4, 2019
commit 95264e0b260c957bbb1726adffa1b41447ee98f4
9 changes: 6 additions & 3 deletions readthedocs/core/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -81,7 +81,10 @@ def prepare_build(
# Avoid circular import
from readthedocs.builds.models import Build
from readthedocs.projects.models import Project
from readthedocs.projects.tasks import update_docs_task, send_build_status
from readthedocs.projects.tasks import (
update_docs_task,
send_external_build_status,
)

build = None

@@ -129,8 +132,8 @@ def prepare_build(
options['time_limit'] = int(time_limit * 1.2)

if build:
# Send pending Build Status to Git Status API
send_build_status.delay(build.id, BUILD_STATUS_PENDING)
# Send pending Build Status using Git Status API for External Builds.
send_external_build_status(build.id, BUILD_STATUS_PENDING)

return (
update_docs_task.signature(
13 changes: 7 additions & 6 deletions readthedocs/oauth/services/github.py
Original file line number Diff line number Diff line change
@@ -372,13 +372,14 @@ def send_build_status(self, build, state):
)
# Response data should always be JSON, still try to log if not
# though
try:
debug_data = resp.json()
except ValueError:
if resp is not None:
if resp is not None:
try:
debug_data = resp.json()
except ValueError:
debug_data = resp.content
else:
debug_data = resp
else:
debug_data = resp

log.debug(
'GitHub commit status creation failure response: %s',
debug_data,
30 changes: 19 additions & 11 deletions readthedocs/projects/tasks.py
Original file line number Diff line number Diff line change
@@ -1023,7 +1023,7 @@ def is_type_sphinx(self):

def send_build_status(self, build_pk, state):
"""Send github build status for pull/merge requests."""
send_build_status.delay(build_pk, state)
send_external_build_status(build_pk, state)


# Web tasks
@@ -1796,27 +1796,35 @@ def retry_domain_verification(domain_pk):


@app.task(queue='web')
def send_build_status(build_pk, state):
def send_build_status(build, state):
"""
Send Build Status to Git Status API for project external versions.

:param build_pk: Build pk
:param build: Build
:param state: build state failed, pending, or success to be sent.
"""
build = Build.objects.get(pk=build_pk)

# Send status reports for only External (pull/merge request) Versions.
if build.version.type != EXTERNAL:
return

if build.project.remote_repository.account.provider == 'github':
account = build.project.remote_repository.account
service = GitHubService(
build.project.remote_repository.users.first(),
account
build.project.remote_repository.account
)

# send Status report using the API.
service.send_build_status(build, state)

# TODO: Send build status for other providers.


def send_external_build_status(build_pk, state):
"""
Check if build is external and Send Build Status for project external versions.

:param build_pk: Build pk
:param state: build state failed, pending, or success to be sent.
"""
build = Build.objects.get(pk=build_pk)

# Send status reports for only External (pull/merge request) Versions.
if build.version.type == EXTERNAL:
# call the task that actually send the build status.
send_build_status.delay(build, state)