Skip to content

agents: add pipeline reuse, type uniformity, and WORKSPACE parity rules - #4421

Merged
rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:agents_workspace_uv_lock_learnings
Nov 7, 2026
Merged

rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:agents_workspace_uv_lock_learnings

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Agent implementations of WORKSPACE features (such as #4374 vs. #4416)
previously invented parallel repository rules, format converters, and
runtime union-type branches instead of reusing existing pipelines and
canonical data types. This duplicated Bzlmod logic, broke host
portability for vendored requirements.bzl files, and modified
unrelated code.

Codify the design and Starlark rules from #4416 so agents:

  • Trace existing call graphs and extend existing WORKSPACE rules and
    pipelines (parse_requirements -> requirements.bzl.tmpl.workspace
    -> whl_library) at the narrowest seam rather than adding parallel
    rules or format converters.
  • Extract pure helpers needed by both Bzlmod and WORKSPACE into
    standalone Bzlmod-agnostic .bzl files.
  • Preserve host portability in vendored requirements.bzl by emitting
    direct downloader attributes only when a package resolves to a single
    cross-platform distribution, falling back to --hash flags for
    platform-specific wheels.
  • Enforce uniform parameter, return, and collection types across callers
    and test fixtures without runtime union-type branches.
  • Leave working code untouched unless required and decompose multi-stage
    functions into focused helpers.

Agent implementations of WORKSPACE features (such as bazel-contrib#4374 vs. bazel-contrib#4416)
previously invented parallel repository rules, format converters, and
runtime union-type branches instead of reusing existing pipelines and
canonical data types. This duplicated Bzlmod logic, broke host
portability for vendored `requirements.bzl` files, and modified
unrelated code.

Codify the design and Starlark rules from bazel-contrib#4416 so agents:
* Trace existing call graphs and extend existing `WORKSPACE` rules and
  pipelines (`parse_requirements` -> `requirements.bzl.tmpl.workspace`
  -> `whl_library`) at the narrowest seam rather than adding parallel
  rules or format converters.
* Extract pure helpers needed by both Bzlmod and `WORKSPACE` into
  standalone Bzlmod-agnostic `.bzl` files.
* Preserve host portability in vendored `requirements.bzl` by emitting
  direct downloader attributes only when a package resolves to a single
  cross-platform distribution, falling back to `--hash` flags for
  platform-specific wheels.
* Enforce uniform parameter, return, and collection types across callers
  and test fixtures without runtime union-type branches.
* Leave working code untouched unless required and decompose multi-stage
  functions into focused helpers.
@rickeylev

Copy link
Copy Markdown
Collaborator Author

AI Disclosure: This pull request was authored with AI assistance (semi-autonomous — directed and reviewed by @rickeylev).

Handling of PR comments: Review comments and questions on this PR are monitored by @rickeylev, who may respond directly or direct an agent to draft responses and updates under human review before posting.

This is an automatically generated agent comment.

@rickeylev
rickeylev enabled auto-merge November 7, 2026 06:04
@rickeylev
rickeylev merged commit a832b2d into bazel-contrib:main Nov 7, 2026
13 checks passed
@rickeylev
rickeylev deleted the agents_workspace_uv_lock_learnings branch November 7, 2026 07:19
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