Skip to content

Preserve minReplicas: null on no-op scaling edits - #1112

Draft
Megan Mott (motm32) with Copilot wants to merge 2 commits into
mainfrom
copilot/no-op-update-scaling-settings
Draft

Preserve minReplicas: null on no-op scaling edits#1112
Megan Mott (motm32) with Copilot wants to merge 2 commits into
mainfrom
copilot/no-op-update-scaling-settings

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Editing scaling range without changing values was mutating Container App config by converting minReplicas from null to 0. This PR prevents no-op scaling edits from writing changes and preserves null-vs-explicit-zero semantics.

  • No-op change detection in scaling update path

    • Added explicit guard logic to skip execution when entered min/max equals current min/max.
    • Prevents unnecessary draft/template writes for unchanged scaling ranges.
  • Null preservation for unchanged minimum replicas

    • Captures whether original scale.minReplicas was null in edit context.
    • During update, avoids writing minReplicas when the original value was null and min was not changed.
  • Focused unit coverage for behavior

    • Added tests around:
      • no-op range updates not executing
      • changed ranges executing
      • preserving null minimum when unchanged
if (!shouldPreserveNullMinReplicas(context)) {
    this.revisionDraftTemplate.scale.minReplicas = context.newMinRange;
}

public shouldExecute(context: T): boolean {
    return shouldUpdateScaleRange(context);
}

Copilot AI changed the title [WIP] Fix no-op update of scaling settings for minReplicas Preserve minReplicas: null on no-op scaling edits Jul 8, 2026
Copilot AI requested a review from Megan Mott (motm32) July 8, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No-op update of Scaling settings changes minReplicas from null to 0

2 participants