Skip to content

Commit dc6f2ef

Browse files
committed
Revert "Service: kwargs only when sending build statuses"
This reverts commit 7615e0e.
1 parent 7615e0e commit dc6f2ef

File tree

5 files changed

+12
-24
lines changed

5 files changed

+12
-24
lines changed

readthedocs/builds/tasks.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ def send_build_status(build_pk, commit, status):
416416

417417
for service in service_class.for_project(build.project):
418418
success = service.send_build_status(
419-
build=build,
420-
commit=commit,
421-
status=status,
419+
build,
420+
commit,
421+
status,
422422
)
423423
if success:
424424
log.debug("Build status report sent correctly.")

readthedocs/oauth/services/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def update_webhook(self, project, integration):
8686
"""
8787
raise NotImplementedError
8888

89-
def send_build_status(self, *, build, commit, status):
89+
def send_build_status(self, build, commit, status):
9090
"""
9191
Create commit status for project.
9292

readthedocs/oauth/services/github.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def update_webhook(self, project, integration):
406406

407407
return (False, resp)
408408

409-
def send_build_status(self, *, build, commit, status):
409+
def send_build_status(self, build, commit, status):
410410
"""
411411
Create GitHub commit status for project.
412412

readthedocs/oauth/services/gitlab.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def update_webhook(self, project, integration):
495495

496496
return (False, resp)
497497

498-
def send_build_status(self, *, build, commit, status):
498+
def send_build_status(self, build, commit, status):
499499
"""
500500
Create GitLab commit status for project.
501501

readthedocs/rtd_tests/tests/test_oauth.py

+6-18
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,7 @@ def test_multiple_users_same_repo(self):
305305
def test_send_build_status_successful(self, session, mock_logger):
306306
session.post.return_value.status_code = 201
307307
success = self.service.send_build_status(
308-
build=self.external_build,
309-
commit=self.external_build.commit,
310-
status=BUILD_STATUS_SUCCESS,
308+
self.external_build, self.external_build.commit, BUILD_STATUS_SUCCESS
311309
)
312310

313311
self.assertTrue(success)
@@ -321,9 +319,7 @@ def test_send_build_status_successful(self, session, mock_logger):
321319
def test_send_build_status_404_error(self, session, mock_logger):
322320
session.post.return_value.status_code = 404
323321
success = self.service.send_build_status(
324-
build=self.external_build,
325-
commit=self.external_build.commit,
326-
status=BUILD_STATUS_SUCCESS,
322+
self.external_build, self.external_build.commit, BUILD_STATUS_SUCCESS
327323
)
328324

329325
self.assertFalse(success)
@@ -337,9 +333,7 @@ def test_send_build_status_404_error(self, session, mock_logger):
337333
def test_send_build_status_value_error(self, session, mock_logger):
338334
session.post.side_effect = ValueError
339335
success = self.service.send_build_status(
340-
build=self.external_build,
341-
commit=self.external_build.commit,
342-
status=BUILD_STATUS_SUCCESS,
336+
self.external_build, self.external_build.commit, BUILD_STATUS_SUCCESS
343337
)
344338

345339
self.assertFalse(success)
@@ -1169,9 +1163,7 @@ def test_send_build_status_successful(self, repo_id, session, mock_logger):
11691163
repo_id().return_value = "9999"
11701164

11711165
success = self.service.send_build_status(
1172-
build=self.external_build,
1173-
commit=self.external_build.commit,
1174-
status=BUILD_STATUS_SUCCESS,
1166+
self.external_build, self.external_build.commit, BUILD_STATUS_SUCCESS
11751167
)
11761168

11771169
self.assertTrue(success)
@@ -1188,9 +1180,7 @@ def test_send_build_status_404_error(self, repo_id, session, mock_logger):
11881180
repo_id.return_value = "9999"
11891181

11901182
success = self.service.send_build_status(
1191-
build=self.external_build,
1192-
commit=self.external_build.commit,
1193-
status=BUILD_STATUS_SUCCESS,
1183+
self.external_build, self.external_build.commit, BUILD_STATUS_SUCCESS
11941184
)
11951185

11961186
self.assertFalse(success)
@@ -1207,9 +1197,7 @@ def test_send_build_status_value_error(self, repo_id, session, mock_logger):
12071197
repo_id().return_value = "9999"
12081198

12091199
success = self.service.send_build_status(
1210-
build=self.external_build,
1211-
commit=self.external_build.commit,
1212-
status=BUILD_STATUS_SUCCESS,
1200+
self.external_build, self.external_build.commit, BUILD_STATUS_SUCCESS
12131201
)
12141202

12151203
self.assertFalse(success)

0 commit comments

Comments
 (0)