feat: RFC publication API#9975
Merged
jennifer-richards merged 21 commits intoietf-tools:feat/rpc-apifrom Nov 25, 2025
Merged
Conversation
Incomplete and in need of refactoring, but publishes an RFC.
Could do the same with group, but not clear it would ever be used.
Checkpointing progress before going further.
Contributor
|
should |
Member
Author
It's a string, to match |
This was referenced Nov 21, 2025
rjsparks
requested changes
Nov 24, 2025
Member
rjsparks
left a comment
There was a problem hiding this comment.
Opportunity to fix a bug that the current queue processor has:
ietf/api/serializers_rpc.py
Outdated
| log.log("Warning while processing {}: draft {} stream is {} but RFC stream is {}".format( | ||
| rfc.name, draft.name, draft.stream, rfc.stream | ||
| )) | ||
| elif draft.stream.slug in ["iab", "irtf", "ise"]: |
rjsparks
approved these changes
Nov 25, 2025
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Creating as draft, as there's some additional refactoring to be done.
Summary
Adds two API calls. The first,
notify_rfc_published()(/api/purple/rfc/publish/) creates a new RFCDocument, using similar procedures to theietf.sync.rfceditor.update_docs_from_rfc_index()method. The second,upload_rfc_files()(/api/purple/rfc/publish/files/) accepts one or more content files and puts these in place for a specified RFC. The expected publication procedure is to call these in that order. There will be a brief period where the datatracker knows about the RFC but does not yet have its contents, but that is not new behavior compared to the existing sync mechanisms.notify_rfc_publishedAPIPayload example
{ "published": "2025-11-20T18:30:12.403Z", "draft_name": "draft-QrLqCeSlPaVyKb5", "draft_rev": "78", "rfc_number": 1, "title": "blah blah blah", "authors": [ { "titlepage_name": "string", "is_editor": true, "person": 0, "email": "string", "affiliation": "string", "country": "string" } ], "stream": "string", "group": "tools", "abstract": "string", "pages": 12, "words": 2500, "formal_languages": [ "string" ], "std_level": "string", "ad": 0, "external_url": "string", "obsoletes": [ 0 ], "updates": [ 0 ], "subseries": [ "std9524" ]The
draft_nameanddraft_revfields are optional. If present, the RFC is linked as having been published from that draft. Ifad,group, orformal_languagesare not specified in the API call these are inherited from the draft. Passing null forad/groupor[]forformal_languageswill override the draft values with empty ones if needed. All other fields are expected to be supplied in the API call and are not copied from the draft.upload_rfc_filesAPIThe
upload_rfc_filesAPI differs from our existing API in that it expects multipart/form-data encoding of the request to allow chunked file uploads. The code generator we use to generate the Python client for using the API does not seem to handle nested serialization at all with multipart/form-data and has other limitations on the shape of the API it can handle. This is why the file upload API was split from the metadata / RFC creation API call.Using the generated API client, the upload call looks like
The
rfcparameter is an integer identifying the existing RFC by number. Thecontentsparameter is a list of filenames to be uploaded. Thereplaceoption, which defaults to False, specifies whether files already existing for the RFC should prevent the upload from taking place.The files in
contentsare uploaded along with their original filenames. Only the extensions are significant and these are used to identify the format of each file. Currently, only.xml,.txt,.txt.pdf, and.htmlare allowed, and there can only be up to one of each type. The rest of the filename is discarded and files are named likerfcNNNN.{ext}when put in place.When
replaceis True, any existing files likerfcNNNN.{ext}for any of the allowed extensions will be unlinked before moving uploaded files into place. My hope is that this will not be used in production except in rare cases. It should not be part of the standard publication workflow except maybe during the early deployment when the old sync mechanism may be running.