Skip to content

Consolidate provider crate versions via workspace inheritance - #256

Open
reyhankoyun wants to merge 3 commits into
mainfrom
consolidate-workspace-version
Open

Consolidate provider crate versions via workspace inheritance#256
reyhankoyun wants to merge 3 commits into
mainfrom
consolidate-workspace-version

Conversation

@reyhankoyun

@reyhankoyun reyhankoyun commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

Why is this change being made?

  1. A version bump previously required editing 4 separate Cargo.toml files, increasing the risk of operator mistakes during a release (forgetting a file or version mismatch).
  2. Even after consolidating to the root Cargo.toml, there are still 4 places to update in that file — someone could bump workspace.package.version but forget the workspace.dependencies entries.

What is changing?

  1. Added [workspace.package] with version to the root Cargo.toml
  2. Added [workspace.dependencies] for internal crate cross-references
  3. Updated aws_workload_credentials_provider, aws_workload_credentials_provider_common, aws_secretsmanager_provider, and aws_certificatemanager_provider to use version.workspace = true
  4. Updated internal path dependencies to use workspace = true references
  5. aws_secretsmanager_caching retains its own independent version
  6. Added cargo-release configuration so that version bumping is a single atomic command:
    cargo release patch --execute   # or minor/major
    This bumps workspace.package.version AND all workspace.dependencies entries, commits, tags, and pushes — eliminating the version-skew risk entirely.
  7. Publishing remains handled by the publish-crates.yml workflow (cargo-release has publish = false).

Related Links

  • Issue #, if available: N/A

Testing

How was this tested?

  1. cargo release patch --workspace --exclude integration-tests --exclude aws_secretsmanager_caching dry-run output:
    Upgrading workspace to version 3.1.2
    Upgrading aws_workload_credentials_provider_common from 3.1.1 to 3.1.2 (inherited from workspace)
     Updating workspace's dependency from 3.1.1 to 3.1.2
    Upgrading aws_certificatemanager_provider from 3.1.1 to 3.1.2 (inherited from workspace)
     Updating workspace's dependency from 3.1.1 to 3.1.2
    Upgrading aws_secretsmanager_provider from 3.1.1 to 3.1.2 (inherited from workspace)
     Updating workspace's dependency from 3.1.1 to 3.1.2
    Upgrading aws_workload_credentials_provider from 3.1.1 to 3.1.2 (inherited from workspace)
    Pushing consolidate-workspace-version, v3.1.2 to origin
    

When testing locally, provide testing artifact(s):

  1. Packaged Cargo.toml for aws_workload_credentials_provider_common confirms workspace inheritance is resolved to the correct version with no path deps in the published artifact
  2. cargo-release dry-run shows atomic bump of all 4 version sites

Reviewee Checklist

Update the checklist after submitting the PR

  • I have reviewed, tested and understand all changes
  • I have filled out the Description and Testing sections above
  • Build and Unit tests are passing
    If not, why: Local rustc (1.93) is older than required (1.94.1) for AWS SDK deps — CI will validate
  • Unit test coverage check is passing
    If not, why: No code logic changed; only Cargo.toml metadata and config
  • Integration tests pass locally
    If not, why: Requires newer rustc; CI will validate
  • I have updated integration tests (if needed)
  • I have ensured no sensitive information is leaking
  • I have added explanatory comments for complex logic, new classes/methods and new tests
  • I have updated README/documentation (if needed)
    If not, why: No user-facing behavior change
  • I have clearly called out breaking changes (if any)

Reviewer Checklist

All reviewers please ensure the following are true before reviewing:

  • Reviewee checklist has been accurately filled out
  • Code changes align with stated purpose in description
  • Test coverage adequately validates the changes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@reyhankoyun
