Skip empty scopes in the policy set branch to align the behavior with…#246
Open
Y1ngJ1eChen wants to merge 3 commits into
Open
Skip empty scopes in the policy set branch to align the behavior with…#246Y1ngJ1eChen wants to merge 3 commits into
Y1ngJ1eChen wants to merge 3 commits into
Conversation
… the single definition branch
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #246 +/- ##
==========================================
+ Coverage 47.87% 47.89% +0.02%
==========================================
Files 54 54
Lines 4913 4915 +2
==========================================
+ Hits 2352 2354 +2
Misses 2273 2273
Partials 288 288 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Fix the issue: Azure/Azure-Landing-Zones#4190
Problem: A policy set member may contain a parameter with assignPermissions: true whose resolved value is an empty string. The PolicySetDefinitionsType branch attempted to parse this empty value as an ARM resource ID, resulting in: invalid resource ID: id cannot be empty. The policy definition branch already skips empty parameter values, but the policy set branch did not.
Fix: Added an empty-value guard in the PolicySetDefinitionsType branch before calling arm.ParseResourceID(). Empty scopes are now skipped because there is no target resource on which to create a role assignment.
This aligns policy set behavior with the existing policy definition behavior while preserving validation errors for non-empty invalid resource IDs.
2. Fix Lint code base issue:
Update Node.js version
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24, For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
golangci-lint is pinned to v2.11.4
This PR upgrades the GitHub Actions used by the lint workflow to versions that run on Node.js 24:
actions/checkoutv5.0.1actions/setup-gov6.5.0golangci/golangci-lint-actionv9.3.0The
golangci/golangci-lint-actionversion and itsversioninput control two independent components:versioninput controls the downloadedgolangci-lintbinary and its linting behavior.Previously,
version: latestresolved to v2.11.4. After golangci-lint v2.12 was released, the same workflow started resolving to v2.12.2. Version v2.12 upgradedgoconstand introduced extended detection, which exposed 77 pre-existing repeated-string findings, primarily in test fixtures. These findings are unrelated to the Node.js 24 migration.To keep this PR focused and make the CI result reproducible, the linter binary is pinned to the last known-good version: version: v2.11.4