Skip to content

[readthedocs] Move to readthedocs API v3#11995

Open
LitoMore wants to merge 2 commits into
badges:masterfrom
LitoMore:fix/readthedocs-api-v3
Open

[readthedocs] Move to readthedocs API v3#11995
LitoMore wants to merge 2 commits into
badges:masterfrom
LitoMore:fix/readthedocs-api-v3

Conversation

@LitoMore

Copy link
Copy Markdown
Member

Fixes #11952

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️ This PR modified the server but none of its tests.
That's okay so long as it's refactoring existing code.
Messages
📖 ✨ Thanks for your contribution to Shields, @LitoMore!
📖

Thanks for contributing to our documentation. We ❤️ our documentarians!

Generated by 🚫 dangerJS against 9af592d

Comment thread services/readthedocs/readthedocs.tester.js
@LitoMore
LitoMore requested a review from PyvesB July 13, 2026 12:24
const build = results.find(({ state }) => state.code === 'finished')
if (!build) {
throw new NotFound({
prettyMessage: 'project or version not found',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a project or version is not found, won't it return a 404, as per line 86? Perhaps this message should say something along the lines of no finished builds?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. A 404 is already handled separately, so an empty results array specifically means there are no finished builds. I’ll change the message to no finished builds.

Comment on lines +74 to +79
.intercept(nock =>
nock(apiBaseUrl)
.get('/api/v3/projects/this-repo/versions/does-not-exist/builds/')
.query(buildsQuery)
.reply(404),
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this test non-mocked as well, to exercise the 404 path properly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the live API, but the builds endpoint returns 200 with an empty results array for both unknown projects and unknown versions, so making this test non-mocked would not exercise the 404 path. I’ll change the empty-results message to no finished builds. Would you prefer that we remove the unused 404 mapping and make the unknown-project test live, or keep the mocked test to cover a potential 404 response?

@PyvesB PyvesB added the service-badge New or updated service badge label Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

service-badge New or updated service badge

Development

Successfully merging this pull request may close these issues.

Read the Docs badge shows rate limited by upstream service

2 participants