reyhankoyun requested a review from a team as a code owner July 22, 2026 22:14
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.11%. Comparing base (dd80c2b) to head (8fbf181).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #256      +/-   ##
==========================================
- Coverage   86.35%   86.11%   -0.24%     
==========================================
  Files          34       34              
  Lines        9422     9422              
  Branches     9422     9422              
==========================================
- Hits         8136     8114      -22     
- Misses       1153     1175      +22     
  Partials      133      133              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@secrets-manager-ai-code-review

secrets-manager-ai-code-review Bot commented Jul 22, 2026

Copy link
Copy Markdown

Claude finished @reyhankoyun's task in 2m 12s —— View job


PR Review — Consolidate provider crate versions via workspace inheritance

  • Read PR diff and changed files
  • Check for CLAUDE.md guidelines
  • Analyze workspace inheritance correctness
  • Provide review feedback

Verdict: 👍 Solid, low-risk change. The workspace inheritance is set up correctly and the reasoning is sound. A couple of observations below, none blocking.


What's correct

  • [workspace.package].version = "3.1.1" + version.workspace = true in all four provider crates is the right mechanism. Cargo resolves this to a concrete 3.1.1 in the published manifest, so crates.io compatibility is preserved (your dry-run artifact confirms this).
  • Path + version pairs in [workspace.dependencies] are correct: version is used by consumers pulling from crates.io, path is used for local builds. Both are needed.
  • aws_secretsmanager_caching correctly keeps its independent 2.1.0 in both workspace.package... wait — it keeps it in its own [package] (untouched) and is referenced at 2.1.0 in [workspace.dependencies]. Good.
  • The [dev-dependencies] entry aws_secretsmanager_caching = { workspace = true, features = ["test-util"] } is the correct syntax for adding features on top of a workspace dependency. ✅

Observations (non-blocking)

1. Residual version duplication in the root Cargo.toml — see inline comment. 3.1.1 still appears 4× in this single file (workspace.package.version + 3× in workspace.dependencies). Stable Cargo doesn't allow workspace.dependencies to reference workspace.package.version, so this can't be fully deduped — but it means a bump still requires editing 4 lines, and forgetting the workspace.dependencies entries would re-introduce the exact version-skew bug this PR targets (just moved into one file). Consider a short comment or relying on cargo-release/cargo-workspaces to bump atomically.

2. integration-tests/Cargo.toml not migrated for consistency. It still uses a bare path dependency:

aws_certificatemanager_provider = { path = "../aws_certificatemanager_provider" }

Since integration-tests is publish = false, this is harmless and doesn't need a version. But if you want the workspace to be fully uniform, it could become aws_certificatemanager_provider.workspace = true. Purely optional.

3. Removed blank line after [workspace] (resolver = "2" now directly followed by members). Cosmetic only — no effect.

Security / performance

No concerns. This is metadata-only; no code paths, dependencies, or feature flags changed. Codecov delta is unrelated noise (file-count shift), consistent with no logic change.

Testing note

Your reasoning that the compilation failures are due to local rustc 1.93 vs required 1.94.1 is plausible and unrelated to this change — CI will be the source of truth. The cargo publish --dry-run on aws_workload_credentials_provider_common resolving to a concrete version = "3.1.1" with no path/workspace references is exactly the right validation for crates.io compatibility.


Nice cleanup — this meaningfully reduces release footguns even with the residual duplication noted above.

