Skip to content

iris: include proto files in bundles, remove dashboard from build hook#3654

Merged
rjpower merged 8 commits intomainfrom
fix/iris-bundle-include-proto
Mar 14, 2026
Merged

iris: include proto files in bundles, remove dashboard from build hook#3654
rjpower merged 8 commits intomainfrom
fix/iris-bundle-include-proto

Conversation

@rjpower
Copy link
Copy Markdown
Collaborator

@rjpower rjpower commented Mar 14, 2026

  • Bundle fix: Generated protobuf files (_pb2.py, _pb2.pyi, _connect.py) are gitignored but required at runtime. The bundle creator now includes them alongside git-tracked files so task containers skip proto regeneration during uv sync.
  • Dashboard removal from hatch hook: uv sync no longer triggers npm ci + Vue build. Dashboard is built via iris build dashboard CLI or _ensure_dashboard_dist() in Docker image builds. Added a session-scoped e2e test fixture to build dashboard once if dist/ is missing.

rjpower added 2 commits March 13, 2026 20:11
The bundle creator uses `git ls-files` which respects .gitignore,
excluding generated protobuf files (_pb2.py, _pb2.pyi, _connect.py).
When tasks run `uv sync` in containers, the hatch build hook tries to
regenerate them via npx, which is slow and unreliable with many
concurrent tasks.

Include generated build artifacts that exist on disk alongside
git-tracked files so the build hook sees up-to-date outputs and skips
regeneration.
Dashboard assets are built separately via `iris build dashboard` or
`_ensure_dashboard_dist()` in the Docker image pipeline. Having it in
the hatch hook meant `uv sync` could trigger a full npm ci + Vue build,
surprising developers who only changed Python code.

Adds a session-scoped fixture in e2e conftest to build the dashboard
once before tests run if dist/ is missing.
@rjpower rjpower added the agent-generated Created by automation/agent label Mar 14, 2026
@rjpower rjpower requested a review from ravwojdyla March 14, 2026 03:14
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 14, 2026

Claude finished @rjpower's task in 53s —— View job


PR Review: iris: include proto files in bundles, remove dashboard from build hook

This PR (1) includes gitignored protobuf generated files in task bundles so containers don't need to regenerate them, and (2) removes the dashboard build from the hatch build hook, deferring it to the CLI or Docker pipeline. Both changes match the stated objectives.

No specification check needed — the PR is under 500 lines and the description is clear.

Findings:

  • Duplicate glob patterns in _GENERATED_ARTIFACT_GLOBS (bundle.py:77-84): The list includes both src/iris/rpc/*_pb2.py and lib/iris/src/iris/rpc/*_pb2.py prefixes. The bundle workspace is typically the iris package root (lib/iris), so only the src/iris/rpc/... patterns should match. The lib/iris/... patterns would only match if the workspace is the repo root. This isn't a bug (they just won't match), but it's dead code that could mislead future readers about expected workspace roots. Low priority.

  • _include_generated_build_artifacts skipped when git is unavailable (bundle.py:122-123): The function is only called when git_files is not None. When git isn't available, the fallback rglob("*") path is used, which already walks all files on disk — so generated files are naturally included. This is correct behavior.

  • Test correctly validates the integration (test_bundle.py:51-72): The test mocks _get_git_non_ignored_files and verifies proto files are added. The test creates files under src/iris/rpc/ matching the first set of glob patterns, which is the expected workspace layout.

  • E2E conftest dashboard fixture (conftest.py:50-63): Session-scoped autouse fixture silently passes when npm is missing — appropriate for CI environments without Node.js. check=True on the subprocess calls ensures build failures are surfaced.

No bugs or correctness issues found. The PR is clean and well-scoped.

Comment thread lib/iris/tests/e2e/conftest.py Outdated
"""Build dashboard assets once per session so dashboard tests have content to render."""
dashboard_dir = IRIS_ROOT / "dashboard"
dist_dir = dashboard_dir / "dist"
if dist_dir.exists() and any(dist_dir.iterdir()):
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix this, always run the ci to build, we might be out of date

@rjpower
Copy link
Copy Markdown
Collaborator Author

rjpower commented Mar 14, 2026

@claude fix issues from pr review

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 14, 2026

Claude finished @rjpower's task in 1m 47s —— View job


Fix: always rebuild dashboard in e2e fixture

  • Read conftest.py and understand the review comment
  • Fix: always run npm ci + build (remove early return when dist/ exists)
  • Run pre-commit and tests
  • Commit and push

Change: Removed the dist_dir.exists() early-return guard in _ensure_dashboard_built() (line 55). The fixture now always runs npm ci + npm run build so tests never run against stale dashboard assets.

Testing: Pre-commit passed ✅ | test_bundle.py — 4/4 passed ✅
·

github-actions bot and others added 2 commits March 14, 2026 03:19
Remove the early return when dist/ already exists so that the dashboard
is always rebuilt, ensuring tests never run against stale assets.

Co-authored-by: Russell Power <rjpower@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Zip extraction can produce files with slightly different sub-second
timestamps. The strict `source > output` mtime check then triggers
unnecessary proto regeneration in task containers, which hits BSR
rate limits when many tasks run concurrently. A 60-second tolerance
prevents this while still catching real edits to .proto files.
Comment thread lib/iris/hatch_build.py
source_newest = _newest_mtime(root, source_globs)
output_oldest = _oldest_mtime(root, output_globs)
return source_newest > output_oldest
return source_newest > output_oldest + 60.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github-actions bot and others added 3 commits March 13, 2026 20:53
> *Seed scattered wide—*
> *bare catches swallow the bugs,*
> *narrowed, light breaks through.*


- **`file.py`**: Replaced two bare `except Exception:` blocks with
`except OSError:` in `FileQueue.pop()` and
`FileQueue._recover_expired_leases()`. The broad catches silently
swallowed programming errors (TypeError, ValueError, etc.) that should
propagate—only filesystem errors (OSError and subclasses like
FileNotFoundError) are expected here.
- **`http.py`**: Moved `import socket` from inside `get_client_host()`
to module level. It's a stdlib import, not an optional dependency guard,
so it belongs at the top per coding standards §1.1.

Both issues are explicitly flagged as deprecated patterns in
`docs/dev-guide/coding-standards.md` §8.2.
The controller restores from checkpoints in remote_state_dir, which
can contain stale bundle IDs and job state from a previous run that
was killed mid-test. Wipe the remote state dir before starting a fresh
controller so tests always start clean.
The test used 900 CPU cores which only works with local mode's virtual
1000-core workers. Cloud TPU VMs have 128 cores, so the job never
schedules and the test times out. Use 8 cores in cloud mode.
@rjpower
Copy link
Copy Markdown
Collaborator Author

rjpower commented Mar 14, 2026

okay enough hacks added, should be fixed now. i now regret trying to be fancy, will never try to be fancy again

py-spy and memray are installed into .venv/bin/ via uv pip install,
but shutil.which() couldn't find them because .venv/bin wasn't on
PATH. The CMD already used .venv/bin/python explicitly, but profiling
tools need to be discoverable via PATH too.
@rjpower rjpower enabled auto-merge (squash) March 14, 2026 04:18
@rjpower rjpower disabled auto-merge March 14, 2026 04:18
@rjpower rjpower merged commit d0df187 into main Mar 14, 2026
17 of 18 checks passed
@rjpower rjpower deleted the fix/iris-bundle-include-proto branch March 14, 2026 04:18
@ravwojdyla
Copy link
Copy Markdown
Contributor

okay enough hacks added, should be fixed now. i now regret trying to be fancy, will never try to be fancy again

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.

2 participants