-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add BuildCommand support and missing fields to API v3 Build endpoint #12562
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
Draft
Copilot
wants to merge
4
commits into
main
Choose a base branch
from
copilot/update-build-api-to-v3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+197
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add BuildCommandSerializer for build command results - Add commands field to BuildSerializer - Add docs_url field to BuildSerializer - Add commit_url field to BuildSerializer - Add builder field to BuildSerializer - Enable ?expand=notifications for Build endpoint - Add comprehensive tests for new fields and expand functionality - Update test fixtures to include new fields Co-authored-by: ericholscher <25510+ericholscher@users.noreply.github.com>
Co-authored-by: ericholscher <25510+ericholscher@users.noreply.github.com>
Member
|
@copilot Update the public REST API docs, not the design docs. |
Copilot
AI
changed the title
[WIP] Update dashboard to use API v3 for BuildCommands
Add BuildCommand support and missing fields to API v3 Build endpoint
Nov 10, 2025
Copilot finished work on behalf of
ericholscher
November 10, 2025 16:01
- Revert changes to docs/dev/design/apiv3.rst (design docs) - Add new Build endpoint fields to docs/user/api/v3.rst (public API docs) - Document commands, commit_url, docs_url, builder fields - Update expand parameter to include notifications option Co-authored-by: ericholscher <25510+ericholscher@users.noreply.github.com>
Contributor
Author
Updated the public REST API docs (
Commit: 3021e5a |
Copilot finished work on behalf of
ericholscher
November 10, 2025 16:07
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary: Add missing fields to API v3 Build endpoint ✅
All requirements from the issue have been successfully implemented:
commandsfield to BuildSerializer (BuildCommand support)docs_urlfield to BuildSerializercommit_urlfield to BuildSerializerbuilderfield to BuildSerializer (for debugging)?expand=configfor the config object (verified existing functionality)?expand=notificationsfor notifications expansionImplementation Details
1. Serializers (
readthedocs/api/v3/serializers.py)Added BuildCommandSerializer:
Enhanced BuildSerializer with new fields:
commands: List of BuildCommandResult objects (many=True)docs_url: URL to built documentation viaget_docs_url()methodcommit_url: URL to VCS commit via model'sget_commit_url()builder: Builder hostname for debugging purposesnotificationsto expandable_fields for?expand=notificationssupport2. Views (
readthedocs/api/v3/views.py)Updated
BuildsViewSet.permit_list_expandsto include"notifications"alongside existing"config".3. Tests (
readthedocs/api/v3/tests/)Test fixtures updated:
New test coverage:
test_projects_builds_detail_has_new_fields(): Validates presence and values of new fieldstest_projects_builds_detail_expand_config(): Tests config expansiontest_projects_builds_detail_expand_notifications(): Tests notification expansion4. Documentation (
docs/user/api/v3.rst)Updated public REST API documentation with:
Code Quality
✅ All Python files pass syntax validation
✅ All JSON fixtures are valid
✅ Implementation follows existing v2 API patterns
✅ Consistent error handling (returns None for missing version)
✅ No trailing whitespace or obvious style issues
✅ Comprehensive docstrings added
API Usage Examples
Get build with new fields:
Expand config:
Expand notifications:
Expand both:
This implementation addresses all requirements from the issue and brings the v3 Build API to feature parity with v2 while supporting the new dashboard needs.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.