Skip to content

fix(ci): collect worker functions via worker_name on iii 0.17 - #220

Merged
sergiofilhowz merged 1 commit into
mainfrom
fix/pipeline-2
Jun 2, 2026
Merged

fix(ci): collect worker functions via worker_name on iii 0.17#220
sergiofilhowz merged 1 commit into
mainfrom
fix/pipeline-2

Conversation

@sergiofilhowz

@sergiofilhowz sergiofilhowz commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix harness (and all bundle) registry publish failing with no worker functions in worker-interface.json (empty) after upgrading the publish pipeline to iii v0.17.
  • iii 0.17 no longer lists function ids on engine::workers::list entries; each function in engine::functions::list now carries worker_name instead. Update normalization to resolve functions from that field.
  • Snapshot workers-baseline.json before starting the local worker so composite bundles (harness registers 14 logical workers) publish the full bus surface, not just the worker named harness.
  • Wait for target functions to appear before writing the interface payload, rather than returning as soon as a worker connection is visible.

Fixes the failed harness v0.5.3 publish job: https://github.com/iii-hq/workers/actions/runs/26853219158/job/79190173064

Test plan

  • python3 -m pytest .github/scripts/tests/ -q (89 passed)
  • Local e2e against harness v0.5.3 bundle: collects 78 functions and passes --assert-non-empty
  • Re-run harness release publish after merge (or re-tag) to confirm registry POST succeeds

Summary by CodeRabbit

  • Improvements

    • Enhanced worker interface collection and publishing process with baseline snapshot support for improved consistency and reliability.
    • Refined worker matching logic to better handle baseline worker definitions during the publish workflow.
  • Tests

    • Added comprehensive test coverage for worker interface normalization.

The engine no longer exposes function ids on engine::workers::list entries;
functions are tagged with worker_name instead. Snapshot a workers baseline
before interface collection so composite bundles like harness publish every
sub-worker's bus surface, and wait until those functions exist before asserting.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jun 2, 2026 11:11pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds baseline-aware worker and function resolution to the publish payload pipeline. It introduces helper functions to extract worker identity, resolve target workers from an optional baseline snapshot, and derive function IDs. The core functions normalize_worker_interface and wait_for_worker are updated to use the new baseline logic, and CLI/workflow support is added to capture and pass the baseline throughout the pipeline.

Changes

Baseline-Aware Worker and Function Resolution

Layer / File(s) Summary
Helper functions for worker identity and function resolution
.github/scripts/build_publish_payload.py
Adds _worker_identity to extract a worker's identity from name or id, _baseline_identity_set to build a baseline identity set, _resolve_target_worker_names to determine which workers should contribute functions (including baseline filtering), and _function_ids_for_workers to return ordered, de-duplicated function IDs for resolved workers.
normalize_worker_interface baseline-aware integration
.github/scripts/build_publish_payload.py
Updates normalize_worker_interface signature to accept optional baseline_workers_json, uses new resolution helpers to determine target workers, derives worker_function_ids from those workers, and falls back to the worker's functions list only if resolution yields no IDs.
Baseline-aware worker and function polling
.github/scripts/collect_worker_interface.py
Replaces wait_for_worker to fetch both engine::workers::list and engine::functions::list together, resolve target worker names via baseline-seeded _resolve_target_worker_names, check readiness via _function_ids_for_workers, and return (workers_json, functions_json) tuple. Removes count_worker_matches helper and eliminates the separate post-wait functions collection call.
CLI option and baseline parsing
.github/scripts/collect_worker_interface.py
Adds --workers-baseline CLI option to accept a baseline workers JSON snapshot, parses the file, and passes workers_baseline_json to both wait_for_worker (for polling) and normalize_worker_interface (for resolution).
Unit tests for normalize_worker_interface
.github/scripts/tests/test_normalize_worker_interface.py
New test module with two cases: one verifies function collection for a requested worker when baseline workers are provided, another verifies a single worker without baseline produces an interface entry with name, description, and default empty schemas.
Workflow baseline snapshot and orchestration
.github/workflows/_publish-registry.yml
Adds "Snapshot engine workers baseline" step to capture engine::workers::list to workers-baseline.json, and extends interface-collection invocation to pass the baseline via --workers-baseline argument.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • iii-hq/workers#67: Both PRs modify collect_worker_interface.py and build_publish_payload.py around wait_for_worker/normalize_worker_interface to determine which worker and function details get included in the publish interface payload.

Suggested reviewers

  • andersonleal

Poem

🐰 A baseline hop through worker lands,
With functions matched by careful hands,
Poll and resolve with baseline sight,
The workers' truth now burning bright! 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: collecting worker functions via worker_name on iii 0.17, which directly addresses the core objective of fixing the registry publish by adapting to the API changes in the new version.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pipeline-2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 14 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

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.

1 participant