fix(dev-infrastructure): unset workingDir on postgres-access reconcile steps - #6382
Conversation
…e steps (AROSLSRE-1699) cs-postgres-access and maestro-postgres-access enforce postgres access grants and must run on every incremental rollout. Setting workingDir opts a Shell step into content-hash caching (IsWellFormedOverInputs() in ARO-Tools/pipelines/types/shell.go returns true whenever workingDir is non-empty), so these reconcile steps could be silently skipped when their cached command/workingDir/envVars are unchanged. Since both pipeline.yaml files live at the repo root of dev-infrastructure/, removing workingDir doesn't change the step's actual working directory (it already resolved to the pipeline directory), it only makes the step always re-run in incremental mode as intended. Raised by roivaz in Azure#6369 (comment) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: raelga The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Ensures the cs-postgres-access and maestro-postgres-access Shell steps in the service-cluster pipeline always execute during incremental rollouts by removing workingDir: ., avoiding step-cache skipping for drift reconciliation.
Changes:
- Removed
workingDir: .fromcs-postgres-accessto prevent content-hash caching from skipping the step. - Removed
workingDir: .frommaestro-postgres-accessfor the same reason. - Added inline comments explaining why
workingDiris intentionally left unset for these steps.
|
Closing this: it's based on a wrong premise. Unsetting workingDir doesn't just change caching, it also switches the step to Ev2's implicit whole-repo archive, and that fails in Ev2 for these pipelines. workingDir also has a deliberate purpose here: scope the step so it only reruns when its actual inputs change (envVars/command), not "always rerun to catch drift". That's a feature, not a bug. No fix needed on this behavior. |
Why
cs-postgres-accessandmaestro-postgres-accessare Shell steps insvc-pipeline.yamlthat reconcile postgres access grants, they need to run on every rollout to catch drift, not just when their pipeline step changes.They were both set to
workingDir: .. PerARO-Tools/pipelines/types/shell.go:Any non-empty
workingDir(including.) opts a Shell step into content-hash caching under incremental rollouts (runShellStepinshell.goskips execution whenIsWellFormedOverInputs()is true, keyed on{command, workingDir, envVars}against a persistent.step-cachedir). A step only always reruns whenworkingDiris left fully unset.Since
svc-pipeline.yamllives atdev-infrastructure/'s root,workingDir: .and an unsetworkingDircompute to the exact same working directory at execution time (filepath.Join(PipelineDirectory, ".")==PipelineDirectory), so removing the field changes only caching eligibility, not actual runtime behavior.What
Removed
workingDir: .fromcs-postgres-accessandmaestro-postgres-access, with a comment explaining why, so both steps always execute on incremental rollouts as intended.Raised by roivaz in PR #6369 review, tracked in AROSLSRE-1699.
Note: the same issue affects the new
ocp-acr-replication/svc-acr-replicationsteps being added in #6369 (alsoworkingDir: .), those aren't onmainyet so aren't part of this PR, they'll be fixed directly in #6369 before merge.Testing
Validated with
templatize pipeline validate --topology-config-file topology.yaml --service-config-file config/config.yaml --dev-mode --dev-region westus3(exit 0, no schema/topology errors).workingDiris optional in the pipeline schema and not in any step's required-fields list, confirmed removing it is safe. No functional change to the step's working directory since it already resolved to the pipeline directory.