[DX-3043] make sure all local CRE CLI commands respect the state files#21694
[DX-3043] make sure all local CRE CLI commands respect the state files#21694
Conversation
|
I see you updated files related to
|
|
✅ No conflicts with other open PRs targeting |
|
15a0055 to
a94ada7
Compare
There was a problem hiding this comment.
Pull request overview
Risk Rating: MEDIUM — CLI behavior changes across multiple CRE commands; correctness depends on state file parsing and resolution fallbacks.
This PR aims to ensure local CRE CLI commands prefer values from local CRE state files (RPC URL, contract addresses/versions, DON metadata) unless the user explicitly overrides via flags.
Changes:
- Introduces a
LocalCREStateResolverto load and query local CRE state (addresses, RPC, DON/gateway metadata, workflow registry output). - Updates workflow and example commands to resolve RPC/addresses/DON IDs from local state when flags aren’t explicitly set.
- Updates billing startup to hydrate missing config from local CRE state and adds unit tests for the resolver utilities.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| core/scripts/cre/environment/examples/examples.go | Resolves RPC URL from local CRE state for example contract deployment commands. |
| core/scripts/cre/environment/environment/workflow.go | Replaces direct state-file reads with shared resolver-based address/version/RPC/DON resolution. |
| core/scripts/cre/environment/environment/state_resolver.go | Adds LocalCREStateResolver implementation for loading/reading local CRE state + helper parsing. |
| core/scripts/cre/environment/environment/state_resolver_test.go | Adds unit tests for resolver behavior and helpers (address refs, DON metadata, docker RPC mapping). |
| core/scripts/cre/environment/environment/examples.go | Uses resolver to hydrate RPC, gateway URL, DON info, and workflow registry address/version for the PoR example workflow command. |
| core/scripts/cre/environment/environment/billing.go | Hydrates billing config from local CRE state when running without a provided SetupOutput; normalizes RPC for Docker access. |
|





CLI tests passed: https://github.com/smartcontractkit/chainlink/actions/runs/23548405981/job/68555289202?pr=21694