Skip to content

fix: always build purple client - #1390

Draft
rjsparks wants to merge 1 commit into
ietf-tools:mainfrom
rjsparks:rebuild_purple_client
Draft

fix: always build purple client#1390
rjsparks wants to merge 1 commit into
ietf-tools:mainfrom
rjsparks:rebuild_purple_client

Conversation

@rjsparks

@rjsparks rjsparks commented Jul 9, 2026

Copy link
Copy Markdown
Member

No description provided.

@jennifer-richards jennifer-richards left a comment

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.

Comments (which I've mostly given you offline already) inline.

If this is indeed fixing the issue with startup in the dev container, I suspect it's by preventing the app-init.sh script from bombing out if the sed or /bin/cp commands (lines 50 and 53 in app-init.sh) fail.

@@ -0,0 +1,55 @@
#!/bin/bash

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.

This script is largely redundant with the existing update-rpcapi script. That other script also generates the Python client used to interact with datatracker. Breaking that into separate scripts is not a bad choice, but it should be updated to reduce redundancy if we do that.

The update-rpcapi does handle the situation that a datatracker is not available and will still generate the purple API client even in that case.

Comment on lines +38 to +40
# Sanity check: every operationId in the schema should have a matching method
# in the client (schema is snake_case, client methods are camelCase). This is
# what catches the "... is not a function" class of drift before runtime does.

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.

I don't think this sanity check section is a particularly useful addition at this point. It's just checking that the code generator generated the code it was told to do, and we only reach it if the code generator ran successfully.

Comment on lines +6 to +10
# The generated client is gitignored, so it does NOT survive a container
# rebuild and must be rebuilt from the running code. This is also the recovery
# path whenever the frontend reports "api.<something> is not a function": that
# error means the generated client is out of sync with the backend. Safe to
# re-run any time (e.g. after a rebuild or a branch switch).

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.

I don't think this is accurate if you're mounting the workspace in the dev container. The generated client will be written into your working directory, where it will persist even though it's gitignored. Tearing down the container won't delete it.

The generated client would not be present on a clean checkout, though. The comment would also be true if you're using a workspace entirely inside a docker volume.

@rjsparks
rjsparks marked this pull request as draft July 13, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants