Skip to content

chore(dev): patch-deps.sh to build against local dependency checkouts - #1478

Open
duncanista wants to merge 10 commits into
jordan.gonzalez/dev-build-cache/featurefrom
jordan.gonzalez/dev-patch-deps/feature
Open

duncanista wants to merge 10 commits into
jordan.gonzalez/dev-build-cache/featurefrom
jordan.gonzalez/dev-patch-deps/feature

Conversation

@duncanista

@duncanista duncanista commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: A script that points bottlecap at a local checkout of serverless-components or libdatadog, and restores Cargo.toml and Cargo.lock afterwards.

Why: Testing a dependency fix today means editing Cargo.toml by hand and remembering to undo it. This makes it one command, and it refuses to restore over edits it did not make.

Overview

Jira: SVLS-9976

Stacked on #1477 (jordan.gonzalez/dev-build-cache/feature).

scripts/dev/patch-deps.sh points bottlecap at local checkouts of serverless-components,
libdatadog, saluki, dd-trace-rs or libddwaf-rust with [patch] entries in a marked block,
and removes them again.

  • add, remove, status, restore. The first add backs up Cargo.lock in
    bottlecap/.patch-deps/ (ignored) with its sha256.
  • status shows NOT USED for a patch that cargo does not use (version not semver
    compatible with the lock); exit code 3.
  • restore and remove refuse to run (exit 4) when the lock changed after the backup, unless
    --force.

Size: 249 core lines, 282 lines in total.

Testing

  • applies on the previous PR of the stack: pass
  • shellcheck 0.10.0 on the new scripts: pass
  • Round trip add then restore gives a byte-identical Cargo.toml and Cargo.lock.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T21:18:55.605592Z 281cf50 New commits
🔒 Security Review ✅ Completed 2026-11-05T21:16:22.111390Z 281cf50 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab01123569

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ea8ce4e | Docs | Give us feedback!

@duncanista duncanista changed the title [SVLS-9976] chore(dev): patch-deps.sh to build against local dependency checkouts chore(dev): patch-deps.sh to build against local dependency checkouts Oct 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 229b80652b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08fcfb06bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
… quoted paths and duplicate crates

- Accept --force only with restore, so add and remove can not record an
  edited Cargo.lock as the new baseline.
- Point an earlier add of the same checkout at the new path before
  resolving, so a moved checkout can be re-added.
- Write checkout paths as escaped TOML strings.
- Patch a crate in every source it comes from, not only the last one.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd76745918

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
… its lock and name checks

- add runs `cargo update` on a crate whose locked version differs from the
  local one (`--precise` for crates.io), so cargo selects the patch
- the exit code comes from the resolved packages too, not only from the
  cargo warning that quiet mode hides
- a deleted Cargo.lock counts as changed when a hash is recorded
- status records the lock hash when the lock was unchanged before it ran
- add refuses a second checkout with the same name while the first exists

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba019bb194

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved
…of a patched crate

- status resolves with `cargo metadata --locked`. It never writes Cargo.lock or
  the recorded lock hash, and fails when the lock needs an update.
- a crate is active only when no package of that name still comes from
  crates.io or git. The report lists each remote package with its version and
  source, and the command exits 3.
- drop the stderr scan for unused patches and the conditional hash record in
  status, which the two rules above replace.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 842a081bc0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/dev/patch-deps.sh Resolved
Comment thread scripts/dev/patch-deps.sh Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 281cf50bfa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/dev/patch-deps.sh Resolved
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