Skip to content

refactor(dev-infrastructure): read per-region acr replication state via configRef - #6400

Merged
openshift-merge-bot[bot] merged 3 commits into
Azure:mainfrom
raelga:rael/aroslsre-replication-state
Aug 4, 2026
Merged

refactor(dev-infrastructure): read per-region acr replication state via configRef#6400
openshift-merge-bot[bot] merged 3 commits into
Azure:mainfrom
raelga:rael/aroslsre-replication-state

Conversation

@raelga

Copy link
Copy Markdown
Collaborator

What

Replace acr.ocp.regionEndpointDisabledRegions (a single global space-separated list of regions, checked for membership in the CLI) with acr.ocp.replicationState (a per-region boolean), threaded to the ocp-acr-replication step as REPLICATION_STATE.

Each region now carries its own desired replication endpoint state via the normal region-override config mechanism (config.msft.clouds-overlay.yaml regions.<name>.acr.ocp.replicationState), the same pattern already used for other per-region overrides like kusto.location. The CLI reads REPLICATION_STATE directly and acts on it idempotently, instead of parsing a list and checking region membership.

eastus2euap keeps its override (regionEndpointDisabledRegions: 'eastus2euap' -> regions.eastus2euap.acr.ocp.replicationState: false); every other region defaults to enabled (true).

Why

Suggested by Steve K. during review of #6369 as a config-shape simplification: a per-region scalar is simpler to read and override than a global list the CLI has to parse and match against the current region.

Testing

  • go test ./... passes in dev-infrastructure/scripts/acr-replication (added cases for REPLICATION_STATE true/false/invalid).
  • cd config && make materialize re-rendered config/rendered/dev/** (committed) and passed all helmtest/pipeline unit tests.
  • Verified the new regions.eastus2euap.acr.ocp.replicationState override resolves without schema errors via templatize inspect --cloud public --deploy-env prod --region eastus2euap (remaining errors from that command are pre-existing, unrelated to missing sensitive/msft-internal overlay files not available in this checkout).

…r own script folder (AROSLSRE-1699)

Point ocp-acr-replication, svc-acr-replication, cs-postgres-access, and
maestro-postgres-access at their own scripts/<name> subfolder instead of
the repo root, matching the pattern already used by housekeeping,
upgrade-aks-cluster, oidc-storage-setup, cleanup-prometheus-pvc, and
istio-upgrade.

workingDir stays non-empty (required for EV2's scoped-package archiving,
unsetting it breaks EV2), but the archive is now limited to the step's
own script directory instead of the whole repo. This lets the
incremental-rollout content-hash actually reflect that script's inputs,
instead of effectively depending on the entire monorepo's content.

command is updated to be relative to the new workingDir.
…own script folder (AROSLSRE-1699)

Same fix as the acr-replication/postgres-access steps: point workingDir
at scripts/grafana-group-roles instead of the repo root, so the EV2
package archive and incremental-rollout cache key actually reflect this
step's own inputs.
…ia configRef (AROSLSRE-1699)

Replace acr.ocp.regionEndpointDisabledRegions (a single global
space-separated list of regions, checked for membership in the CLI)
with acr.ocp.replicationState (a per-region boolean), threaded to the
ocp-acr-replication step as REPLICATION_STATE.

Each region now carries its own desired replication endpoint state via
the normal region-override config mechanism (config.msft.clouds-overlay.yaml
regions.<name>.acr.ocp.replicationState), the same pattern already used
for other per-region overrides like kusto.location. The Go CLI reads
REPLICATION_STATE directly and acts on it idempotently, instead of
parsing a list and checking region membership.

eastus2euap keeps its override (regionEndpointDisabledRegions: 'eastus2euap'
-> regions.eastus2euap.acr.ocp.replicationState: false), everything else
defaults to enabled (true).

Suggested by Steve K. as a config-shape simplification during review of
PR Azure#6369.
Copilot AI lite review requested due to automatic review settings August 4, 2026 11:05
@openshift-ci openshift-ci Bot added the approved label Aug 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies per-region ACR replica regional data-endpoint control by replacing the global acr.ocp.regionEndpointDisabledRegions list with a per-region boolean acr.ocp.replicationState, passed into the acr-replication Go helper as REPLICATION_STATE.

Changes:

  • Update dev-infrastructure/scripts/acr-replication to read REPLICATION_STATE (strconv.ParseBool) and treat it as the desired endpoint-enabled state (default true when unset).
  • Thread acr.ocp.replicationState into the ocp-acr-replication pipeline step as REPLICATION_STATE, and remove the old disabled-regions list wiring.
  • Migrate config defaults/schema/overlays and re-materialize rendered dev configs to the new replicationState field.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
dev-infrastructure/svc-pipeline.yaml Runs postgres-access from its script directory (consistent with buildStep output location).
dev-infrastructure/scripts/acr-replication/main.go Replaces disabled-region list parsing with REPLICATION_STATE boolean parsing + defaulting.
dev-infrastructure/scripts/acr-replication/main_test.go Updates unit tests for REPLICATION_STATE true/false and adds invalid-value coverage.
dev-infrastructure/region-pipeline.yaml Passes REPLICATION_STATE from acr.ocp.replicationState and runs acr-replication from its script directory.
dev-infrastructure/global-pipeline-stg.yaml Runs grafana-group-roles from its script directory (consistent with buildStep output location).
config/rendered/dev/pers/westus3.yaml Materialized config: replaces old list field with replicationState: true.
config/rendered/dev/perf/westus3.yaml Materialized config: replaces old list field with replicationState: true.
config/rendered/dev/dev/westus3.yaml Materialized config: replaces old list field with replicationState: true.
config/rendered/dev/cspr/westus3.yaml Materialized config: replaces old list field with replicationState: true.
config/rendered/dev/ci01/centralus.yaml Materialized config: replaces old list field with replicationState: true.
config/rendered/dev/ci00/centralus.yaml Materialized config: replaces old list field with replicationState: true.
config/config.yaml Updates defaults and documentation from list-based config to boolean replicationState.
config/config.schema.json Updates schema: replaces string list field with boolean replicationState.
config/config.msft.clouds-overlay.yaml Adds per-region override setting replicationState: false for eastus2euap in public/prod.

@venkateshsredhat

Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: raelga, venkateshsredhat

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit ff3ae36 into Azure:main Aug 4, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants