Skip to content

build: exclude standalone root crates from the workspace#1205

Open
chaodu-agent wants to merge 1 commit into
mainfrom
fix/openab-agent-workspace-exclude
Open

build: exclude standalone root crates from the workspace#1205
chaodu-agent wants to merge 1 commit into
mainfrom
fix/openab-agent-workspace-exclude

Conversation

@chaodu-agent

Copy link
Copy Markdown
Collaborator

Summary

Fixes the long-standing CI openab-agent failure (present since at least v0.9.0-beta.2). On the release-tag checkout, the job's first step cargo fmt --check (run from openab-agent/) dies in ~18s with:

`cargo metadata` exited with an error: error: current package believes it's in a workspace when it's not:
current:   .../openab-agent/Cargo.toml
workspace: .../Cargo.toml

The repo root has four standalone crates — openab-agent, agy-acp, openab-auth-proxy, operator — that are neither workspace members nor excluded. cargo therefore refuses to operate inside them. (Regular PRs happened to pass, but the release-tag checkout reliably hits it.)

Fix

Add the standalone root crates to [workspace].exclude. Each has its own Cargo.lock and dedicated CI, so they are intentionally not part of the root workspace. This is the cargo-recommended resolution and prevents the same latent failure for the sibling crates too.

Verification

Reproduced before/after locally (replicating the CI step):

# BEFORE (no exclude): cd openab-agent && cargo fmt --check
`cargo metadata` exited with an error: current package believes it's in a workspace when it's not  → exit 1
# AFTER (with exclude):
cargo fmt --check  → exit 0

Root workspace still resolves: cargo metadata --no-deps OK. The crate itself is healthy (clippy/test pass on normal PRs).

cargo errors with 'current package believes it's in a workspace when it's
not' when tooling runs inside a repo-root crate (openab-agent, agy-acp,
openab-auth-proxy, operator) that is neither a workspace member nor excluded.
This breaks the CI openab-agent job's 'cargo fmt --check' step on the release
tag checkout (fails in ~18s before any real checks run).

Add these standalone crates to [workspace].exclude. Each has its own
Cargo.lock and dedicated CI, so they are intentionally not workspace members.
@chaodu-agent

This comment has been minimized.

1 similar comment
@chaodu-agent

This comment has been minimized.

@chaodu-agent

This comment has been minimized.

@chaodu-agent

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Caution

This PR has been waiting on the author for more than 2 days (labeled pending-contributor since 2026-07-11).
It will be automatically closed in 24 hours if there is no update.

@chaodu-agent — You must add a new comment on this PR to remove the closing-soon label and keep it open. Pushing commits alone is not sufficient. Feel free to reopen a new PR later if it gets closed and you want to pick it back up.

@chaodu-agent

chaodu-agent commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

CHANGES REQUESTED ⚠️ — Close this stale PR and replace it with a focused, self-contained openab-auth-proxy workspace fix.

Important

The original diagnosis was valid, but the branch is now superseded by changes on main. GitHub reports it as CONFLICTING / DIRTY, and only one of its four proposed exclusions still has net-new value.

What This PR Does

This PR adds agy-acp, openab-agent, openab-auth-proxy, and operator to the root [workspace].exclude list so Cargo tooling can run from those standalone crate directories.

How It Works

Cargo searches parent directories for a workspace. A nested package must either belong to that workspace, be excluded by the parent, or define its own [workspace]. The PR chooses the parent exclude mechanism, which was correct against its original base.

Findings

