Investigate: Redeployment Requirements on Code Changes. QA Environment Decision Guide #325
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#325
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Certain code changes in this repo require partial or full redeployment of the LocalTerra QA environment to produce valid test results. Without knowing which changes require what level of reset, QA can silently test against stale contract state, an orphaned indexer DB, or a mis-compiled indexer binary — producing results that don't reflect the actual code under test.
This document maps change types to the correct reset action and explains why.
Background
The QA environment is made up of three layers, each with its own state:
localterra)make reset-qa(wipes volume)postgres)make reset-qa(wipes volume)make deploy-local(new instantiation)cargo run --release)make start-qaormake reset-qafrontend-dapp/.env.localmake deploy-local(rewrites file)make deploy-localonly redeploys contracts and rewrites the frontend env. It does not wipe the chain, wipe postgres, or restart the indexer.make reset-qawipes both Docker volumes, then runs the fullstart-qaflow which includesmake deploy-local, indexer recompile, and indexer restart.make startonly starts Docker containers. It does not build or deploy anything.Change Types and Required Reset Level
Requires
make reset-qa(full wipe + redeploy)indexer/src/**)deploy-localalone does not restart indexer. Also, new contract addresses from the redeploy make prior postgres data orphaned — wipe is cleaner.smartcontracts/contracts/**)scripts/deploy-dex-local.sh)pair_creation_fee_uluna=0). The only way to change it is to redeploy. Prior postgres data is then stale against new addresses.Requires
make deploy-localonly (no chain wipe)deploy-localrewritesfrontend-dapp/.env.local.No redeployment needed
frontend-dapp/src/**)make devor the frontend dev server.docs/**,*.md,AGENTS.md,skills/**)scripts/qa/**, not deploy script)smartcontracts/**/tests/**)Real Example: Commit
019ded6(mergeqa/318-315-deploy-fee-gas)This commit illustrates a case where
make reset-qawas the correct action, not justmake deploy-local.What changed:
scripts/deploy-dex-local.sh— factory now instantiated with realpair_creation_fee_uluna(100 LUNC default) instead of0; gas flag changed from--feesto--gas-pricesindexer/src/api/mod.rs— IPv6/64rate-limit key extractor and its tests removedpackages/localnet-trading-swarm/src/funding.ts— gas flag updatedWhy
deploy-localalone was insufficient:pair_creation_fee_uluna=0— the wrong config for validating the #318 fixCorrect action:
make reset-qaQuick Decision Reference
Related
scripts/deploy-dex-local.sh— local deploy entrypointscripts/qa/start-qa.sh— full QA stack start (includes deploy-local + indexer)scripts/qa/reset-qa.sh— volume wipe + start-qacc: @PlasticDigits
As requested per setting up phase time taking long before active investigation goes on .
Might want to consider having brebuilt binaries available. This is a research and design question for how to optimize for qa team
Investigation: QA setup slowness
I traced the QA/LocalTerra bring-up paths. The slow path is mostly deterministic setup work, not a single hang.
Where time is going
make start-qaalways pays optimizer + deploy:scripts/qa/start-qa.shstops the stack, starts compose, then runsmake deploy-local.Makefilehasdeploy-local: build-optimized, so everystart-qainvokes the CosmWasm workspace optimizer.scripts/deploy-dex-local.shis intentionally heavyweight:terrad_txsubmissions and 31 fixedsleep 3waits, before block inclusion and query time.frontend-dapp/.env.local,indexer/.env, and.qa-deploy-stamp.cw20_mintable.wasm,treasury.wasm,wrap_mapper.wasm), deploy can detour into clone + optimizer builds inside the deploy script.Indexer cold start can add minutes:
start-qausescargo run --releaseunlessINDEXER_QA_BINpoints at a prebuilt binary.make reset-qaadds volume re-init:Cloud Agent setup is more idempotent than QA server setup:
scripts/setup-cloud-agent-localterra.shcan skip build/deploy when.qa-deploy-stamp,.env.local, artifacts, and a live factory LCD probe all matchHEAD.scripts/qa/start-qa.shalways runsmake deploy-local, so it always pays optimizer + deploy even when state is already valid.Immediate operating recommendations
make start-qa, notmake reset-qa, unless contract/genesis/indexer schema changed orqa-verify-deployreports stale on-chain schema.HEAD, usemake deploy-local && make qa-verify-deploy; do not wipe volumes.make setup-cloud-localterra; use./scripts/setup-cloud-agent-localterra.sh --skip-buildwhen wasm artifacts are already fresh, or--infra-onlywhen only LocalTerra/Postgres are needed.docker volume pruneon QA hosts unless an explicit fresh reset is needed.cd indexer && cargo build --releaseexport INDEXER_QA_BIN=$PWD/indexer/target/release/cl8y-dex-indexermake start-qa.cw20_mintable.wasm,treasury.wasm, andwrap_mapper.wasmare present insmartcontracts/artifacts/before deploy to avoid nested optimizer detours..env.localinstead of re-running the full QA bring-up.Design recommendations
_deploy_up_to_datestyle skip tostart-qa: if stampgit_sha == HEAD, env factory matches, artifacts exist, and the factory LCD probe succeeds, skipmake deploy-local.deploy-localinto build and no-build variants, for exampledeploy-local-no-build, so QA can skip the optimizer when artifacts are already fresh.start-qato prefer it throughINDEXER_QA_BIN.sleep 3waits with a tx wait/poll helper where possible. This will not remove block time, but it can reduce additive delay when a tx is already queryable.start-qaanddeploy-dex-local.shso future slowness reports identify the exact phase without manual tracing.Bottom line: the largest win is avoiding unnecessary optimizer + full deploy + release compile for QA sessions where deployed contract state is already valid.
All 7 approved including publishing wasm, indexer artifacts
mentioned in commit
6763580ad2mentioned in merge request !802
Implementation complete — MR !802
MR: https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/84
Delivered for #325:
skills/AGENTS_QA_REDEPLOY_DECISION.md(change type →reset-qa/deploy-local/ no redeploy)start-qadeploy skip — shareddeploy_up_to_dateprobe (stamp == HEAD + factory LCD)deploy-local-no-build— deploy without optimizer when artifacts exist.gitlab-ci.ymlqa-wasm-artifacts+ publish scriptqa-indexer-binaryjob +INDEXER_QA_BIN/build-indexer-releaseQA_DEPLOY_SEED=minimal|charts|wallet|fullscripts/lib/terrad-wait-tx.shreplaces fixedsleep 3[timing]logs instart-qaanddeploy-dex-local.shVerification (agent VM)
make test-qa-redeploy-decisionmake test-qa-fresh-volumesmake test-qa-verify-deploy(verify-deploy only)test-localterra-host-curlstart-qaon QA serverQA_FETCH_CI_ARTIFACTS=1Issue left open for QA host sign-off after MR merge.
mentioned in commit
775ad0e620mentioned in merge request !829
mentioned in issue #361
mentioned in merge request !879
mentioned in issue #620