Skip to content

Commit cdcecf0

Browse files
committed
Merge branch 'master' into separate-dev-docs
2 parents 0b786b9 + 342b449 commit cdcecf0

File tree

24 files changed

+463
-349
lines changed

24 files changed

+463
-349
lines changed

CHANGELOG.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
Version 6.3.1
2+
-------------
3+
4+
:Date: December 14, 2021
5+
6+
* `@stsewd <https://github.com/stsewd>`__: Explicit settings for some tests (`#8759 <https://github.com/readthedocs/readthedocs.org/pull/8759>`__)
7+
* `@stsewd <https://github.com/stsewd>`__: Don't run spam rules check after ban action (`#8756 <https://github.com/readthedocs/readthedocs.org/pull/8756>`__)
8+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Add MyST Markdown examples everywhere (`#8752 <https://github.com/readthedocs/readthedocs.org/pull/8752>`__)
9+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Update mambaforge to latest version (`#8749 <https://github.com/readthedocs/readthedocs.org/pull/8749>`__)
10+
* `@stsewd <https://github.com/stsewd>`__: Update django (`#8748 <https://github.com/readthedocs/readthedocs.org/pull/8748>`__)
11+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Remove sphinx-doc.org from external domains (`#8747 <https://github.com/readthedocs/readthedocs.org/pull/8747>`__)
12+
* `@stsewd <https://github.com/stsewd>`__: Fix call to sync_remote_repositories (`#8742 <https://github.com/readthedocs/readthedocs.org/pull/8742>`__)
13+
* `@stsewd <https://github.com/stsewd>`__: Tests: set privacy level explicitly (`#8740 <https://github.com/readthedocs/readthedocs.org/pull/8740>`__)
14+
* `@humitos <https://github.com/humitos>`__: Spam: contact link on template (`#8739 <https://github.com/readthedocs/readthedocs.org/pull/8739>`__)
15+
* `@humitos <https://github.com/humitos>`__: Spam: fix admin filter (`#8738 <https://github.com/readthedocs/readthedocs.org/pull/8738>`__)
16+
* `@stsewd <https://github.com/stsewd>`__: Always clear cache after each test (`#8737 <https://github.com/readthedocs/readthedocs.org/pull/8737>`__)
17+
* `@humitos <https://github.com/humitos>`__: Logging: tweaks and minor improvements (`#8736 <https://github.com/readthedocs/readthedocs.org/pull/8736>`__)
18+
* `@humitos <https://github.com/humitos>`__: Logs: typo on keyname (`#8734 <https://github.com/readthedocs/readthedocs.org/pull/8734>`__)
19+
* `@humitos <https://github.com/humitos>`__: Log: use structlog-sentry to send logs to Sentry (`#8732 <https://github.com/readthedocs/readthedocs.org/pull/8732>`__)
20+
* `@humitos <https://github.com/humitos>`__: docs: use Python 3.8 to build our docs (`#8731 <https://github.com/readthedocs/readthedocs.org/pull/8731>`__)
21+
* `@agjohnson <https://github.com/agjohnson>`__: Release 6.3.0 (`#8730 <https://github.com/readthedocs/readthedocs.org/pull/8730>`__)
22+
* `@stsewd <https://github.com/stsewd>`__: Custom Domain: make cname_target configurable (`#8728 <https://github.com/readthedocs/readthedocs.org/pull/8728>`__)
23+
* `@stsewd <https://github.com/stsewd>`__: Test external serving for projects with `--` in slug (`#8716 <https://github.com/readthedocs/readthedocs.org/pull/8716>`__)
24+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Add guide to migrate from reST to MyST (`#8714 <https://github.com/readthedocs/readthedocs.org/pull/8714>`__)
25+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Avoid future breakage of `setup.py` invokations (`#8711 <https://github.com/readthedocs/readthedocs.org/pull/8711>`__)
26+
* `@humitos <https://github.com/humitos>`__: structlog: migrate application code to better logging (`#8705 <https://github.com/readthedocs/readthedocs.org/pull/8705>`__)
27+
* `@humitos <https://github.com/humitos>`__: EmbedAPI: log success requests (`#8689 <https://github.com/readthedocs/readthedocs.org/pull/8689>`__)
28+
* `@ericholscher <https://github.com/ericholscher>`__: Add ability to rebuild a specific build (`#6995 <https://github.com/readthedocs/readthedocs.org/pull/6995>`__)
29+
130
Version 6.3.0
231
-------------
332

common

Submodule common updated 1 file

docs/user/advertising/ethical-advertising.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Ethical Ads
2-
===========
1+
EthicalAds
2+
==========
33

44
.. meta::
55
:description lang=en: To fund Read the Docs, we built an ad platform that doesn't track users and respects their privacy.
@@ -8,9 +8,9 @@ Ethical Ads
88
Read the Docs is a large, free web service.
99
There is one proven business model to support this kind of site: **Advertising**.
1010
We are building the advertising model we want to exist,
11-
and we're calling it **Ethical Ads**.
11+
and we're calling it **EthicalAds**.
1212