# Severity Finding Location
1 🟡 The branch is 183 commits behind main and conflicts on workspace.exclude; it cannot merge as-is and must not lose the newer crates/platform-schema exclusion. Cargo.toml:6
2 🟡 Three of four proposed exclusions are now redundant. openab-agent is already excluded; agy-acp and operator now define their own [workspace]. Only openab-auth-proxy remains uncovered. Cargo.toml:6
3 🟡 The PR description says every standalone crate has its own Cargo.lock, but openab-auth-proxy/Cargo.lock is absent from the merge base, PR head, and current main. PR description
4 🟡 The historical green checks do not exercise the remaining net-new case: this PR changes the root manifest, while auth-proxy CI triggers only for openab-auth-proxy/**. .github/workflows/ci-auth-proxy.yml:4-9
5 🟢 The original Cargo workspace diagnosis and use of an explicit workspace boundary are sound. Cargo.toml:3-6
Finding Details

🟡 F1: The branch is stale and unmergeable

The merge base is 554f394 (v0.9.0-beta.3); current main is 4205310 (v0.9.0-beta.10). Both sides changed the same exclude line, and a three-way merge produces a conflict. Current main must retain:

exclude = ["openab-agent", "crates/platform-schema"]

🟡 F2: Replace the superseded four-crate change with one local fix

Current state:

Crate Current boundary Net-new work needed
openab-agent Excluded by root workspace None
agy-acp Declares its own [workspace] None
operator Declares its own [workspace] None
openab-auth-proxy Neither excluded nor self-contained Yes

Rather than reviving this stale branch, open a current, focused PR that adds an empty workspace table to openab-auth-proxy/Cargo.toml:

[workspace]

Cargo's official workspace documentation confirms that adding [workspace] to a manifest that already defines [package] makes that package the workspace root package. This is self-contained and matches the established agy-acp / operator pattern.

🟡 F3: Correct the lockfile claim

openab-auth-proxy/Cargo.lock does not exist in the original merge base, this PR, or current main. A replacement PR should avoid claiming that every standalone crate already has a committed lockfile and should decide explicitly whether this application crate should commit one.

🟡 F4: Validate the replacement where the behavior lives

Because a replacement PR would modify openab-auth-proxy/Cargo.toml, its dedicated workflow will trigger naturally. Validate at minimum:

cargo metadata --no-deps --format-version 1
cargo check
cargo clippy -- -D warnings
cargo test
cargo build --release

🟢 F5: The original mechanism was reasonable

The PR correctly identified Cargo's parent-workspace discovery behavior, documented the intended boundary, and introduced no runtime code changes.

Reviewer Synthesis

Reviewer Focus Outcome
Reviewer A Cargo specification Confirmed only openab-auth-proxy remains net-new
Reviewer B Correctness Recommended closing this stale branch and opening a focused replacement
Reviewer C Security / CI Preferred a self-contained [workspace] in the auth-proxy manifest
Reviewer D Docs / UX Flagged stale scope, stale CI wording, and preservation of crates/platform-schema
Reviewer E Infrastructure Confirmed the branch is dirty and the local workspace pattern matches sibling crates
Baseline Check
  • PR opened: 2026-06-26
  • Original merge base: 554f394 (v0.9.0-beta.3)
  • Current main: 4205310 (v0.9.0-beta.10)
  • Main already has: root exclusions for openab-agent and crates/platform-schema; local [workspace] declarations in agy-acp and operator
  • Net-new value: establish a workspace boundary for openab-auth-proxy
  • Current merge state: CONFLICTING / DIRTY; labels include needs-rebase and pending-contributor

Addressing External Reviewer Feedback

@github-actions

This PR has been waiting on the author and is labeled pending-contributor / closing-soon.

Accepted: the branch should be closed rather than kept alive. The remaining issue should move to a fresh, focused PR based on current main.

5️⃣ Three Reasons We Might Not Need This PR

  1. Its primary fix already landed elsewhereopenab-agent, the original failure, is already isolated on main.
  2. Half of its remaining scope self-resolvedagy-acp and operator now establish their own workspace roots.
  3. A replacement is clearer and safer — one local [workspace] declaration in openab-auth-proxy avoids reviving a branch 183 commits behind main.
What's Good (🟢)
  • Correct original root-cause analysis
  • Minimal build-configuration-only design
  • Clear explanatory comment
  • No runtime or dependency changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closing-soon PR missing Discord Discussion URL — will auto-close in 24 hours. needs-rebase pending-contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant