Skip to content

Avoid CI/CD runs for template SHA-only system updates - #2379

Open
Alexander Holstrup (aholstrup1) wants to merge 2 commits into
mainfrom
aholstrup1-system-update-ci-triggers
Open

Alexander Holstrup (aholstrup1) wants to merge 2 commits into
mainfrom
aholstrup1-system-update-ci-triggers

Conversation

@aholstrup1

Copy link
Copy Markdown
Collaborator

❔What, Why & How

An empty commit in a template repository currently causes Update AL-Go System Files to commit a new templateSha to the consuming repository, triggering CI/CD even though no system files changed.

When there are no file updates or removals, the persisted template URL matches, and a template SHA already exists, retain the original SHA. The updater continues through the existing CommitFromNewFolder no-change handling instead of returning early. Real updates, removals, template switches, and metadata initialization still follow the normal update path.

The SHA remains pinned to the last applied revision rather than the latest checked revision. CI/CD path filters are unchanged.

Regression coverage includes SHA-only updates in direct-commit and PR modes, real file and settings changes, removals, template switches, and missing metadata. All 106 tests in CheckForUpdates.Action.Test.ps1 pass on PowerShell 5.1 and 7.6.

Related to issue: #2358

Fixes: #2358

✅ Checklist

  • Add tests (E2E, unit tests)
  • Update RELEASENOTES.md
  • Update documentation (e.g. for new settings or scenarios)
  • Add telemetry - N/A; reuses existing no-change handling.

Preserve the recorded template SHA when system files and the template URL are unchanged, reusing the existing no-change commit handling.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 22, 2026 12:26
Comment thread Tests/CheckForUpdates.Action.Test.ps1 Fixed
Comment thread Tests/CheckForUpdates.Action.Test.ps1 Fixed
Comment thread Tests/CheckForUpdates.Action.Test.ps1 Fixed
Comment thread Tests/CheckForUpdates.Action.Test.ps1 Fixed

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.

Copilot review overview

🟢 Approval recommended

The focused implementation matches the described behavior and includes cross-platform regression coverage for relevant update paths.

Review effort: Balanced
Findings: None

What changed in this PR

Prevents SHA-only template updates from creating unnecessary commits, pull requests, and CI/CD runs.

Changes:

  • Retains the last applied template SHA when system files are unchanged.
  • Adds regression coverage for no-op and real update scenarios.
  • Documents the behavior and release impact.
File Description
Actions/​CheckForUpdates/​CheckForUpdates.ps1 Preserves the existing SHA for no-op updates.
Tests/​CheckForUpdates.Action.Test.ps1 Adds comprehensive regression tests.
Scenarios/​UpdateAlGoSystemFiles.md Documents no-op update behavior.
RELEASENOTES.md Records the issue resolution.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Add targeted suppressions for variables consumed by cleanup and mock script blocks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

[Bug]: CICD runs after every commit by 'Update AL-Go System Files'

4 participants