13-
**Ethical Ads respect users while providing value to advertisers.**
13+
**EthicalAds respect users while providing value to advertisers.**
1414
We don't track you, sell your data, or anything else.
1515
We simply show ads to users, based on the content of the pages you look at.
1616
We also give 10% of our ad space to :ref:`community projects <advertising/ethical-advertising:Community Ads>`,

docs/user/guides/embedding-content.rst

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,33 @@ and show a modal when the user clicks in a "Help" link.
7979
To avoid that, you can manually define Sphinx references above the sections you don't want to break.
8080
For example,
8181

82-
.. code-block:: rst
83-
:emphasize-lines: 3
82+
.. tabs::
8483

85-
.. in your .rst document file
84+
.. tab:: reStructuredText
8685

87-
.. _unbreakable-section-reference:
86+
.. code-block:: rst
87+
:emphasize-lines: 3
8888
89-
Creating an automation rule
90-
---------------------------
89+
.. in your .rst document file
9190
92-
This is the text of the section.
91+
.. _unbreakable-section-reference:
92+
93+
Creating an automation rule
94+
---------------------------
95+
96+
This is the text of the section.
97+
98+
.. tab:: MyST (Markdown)
99+
100+
.. code-block:: md
101+
:emphasize-lines: 3
102+
103+
.. in your .md document file
104+
105+
(unbreakable-section-reference)=
106+
## Creating an automation rule
107+
108+
This is the text of the section.
93109
94110
To link to the section "Creating an automation rule" you can send ``section=unbreakable-section-reference``.
95111
If you change the title it won't break the embedded content because the label for that title will still be ``unbreakable-section-reference``.

docs/user/guides/jupyter.rst

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,29 @@ Next, you will need to enable one of the extensions, as follows:
5858
Finally, you can include the notebook in any *toctree*.
5959
For example, add this to your root document:
6060

61-
.. code-block:: rest
61+
.. tabs::
62+
63+
.. tab:: reStructuredText
64+
65+
.. code-block:: rst
66+
67+
.. toctree::
68+
:maxdepth: 2
69+
:caption: Contents:
6270
63-
.. toctree::
64-
:maxdepth: 2
65-
:caption: Contents:
71+
notebooks/Example 1
6672
67-
notebooks/Example 1
73+
.. tab:: MyST (Markdown)
74+
75+
.. code-block:: md
76+
77+
```{toctree}
78+
---
79+
maxdepth: 2
80+
caption: Contents:
81+
---
82+
notebooks/Example 1
83+
```
6884
6985
The notebook will render as any other HTML page in your documentation
7086
after doing ``make html``.
@@ -255,14 +271,29 @@ For example, this reST markup would create a thumbnail gallery
255271
with generic images as thumbnails,
256272
thanks to the Sphinx-Gallery default style:
257273

258-
.. code-block:: rest
274+
.. tabs::
275+
276+
.. tab:: reStructuredText
277+
278+
.. code-block:: rst
279+
280+
Thumbnails gallery
281+
==================
282+
283+
.. nbgallery::
284+
notebooks/Example 1
285+
notebooks/Example 2
286+
287+
.. tab:: MyST (Markdown)
288+
289+
.. code-block:: md
259290
260-
Thumbnails gallery
261-
==================
291+
# Thumbnails gallery
262292
263-
.. nbgallery::
264-
notebooks/Example 1
265-
notebooks/Example 2
293+
```{nbgallery}
294+
notebooks/Example 1
295+
notebooks/Example 2
296+
```
266297
267298
.. figure:: /_static/images/guides/thumbnail-gallery.png
268299
:width: 80%