@reyhankoyun reyhankoyun added the safe-to-test Maintainer approval to run integration tests for external contributor PRs. label Jul 22, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer approval to run integration tests for external contributor PRs. label Jul 22, 2026
Comment thread Cargo.toml
Comment on lines +9 to +11
aws_workload_credentials_provider_common = { version = "3.1.1", path = "aws_workload_credentials_provider_common" }
aws_secretsmanager_provider = { version = "3.1.1", path = "aws_secretsmanager_provider" }
aws_certificatemanager_provider = { version = "3.1.1", path = "aws_certificatemanager_provider" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Residual duplication / version-mismatch risk. The three internal provider crates share the same version as [workspace.package] (3.1.1), but here their version is hardcoded again. A future bump now touches 4 places in this one fileworkspace.package.version plus these three — instead of the intended single source of truth.

More importantly, if someone bumps workspace.package.version to e.g. 3.2.0 but forgets these entries, cargo publish will emit a manifest where (say) aws_secretsmanager_provider@3.2.0 depends on aws_workload_credentials_provider_common = "3.1.1" — the exact version-skew class of bug this PR aims to eliminate, just relocated.

Stable Cargo can't reference workspace.package.version from workspace.dependencies, so full deduplication isn't possible here. Two mitigations worth considering:

  • Keep all four in this file (as done) and rely on release tooling (cargo-release / cargo-workspaces) to bump them atomically, or
  • Add a brief comment noting these three must track workspace.package.version.

Not blocking — this is still a net improvement over four separate files.

derik01
derik01 previously approved these changes Jul 22, 2026
i-am-SR
i-am-SR previously approved these changes Jul 22, 2026
@reyhankoyun
reyhankoyun dismissed stale reviews from i-am-SR and derik01 via e9a9440 July 23, 2026 21:00
@secrets-manager-ai-code-review

secrets-manager-ai-code-review Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude finished @reyhankoyun's task in 4m 9s —— View job


PR Review — Consolidate provider crate versions via workspace inheritance

Verdict: 👍 Solid, low-risk change, and this revision addresses the version-duplication concern from the earlier review by adding release.toml files so cargo-release bumps everything atomically. A few things to confirm before relying on the release tooling — none blocking.

  • Read changed files & workspace config
  • Verify workspace inheritance correctness
  • Check release.toml files
  • Post review feedback

What's correct

  • [workspace.package].version = "3.1.1" + version.workspace = true across all four provider crates is the right mechanism — Cargo resolves it to a concrete 3.1.1 in the published manifest, preserving crates.io compatibility.
  • [workspace.dependencies] entries pair version (for crates.io consumers) with path (for local builds); both are needed. The .workspace = true refs in each provider crate are wired correctly.
  • The dev-dependency aws_secretsmanager_caching = { workspace = true, features = ["test-util"] } is the correct syntax for layering features on a workspace dep. ✅
  • aws_secretsmanager_caching correctly retains its independent 2.1.0 (own [package].version, referenced at 2.1.0 in [workspace.dependencies], and shared-version = false in its release.toml).

Response to the prior review's duplication concern

The earlier review flagged that 3.1.1 still appears 4× in the root Cargo.toml and a bump touching only some of them would re-introduce version skew. The new release.toml files are the correct mitigationcargo-release can bump workspace.package.version and rewrite the [workspace.dependencies] version fields in one atomic commit. Two follow-ups (see inline comment):

  1. Please attach a cargo release <ver> --dry-run diff confirming it updates workspace.package.version + all three provider version entries together, and leaves aws_secretsmanager_caching at 2.1.0. Given the crates inherit via version.workspace = true, you may need shared-version = true in the root release.toml for them to bump as one group — the dry run will confirm. This is the artifact that actually proves the skew risk is gone.

  2. Dangling publish-crates.yml reference. The root release.toml comment says publishing is handled by publish-crates.yml, but that workflow isn't in .github/workflows/ (only release.yml/staging.yml, which push binaries to S3, not crates.io). Either the workflow still needs to land, or the comment should be corrected.

Minor / optional

  • integration-tests/Cargo.toml:24 still uses a bare aws_certificatemanager_provider = { path = "../aws_certificatemanager_provider" }. Harmless (publish = false, release = false → no version emitted), but for uniformity it could become aws_certificatemanager_provider = { workspace = true }. Purely cosmetic. (Couldn't attach inline — the line isn't part of this PR's diff.)

Security / performance

No concerns — metadata-only change. No code paths, runtime deps, or feature flags altered. Codecov's file-count delta is unrelated noise.

Testing note

The rustc 1.93 vs 1.94.1 explanation for local build failures is plausible and unrelated to this change; CI is the source of truth. The cargo publish --dry-run resolving to a concrete version = "3.1.1" with no path/workspace refs is exactly the right crates.io validation — the cargo release --dry-run in point 1 above is the complementary check for the release path.


Nice iteration — the release.toml additions turn "duplication moved into one file" into "duplication managed by tooling," which is the outcome the original PR was reaching for.

Comment thread release.toml
tag-message = "chore: release {{version}}"
tag-name = "v{{version}}"
# Publishing is handled by the publish-crates.yml GitHub Actions workflow.
publish = false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This release.toml is the right answer to the version-duplication concern raised in the earlier review — cargo-release can bump [workspace.package].version and rewrite the version fields in [workspace.dependencies] atomically, so the four providers no longer skew apart on a release.

Two things worth confirming before relying on it:

  1. Verify the atomic bump with a dry run. Please run cargo release <next-version> --dry-run and confirm the generated diff updates (a) workspace.package.version, (b) all three provider version entries in [workspace.dependencies], and (c) leaves aws_secretsmanager_caching at its independent 2.1.0. That dry-run output is the real proof this eliminates the skew risk. Since the four providers inherit via version.workspace = true, you may need shared-version = true here for cargo-release to treat them as one version group — the dry run will tell you.

  2. publish = false + missing workflow. The comment on line 6 says publishing is handled by publish-crates.yml, but I don't see that workflow in .github/workflows/ (only release.yml/staging.yml, which upload binaries to S3 — not crates.io). If crates.io publishing is intended, that workflow still needs to land; otherwise the comment is misleading. Not blocking this PR, just flagging the dangling reference.

Reduces the number of files that need updating during a version bump
from 4 separate Cargo.toml files to a single root Cargo.toml.
@reyhankoyun
reyhankoyun force-pushed the consolidate-workspace-version branch from e9a9440 to 3adfdea Compare July 23, 2026 21:49
@secrets-manager-ai-code-review

secrets-manager-ai-code-review Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude finished @reyhankoyun's task in 2m 54s —— View job


PR Review — Consolidate provider crate versions via workspace inheritance

  • Read PR diff and changed files
  • Check CLAUDE.md guidelines (none present in repo)
  • Analyze workspace inheritance & release.toml correctness
  • Post review feedback

Verdict: 👍 Solid, low-risk, metadata-only change. Workspace inheritance is wired correctly and this revision closes the biggest gap from the earlier reviews — publish-crates.yml now exists in .github/workflows/, so the "dangling reference" concern is resolved. Two small config nits below, neither blocking.


What's correct

  • [workspace.package].version = "3.1.1" + version.workspace = true across all four provider crates is the right mechanism — Cargo resolves it to a concrete 3.1.1 in the published manifest, preserving crates.io compatibility.
  • [workspace.dependencies] entries pair version (crates.io consumers) with path (local builds); both needed. The .workspace = true refs in each provider crate are correct, including the dev-dep aws_secretsmanager_caching = { workspace = true, features = ["test-util"] } syntax.
  • aws_secretsmanager_caching correctly keeps its independent 2.1.0 (own [package].version, referenced at 2.1.0 in [workspace.dependencies]).
  • integration-tests/release.toml with release = false is the right way to exclude it from cargo-release, and it matches the publish list in publish-crates.yml (which also omits it).
  • Prior review's concern Fix documentation for caching and Cargo manifests, add doctests #2 is resolved: publish-crates.yml is present, publishes in topological order, and skips already-published versions via a crates.io HTTP check. The release.toml comment pointing to it is now accurate.

Observations (non-blocking)

1. shared-version grouping is implied but never enabledinline comment. aws_secretsmanager_caching/release.toml sets shared-version = false, which only carries meaning if the four providers are opted into a shared group — but the root release.toml never sets shared-version = true (cargo-release defaults to false). In practice the providers can't skew since they all inherit the single [workspace.package].version, but adding shared-version = true explicitly encodes the intent and makes the caching opt-out meaningful.

2. Dry-run artifact + allow-branchinline comment. The prior reviews asked for a cargo release <ver> --dry-run diff proving all four version sites bump atomically while caching stays at 2.1.0. That's still the artifact that closes the loop. Note the new allow-branch = ["main"] would refuse the dry-run output shown in the PR description (it ran on this feature branch), so a fresh run (post-merge or --allow-branch) is what validates the current config.

Security / performance

No concerns — metadata-only. No code paths, runtime deps, or feature flags changed. Codecov's file-count delta is unrelated noise.


Nice iteration. The version-skew risk is now managed by tooling rather than operator discipline, and the missing publish workflow that earlier reviews flagged has landed. Adding shared-version = true + attaching a fresh dry-run diff would fully button this up.

Comment thread release.toml
tag-message = "chore: release {{version}}"
tag-name = "v{{version}}"
# Publishing is handled by the publish-crates.yml GitHub Actions workflow.
publish = false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

shared-version grouping is implied but never enabled here. aws_secretsmanager_caching/release.toml explicitly opts out with shared-version = false — which only makes sense if the four provider crates are opted in to a shared group. But this root release.toml never sets shared-version = true, and cargo-release's default is false.

Practically the four providers can't diverge (they all resolve to the single [workspace.package].version via version.workspace = true), but without shared-version = true cargo-release treats each package as its own release unit rather than one atomic group, and aws_secretsmanager_caching's shared-version = false is a no-op override of a default that's already false.

I'd add it explicitly so the intent is encoded and the caching opt-out is meaningful:

Suggested change
publish = false
allow-branch = ["main"]
consolidate-commits = true
shared-version = true
pre-release-commit-message = "chore: release {{version}}"
tag-message = "chore: release {{version}}"
tag-name = "v{{version}}"
# Publishing is handled by the publish-crates.yml GitHub Actions workflow.
publish = false

The cargo release <ver> --dry-run diff (requested in the prior review) is the artifact that confirms which behavior you actually get.

Comment thread release.toml
@@ -0,0 +1,7 @@
allow-branch = ["main"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note that allow-branch = ["main"] means the dry-run shown in the PR description (which ran on consolidate-workspace-version and printed Pushing consolidate-workspace-version, v3.1.2 to origin) would now be refused on this feature branch. That's the correct safety posture for real releases — just flagging that the description's dry-run output predates this constraint, so a fresh dry-run (post-merge or with --allow-branch) is what actually validates the config as it stands.

Configures cargo-release so that bumping the provider version is a
single command (e.g. `cargo release patch --execute`) that atomically
updates workspace.package.version and all workspace.dependencies
entries, commits, tags, and pushes.

Publishing is disabled here since it is handled by the
publish-crates.yml workflow.
@reyhankoyun
reyhankoyun force-pushed the consolidate-workspace-version branch from 3adfdea to 0dca2c5 Compare July 23, 2026 22:12
@secrets-manager-ai-code-review

secrets-manager-ai-code-review Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR Review — Consolidate provider crate versions via workspace inheritance

  • Read PR diff & changed files
  • Verify workspace inheritance correctness
  • Verify release.toml config (shared-version, allow-branch)
  • Verify publish-crates.yml alignment
  • Post review feedback

View job run

@reyhankoyun reyhankoyun added the safe-to-test Maintainer approval to run integration tests for external contributor PRs. label Jul 23, 2026
@secrets-manager-ai-code-review

secrets-manager-ai-code-review Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude finished @reyhankoyun's task in 1m 24s —— View job


PR Review — Consolidate provider crate versions via workspace inheritance

Verdict: 👍 Approve-worthy. Metadata/config-only change, wired correctly, and this revision closes every actionable item from the earlier review rounds. Two small non-blocking notes below.

  • Read PR diff & changed files
  • Verify workspace inheritance correctness
  • Verify release.toml config (shared-version, allow-branch)
  • Verify publish-crates.yml alignment
  • Post review feedback

What's correct

  • Workspace inheritance: [workspace.package].version = "3.1.1" + version.workspace = true across all four provider crates is the right mechanism. Cargo resolves it to a concrete 3.1.1 in the published manifest, preserving crates.io compatibility.
  • [workspace.dependencies]: each internal ref pairs version (for crates.io consumers) with path (for local builds) — both needed. The .workspace = true refs in each provider crate are wired correctly, including the dev-dep aws_secretsmanager_caching = { workspace = true, features = ["test-util"] } layering syntax.
  • aws_secretsmanager_caching correctly keeps its independent 2.1.0 — own [package].version, referenced at 2.1.0 in [workspace.dependencies], and shared-version = false in its own release.toml.

Prior review concerns — all resolved ✅

  1. Version duplication / skew risk → the root release.toml now sets shared-version = true (release.toml:2), so cargo-release treats the four providers as one atomic version group and rewrites workspace.package.version + the [workspace.dependencies] version fields together. The aws_secretsmanager_caching shared-version = false opt-out is now meaningful. This is the exact fix the earlier rounds asked for.
  2. Dangling publish-crates.yml reference → the workflow now exists at .github/workflows/publish-crates.yml, publishes in topological order, and skips already-published versions via a crates.io HTTP check. The release.toml:7 comment is now accurate.
  3. allow-branch = ["main"] is present — correct safety posture for real releases.

Observations (non-blocking)

1. publish-crates.yml has no automatic trigger. It only fires on workflow_dispatch / workflow_call, and no other workflow (release.yml, staging.yml) currently uses: it. That's fine if crates.io publishing is intended to be manual for now, but nothing in the repo invokes it — worth a follow-up if you want it chained off tag pushes / releases.

2. Dry-run artifact still open. The prior reviews asked for a fresh cargo release <ver> --dry-run diff proving all four version sites bump together while aws_secretsmanager_caching stays at 2.1.0. The PR-description dry-run predates allow-branch = ["main"] (it ran on this feature branch and would now be refused), so a post-merge run or --allow-branch consolidate-workspace-version run is what actually validates the config as it stands. Not required to merge — the config reads correctly — but it's the artifact that fully closes the loop.

3. integration-tests/Cargo.toml:24 still uses a bare aws_certificatemanager_provider = { path = "../aws_certificatemanager_provider" }. Harmless (publish = false, release = false → no version emitted). Purely cosmetic if you want full workspace uniformity.

Security / performance

No concerns — metadata-only. No code paths, runtime deps, or feature flags changed. Codecov's file-count delta is unrelated noise.


Clean iteration. The version-skew risk is now managed by tooling (shared-version = true) rather than operator discipline, and the publish workflow the earlier rounds flagged has landed. Nothing here blocks merge.

@github-actions github-actions Bot removed the safe-to-test Maintainer approval to run integration tests for external contributor PRs. label Jul 23, 2026
@derik01

derik01 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Can you explain:

Added cargo-release configuration so that version bumping is a single atomic command:

My understanding is that Simon added a workflow that will automate this for us

@reyhankoyun

Copy link
Copy Markdown
Contributor Author

Can you explain:

Added cargo-release configuration so that version bumping is a single atomic command:

My understanding is that Simon added a workflow that will automate this for us

cargo-release and publish-crates.yml are complementary as cargo-release handles the version bump and publish-crates.yml handles crates.io publishing in topological order, skipping already-published versions.

The workflow automates what happens after the version bump, but doesn't help with the bump itself. Without cargo-release, you'd still need to manually edit 4 version entries in the root Cargo.toml, which is the version-skew risk this PR eliminates.

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.

3 participants