DevOps: declare local TA/DOUB/… in yieldomega_anvil_deploy_dev (caller-scope leak) #289

Closed
opened 2026-06-03 13:43:01 +00:00 by PlasticDigits · 6 comments
PlasticDigits commented 2026-06-03 13:43:01 +00:00 (Migrated from gitlab.com)

Context

Follow-up from #281 QA (#43): yieldomega_anvil_deploy_dev in scripts/lib/anvil_deploy_dev.sh assigns TA, PV, AV, RR, DOUB, CRED, and Kumbaya vars without local, so they overwrite the caller's shell scope.

That caused a false failure in scripts/verify-evm-dev-wallet-seed-anvil.sh on the re-deploy check (DOUB2 != DOUB compared equal after the second deploy overwrote DOUB). MR !413 works around this with DOUB_FIRST; the deploy helper should not surprise callers.

Problem

Caller Risk
verify-evm-dev-wallet-seed-anvil.sh Saves first-deploy addresses, then second deploy clobbers DOUB / CRED
Any script calling deploy twice Same
Scripts that set DOUB= before deploy Silent overwrite

Header comment says "After success, sets: TA, PV, …" — many callers depend on those exports (e2e-anvil.sh, anvil-export-bot-env.sh, verify-* scripts).

  1. local all assignments inside yieldomega_anvil_deploy_dev (and nested helpers if any leak).
  2. Explicit export API for callers that need addresses, e.g.:
    • yieldomega_anvil_deploy_dev prints export TA=… to a file, or
    • yieldomega_read_deploy_addrs_from_log DEPLOY_LOG documented function, or
    • Return via env file / eval "$(yieldomega_deploy_env_from_log …)".
  3. Update callers:
    • e2e-anvil.sh — already uses function-assigned TA after single deploy; re-parse from DEPLOY_LOG or capture exports intentionally.
    • Verify scripts — prefer _yieldomega_extract_addr_from_log on their own DEPLOY_LOG (pattern in !413).
  4. Add a short note in docs/testing/e2e-anvil.md or script header: do not rely on caller-scope DOUB across multiple deploy calls.

Acceptance criteria

  • Calling yieldomega_anvil_deploy_dev twice in one shell does not change caller variables unless the caller explicitly sources/exports deploy env.
  • bash scripts/e2e-anvil.sh — PASS (6 Playwright specs).
  • bash scripts/verify-evm-dev-wallet-seed-anvil.sh — PASS (can simplify DOUB_FIRST workaround once deploy helper is fixed).
  • Grep callers of yieldomega_anvil_deploy_dev updated; no regressions on Anvil verify scripts listed in AGENTS.md.
## Context Follow-up from [#281](https://gitlab.com/PlasticDigits/yieldomega/-/issues/281) QA ([#43](https://gitlab.com/PlasticDigits/yieldomega/-/merge_requests/43)): `yieldomega_anvil_deploy_dev` in [`scripts/lib/anvil_deploy_dev.sh`](scripts/lib/anvil_deploy_dev.sh) assigns **`TA`**, **`PV`**, **`AV`**, **`RR`**, **`DOUB`**, **`CRED`**, and Kumbaya vars **without `local`**, so they overwrite the **caller's** shell scope. That caused a false failure in [`scripts/verify-evm-dev-wallet-seed-anvil.sh`](scripts/verify-evm-dev-wallet-seed-anvil.sh) on the re-deploy check (`DOUB2 != DOUB` compared equal after the second deploy overwrote `DOUB`). MR !413 works around this with `DOUB_FIRST`; the deploy helper should not surprise callers. ## Problem | Caller | Risk | |--------|------| | [`verify-evm-dev-wallet-seed-anvil.sh`](scripts/verify-evm-dev-wallet-seed-anvil.sh) | Saves first-deploy addresses, then second deploy clobbers `DOUB` / `CRED` | | Any script calling deploy twice | Same | | Scripts that set `DOUB=` before deploy | Silent overwrite | Header comment says "After success, sets: TA, PV, …" — many callers **depend** on those exports ([`e2e-anvil.sh`](scripts/e2e-anvil.sh), [`anvil-export-bot-env.sh`](scripts/anvil-export-bot-env.sh), verify-* scripts). ## Recommended approach 1. **`local`** all assignments inside `yieldomega_anvil_deploy_dev` (and nested helpers if any leak). 2. **Explicit export API** for callers that need addresses, e.g.: - `yieldomega_anvil_deploy_dev` prints `export TA=…` to a file, or - `yieldomega_read_deploy_addrs_from_log DEPLOY_LOG` documented function, or - Return via env file / `eval "$(yieldomega_deploy_env_from_log …)"`. 3. Update callers: - [`e2e-anvil.sh`](scripts/e2e-anvil.sh) — already uses function-assigned `TA` after single deploy; re-parse from `DEPLOY_LOG` or capture exports intentionally. - Verify scripts — prefer `_yieldomega_extract_addr_from_log` on their own `DEPLOY_LOG` (pattern in !413). 4. Add a short note in [`docs/testing/e2e-anvil.md`](docs/testing/e2e-anvil.md) or script header: do not rely on caller-scope `DOUB` across multiple deploy calls. ## Acceptance criteria - [ ] Calling `yieldomega_anvil_deploy_dev` twice in one shell does **not** change caller variables unless the caller explicitly sources/exports deploy env. - [ ] [`bash scripts/e2e-anvil.sh`](scripts/e2e-anvil.sh) — **PASS** (6 Playwright specs). - [ ] [`bash scripts/verify-evm-dev-wallet-seed-anvil.sh`](scripts/verify-evm-dev-wallet-seed-anvil.sh) — **PASS** (can simplify `DOUB_FIRST` workaround once deploy helper is fixed). - [ ] Grep callers of `yieldomega_anvil_deploy_dev` updated; no regressions on Anvil verify scripts listed in [`AGENTS.md`](AGENTS.md). ## Related - [#281](https://gitlab.com/PlasticDigits/yieldomega/-/issues/281) · [!413](https://gitlab.com/PlasticDigits/yieldomega/-/merge_requests/43)
ghost1 commented 2026-06-03 13:59:02 +00:00 (Migrated from gitlab.com)

mentioned in commit 823023f105

mentioned in commit 823023f1054abffb5643824b0bf00e4bafe8257c
PlasticDigits commented 2026-06-03 13:59:47 +00:00 (Migrated from gitlab.com)

mentioned in merge request !419

mentioned in merge request !419
PlasticDigits commented 2026-06-03 14:07:58 +00:00 (Migrated from gitlab.com)

mentioned in commit 0b2cbc0220

mentioned in commit 0b2cbc0220a156d8d62bdf4e1eb2d9f198bef329
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-03 14:08:02 +00:00
PlasticDigits commented 2026-06-03 14:15:03 +00:00 (Migrated from gitlab.com)

mentioned in merge request !420

mentioned in merge request !420
PlasticDigits commented 2026-06-03 14:15:39 +00:00 (Migrated from gitlab.com)

mentioned in merge request !421

mentioned in merge request !421
PlasticDigits commented 2026-06-08 08:45:13 +00:00 (Migrated from gitlab.com)

mentioned in commit 93c0de8a5c

mentioned in commit 93c0de8a5c5ce7adbd8be44e475aa7019b81d461
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega#289
No description provided.