readthedocs/api/v2/views/integrations.py

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ class WebhookMixin:
6868
def post(self, request, project_slug):
6969
"""Set up webhook post view with request and project objects."""
7070
self.request = request
71+
72+
log.bind(
73+
project_slug=project_slug,
74+
integration_type=self.integration_type,
75+
)
76+
7177
# WARNING: this is a hack to allow us access to `request.body` later.
7278
# Due to a limitation of DRF, we can't access `request.body`
7379
# after accessing `request.data`.
@@ -85,11 +91,7 @@ def post(self, request, project_slug):
8591
except Project.DoesNotExist:
8692
raise NotFound('Project not found')
8793
if not self.is_payload_valid():
88-
log.warning(
89-
'Invalid payload for project and integration.',
90-
project_slug=project_slug,
91-
integration_type=self.integration_type,
92-
)
94+
log.warning('Invalid payload for project and integration.')
9395
return Response(
9496
{'detail': self.invalid_payload_msg},
9597
status=HTTP_400_BAD_REQUEST,
@@ -186,7 +188,6 @@ def get_response_push(self, project, branches):
186188
if not_building:
187189
log.info(
188190
'Skipping project branches.',
189-
project_slug=project.slug,
190191
branches=branches,
191192
)
192193
triggered = bool(to_build)
@@ -338,10 +339,7 @@ def is_payload_valid(self):
338339
signature = self.request.META.get(GITHUB_SIGNATURE_HEADER)
339340
secret = self.get_integration().secret
340341
if not secret:
341-
log.info(
342-
'Skipping payload signature validation.',
343-
project_slug=self.project.slug,
344-
)
342+
log.debug('Skipping payload signature validation.')
345343
return True
346344
if not signature:
347345
return False
@@ -397,6 +395,7 @@ def handle_webhook(self):
397395
created = self.data.get('created', False)
398396
deleted = self.data.get('deleted', False)
399397
event = self.request.META.get(GITHUB_EVENT_HEADER, GITHUB_PUSH)
398+
log.bind(webhook_event=event)
400399
webhook_github.send(
401400
Project,
402401
project=self.project,
@@ -406,11 +405,7 @@ def handle_webhook(self):
406405

407406
# Sync versions when a branch/tag was created/deleted
408407
if event in (GITHUB_CREATE, GITHUB_DELETE):
409-
log.info(
410-
'Triggered sync_versions.',
411-
project_slug=self.project.slug,
412-
webhook_event=event,
413-
)
408+
log.info('Triggered sync_versions.')
414409
return self.sync_versions_response(self.project)
415410

416411
# Handle pull request events
@@ -446,7 +441,10 @@ def handle_webhook(self):
446441
# already have the CREATE/DELETE events. So we don't trigger the sync twice.
447442
return self.sync_versions_response(self.project, sync=False)
448443

449-
log.info('Triggered sync_versions.', project_slug=self.project.slug, events=events)
444+
log.info(
445+
'Triggered sync_versions.',
446+
integration_events=events,
447+
)
450448
return self.sync_versions_response(self.project)
451449

452450
# Trigger a build for all branches in the push
@@ -516,10 +514,7 @@ def is_payload_valid(self):
516514
token = self.request.META.get(GITLAB_TOKEN_HEADER)
517515
secret = self.get_integration().secret
518516
if not secret:
519-
log.info(
520-
'Skipping payload signature validation.',
521-
project_slug=self.project.slug,
522-
)
517+
log.debug('Skipping payload signature validation.')
523518
return True
524519
if not token:
525520
return False
@@ -546,6 +541,7 @@ def handle_webhook(self):
546541
"""
547542
event = self.request.data.get('object_kind', GITLAB_PUSH)
548543
action = self.data.get('object_attributes', {}).get('action', None)
544+
log.bind(webhook_event=event)
549545
webhook_gitlab.send(
550546
Project,
551547
project=self.project,
@@ -561,7 +557,6 @@ def handle_webhook(self):
561557
if GITLAB_NULL_HASH in (before, after):
562558
log.info(
563559
'Triggered sync_versions.',
564-
project_slug=self.project.slug,
565560
before=before,
566561
after=after,
567562
)
@@ -638,6 +633,7 @@ def handle_webhook(self):
638633
attribute (null if it is a creation).
639634
"""
640635
event = self.request.META.get(BITBUCKET_EVENT_HEADER, BITBUCKET_PUSH)
636+
log.bind(webhook_event=event)
641637
webhook_bitbucket.send(
642638
Project,
643639
project=self.project,
@@ -661,11 +657,7 @@ def handle_webhook(self):
661657
# will be triggered with the normal push.
662658
if branches:
663659
return self.get_response_push(self.project, branches)
664-
log.info(
665-
'Triggered sync_versions.',
666-
project_slug=self.project.slug,
667-
webhook_event=event,
668-
)
660+
log.info('Triggered sync_versions.')
669661
return self.sync_versions_response(self.project)
670662
except KeyError:
671663
raise ParseError('Invalid request')

readthedocs/doc_builder/environments.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,12 @@ def __exit__(self, exc_type, exc_value, tb):
546546
self.update_build(BUILD_STATE_FINISHED)
547547
log.info(
548548
'Build finished',
549+
# TODO: move all of these attributes to ``log.bind`` if possible
549550
project_slug=self.project.slug if self.project else '',
550551
version_slug=self.version.slug if self.version else '',
552+
# TODO: add organization_slug here
553+
success=self.build.get('success') if self.build else '',
554+
length=self.build.get('length') if self.build else '',
551555
)
552556
return ret
553557

readthedocs/embed/v3/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ def get(self, request): # noqa
346346
'EmbedAPI successful response.',
347347
project_slug=self.unresolved_url.project.slug if not external else None,
348348
domain=domain if external else None,
349+
doctool=doctool,
350+
doctoolversion=doctoolversion,
349351
url=url,
350352
referer=request.META.get('HTTP_REFERER'),
351353
external=external,

0 commit comments

Comments
 (0)