fix: detect missing proto outputs in iris hatch build hook#3710
Merged
fix: detect missing proto outputs in iris hatch build hook#3710
Conversation
The build hook only compared timestamps to decide if regeneration was needed, so adding a new .proto file (query.proto in #3649) without regenerating left query_pb2.py missing — breaking all local iris CLI usage. Add _has_missing_outputs() to check that every .proto has its _pb2.py counterpart. Use it as the single canonical completeness check in _maybe_generate_protos, and keep _needs_rebuild as a pure timestamp comparator. Fallback paths (missing npx/generate script) now raise instead of silently continuing with incomplete outputs. Also add the missing query_pb2 import to rpc/__init__.py (required by the descriptor pool load order since cluster.proto imports query.proto). Fixes #3709 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fb36a4a to
44cb4a3
Compare
rjpower
approved these changes
Mar 16, 2026
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 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
query.proto(iris: add generic query API to controller #3649) without a matchingquery_pb2.pybroke all localirisCLI usage withImportError: cannot import name 'query_pb2'._has_missing_outputs()to detect.protofiles without a corresponding_pb2.py, and use it in the rebuild decision and fallback paths (missingnpx/generate script) so they raise instead of silently continuing with incomplete outputs.query_pb2import torpc/__init__.py(descriptor pool load order requires it beforecluster_pb2).Fixes #3709
Test plan
ImportErroron main, confirmed fix resolves ituv run iris --helploads cleanly after fix_has_missing_outputscorrectly returnsTruewhen a_pb2.pyis absent andFalsewhen all are present🤖 Generated with Claude Code