Skip to content

Skip empty scopes in the policy set branch to align the behavior with…#246

Open
Y1ngJ1eChen wants to merge 3 commits into
mainfrom
user/yingjie/fix-issue-4190
Open

Skip empty scopes in the policy set branch to align the behavior with…#246
Y1ngJ1eChen wants to merge 3 commits into
mainfrom
user/yingjie/fix-issue-4190

Conversation

@Y1ngJ1eChen

@Y1ngJ1eChen Y1ngJ1eChen commented Jul 14, 2026

Copy link
Copy Markdown

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/checkout v5.0.1
    • actions/setup-go v6.5.0
    • golangci/golangci-lint-action v9.3.0

    The golangci/golangci-lint-action version and its version input control two independent components:

    • The action version controls the GitHub Action implementation and its Node.js runtime.
    • The version input controls the downloaded golangci-lint binary and its linting behavior.

    Previously, version: latest resolved to v2.11.4. After golangci-lint v2.12 was released, the same workflow started resolving to v2.12.2. Version v2.12 upgraded goconst and 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

@codecov-commenter

codecov-commenter commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.89%. Comparing base (5f18137) to head (e34b92c).

Files with missing lines Patch % Lines
deployment/managementgroup.go 0.00% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants