Skip to content

Commit 2d48eb6

Browse files
authored
Remove API_LARGE_DATA feature flag (#12309)
Closes #12293
1 parent 61648cd commit 2d48eb6

File tree

2 files changed

+5
-35
lines changed

2 files changed

+5
-35
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
from docker.errors import NotFound as DockerNotFoundError
1717
from requests.exceptions import ConnectionError
1818
from requests.exceptions import ReadTimeout
19-
from requests_toolbelt.multipart.encoder import MultipartEncoder
2019

2120
from readthedocs.builds.models import BuildCommandResultMixin
2221
from readthedocs.core.utils import slugify
23-
from readthedocs.projects.models import Feature
2422

2523
from .constants import DOCKER_HOSTNAME_MAX_LEN
2624
from .constants import DOCKER_IMAGE
@@ -270,35 +268,12 @@ def save(self, api_client):
270268

271269
# If the command has an id, it means it has been saved before,
272270
# so we update it instead of creating a new one.
273-
if self.build_env.project.has_feature(Feature.API_LARGE_DATA):
274-
# Don't use slumber directly here. Slumber tries to enforce a string,
275-
# which will break our multipart encoding here.
276-
encoder = MultipartEncoder({key: str(value) for key, value in data.items()})
277-
if self.id:
278-
resource = api_client.command(self.id).patch
279-
resp = resource._store["session"].patch(
280-
resource._store["url"],
281-
data=encoder,
282-
headers={
283-
"Content-Type": encoder.content_type,
284-
},
285-
)
286-
else:
287-
resource = api_client.command.post
288-
resp = resource._store["session"].post(
289-
resource._store["base_url"],
290-
data=encoder,
291-
headers={
292-
"Content-Type": encoder.content_type,
293-
},
294-
)
295-
log.debug("Response via multipart form.", response=resp)
271+
if self.id:
272+
resp = api_client.command(self.id).patch(data)
296273
else:
297-
if self.id:
298-
resp = api_client.command(self.id).patch(data)
299-
else:
300-
resp = api_client.command.post(data)
301-
log.debug("Response via JSON encoded data.", response=resp)
274+
resp = api_client.command.post(data)
275+
276+
log.debug("Response via JSON encoded data.", response=resp)
302277

303278
self.id = resp.get("id")
304279

readthedocs/projects/models.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,6 @@ def add_features(sender, **kwargs):
19441944

19451945
# Feature constants - this is not a exhaustive list of features, features
19461946
# may be added by other packages
1947-
API_LARGE_DATA = "api_large_data"
19481947
RECORD_404_PAGE_VIEWS = "record_404_page_views"
19491948
DISABLE_PAGEVIEWS = "disable_pageviews"
19501949
RESOLVE_PROJECT_FROM_HEADER = "resolve_project_from_header"
@@ -1973,10 +1972,6 @@ def add_features(sender, **kwargs):
19731972
USE_S3_SCOPED_CREDENTIALS_ON_BUILDERS = "use_s3_scoped_credentials_on_builders"
19741973

19751974
FEATURES = (
1976-
(
1977-
API_LARGE_DATA,
1978-
_("Build: Try alternative method of posting large data"),
1979-
),
19801975
(
19811976
RECORD_404_PAGE_VIEWS,
19821977
_("Proxito: Record 404s page views."),

0 commit comments

Comments
 (0)