Skip to content

fix: detect missing proto outputs in iris hatch build hook#3710

Merged
yonromai merged 1 commit intomainfrom
romain/fix-iris-query-pb2
Mar 16, 2026
Merged

fix: detect missing proto outputs in iris hatch build hook#3710
yonromai merged 1 commit intomainfrom
romain/fix-iris-query-pb2

Conversation

@yonromai
Copy link
Copy Markdown
Contributor

Summary

  • The hatch build hook only compared timestamps to decide if proto regeneration was needed. Adding query.proto (iris: add generic query API to controller #3649) without a matching query_pb2.py broke all local iris CLI usage with ImportError: cannot import name 'query_pb2'.
  • Add _has_missing_outputs() to detect .proto files without a corresponding _pb2.py, and use it in the rebuild decision and fallback paths (missing npx/generate script) so they raise instead of silently continuing with incomplete outputs.
  • Add the missing query_pb2 import to rpc/__init__.py (descriptor pool load order requires it before cluster_pb2).

Fixes #3709

Test plan

  • Reproduced ImportError on main, confirmed fix resolves it
  • Verified uv run iris --help loads cleanly after fix
  • Verified _has_missing_outputs correctly returns True when a _pb2.py is absent and False when all are present
  • Pre-commit passes on changed files

🤖 Generated with Claude Code

@yonromai yonromai added the agent-generated Created by automation/agent label Mar 16, 2026
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>
@yonromai yonromai force-pushed the romain/fix-iris-query-pb2 branch from fb36a4a to 44cb4a3 Compare March 16, 2026 00:10
@yonromai yonromai marked this pull request as ready for review March 16, 2026 00:11
@yonromai yonromai requested a review from rjpower March 16, 2026 00:11
@yonromai yonromai merged commit 4458828 into main Mar 16, 2026
20 checks passed
@yonromai yonromai deleted the romain/fix-iris-query-pb2 branch March 16, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-generated Created by automation/agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iris CLI broken locally after #3649: missing query_pb2

2 participants