Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Unreleased
## 4.18.0

- The default `msrv-1-86` feature retains the existing compiler-compatibility
dependency pin. Modern hosts can disable it to compose the SDK with native
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "durable-workflow"
version = "4.17.0"
version = "4.18.0"
edition = "2021"
description = "Rust client and worker SDK for Durable Workflow Cloud and self-hosted Server"
license = "MIT"
Expand All @@ -14,7 +14,7 @@ categories = ["api-bindings", "asynchronous"]
include = ["/src/**", "/schema/**", "/examples/**", "/Cargo.toml", "/README.md", "/CHANGELOG.md", "/LICENSE", "/tests/fixtures/replay-regressions/published-php-complete-explicit-backoff.json", "/tests/fixtures/sdk-metrics-contract.json", "/tests/fixtures/workflow-task-completion-limits-v1-vectors.json", "/tests/fixtures/auth-configuration/static-credentials-v1.json"]

[package.metadata.durable-workflow]
product-train = "4.17.0"
product-train = "4.18.0"
compatibility-authority = "protocol-manifests"
supported-server-versions = "2.0.0"
supported-server-release-baselines = { "2" = "2.0.0", "3" = "3.0.2" }
Expand Down
27 changes: 23 additions & 4 deletions scripts/ci/check-dependency-advisories.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
# with this source in lock files for both the git and sparse index protocols.
CRATES_IO = "registry+https://github.com/rust-lang/crates.io-index"
OSV = "https://api.osv.dev/v1/querybatch"
# Reviewed exceptions: (crate, advisory ID) -> reason. Each entry must be
# informational with no patched release, and must name the issue that removes it.
# Matching hits are reported as warnings; any other advisory still fails.
ACCEPTED = {
("chrono", "RUSTSEC-2026-0543"): "informational unmaintained notice with no patched release; replacement tracked in #283",
}
BATCH = 500

Package = tuple[str, str]
Expand Down Expand Up @@ -107,8 +113,11 @@ def post_osv(body: dict) -> object:
return json.load(response)


def check(locks: dict[str, str], post: Post) -> list[str]:
"""Return one failure line per affected package or unusable lock."""
def check(locks: dict[str, str], post: Post, warnings: list[str] | None = None) -> list[str]:
"""Return one failure line per affected package or unusable lock.

Advisories listed in ACCEPTED for that exact crate are appended to warnings instead.
"""
failures = []
for path, text in locks.items():
try:
Expand All @@ -117,7 +126,14 @@ def check(locks: dict[str, str], post: Post) -> list[str]:
failures.append(f"{path}: {error}")
continue
for (name, version), ids in sorted(affected.items()):
failures.append(f"{path}: {name} {version} is affected by {', '.join(ids)}")
accepted = [i for i in ids if (name, i) in ACCEPTED]
remaining = [i for i in ids if (name, i) not in ACCEPTED]
if remaining:
failures.append(f"{path}: {name} {version} is affected by {', '.join(remaining)}")
if accepted and warnings is not None:
warnings.extend(
f"{path}: {name} {version} has accepted {i} ({ACCEPTED[(name, i)]})" for i in accepted
)
return failures


Expand All @@ -128,7 +144,10 @@ def main() -> int:

locks = {path: (ROOT / path).read_text() for path in arguments.locks}
# HTTP and OSV response errors propagate and fail the job.
failures = check(locks, post_osv)
warnings: list[str] = []
failures = check(locks, post_osv, warnings)
for warning in warnings:
print(f"::warning::{warning}")
for failure in failures:
print(f"::error::{failure}")
if failures:
Expand Down
23 changes: 23 additions & 0 deletions scripts/ci/test-check-dependency-advisories.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,29 @@ def post(body):
with self.assertRaises(urllib.error.URLError):
CHECKER.check({"Cargo.lock": CLEAN_LOCK}, post)

def test_accepted_informational_advisory_warns_without_failing(self) -> None:
warnings: list[str] = []
locks = {"Cargo.lock": lock(("chrono", "0.4.45"))}
failures = CHECKER.check(locks, osv({("chrono", "0.4.45"): ["RUSTSEC-2026-0543"]}), warnings)
self.assertEqual([], failures)
self.assertEqual(1, len(warnings))
self.assertIn("RUSTSEC-2026-0543", warnings[0])

def test_acceptance_is_bound_to_the_exact_crate_and_advisory(self) -> None:
locks = {"Cargo.lock": lock(("chrono", "0.4.45"), ("other", "1.0.0"))}
failures = CHECKER.check(
locks,
osv({("chrono", "0.4.45"): ["RUSTSEC-2026-0543", ADVISORY], ("other", "1.0.0"): ["RUSTSEC-2026-0543"]}),
[],
)
self.assertEqual(
[
f"Cargo.lock: chrono 0.4.45 is affected by {ADVISORY}",
"Cargo.lock: other 1.0.0 is affected by RUSTSEC-2026-0543",
],
failures,
)

def test_checks_every_committed_lock(self) -> None:
root = Path(__file__).resolve().parents[2]
committed = {
Expand Down
Loading