Skip to content

Conversation

@simonkurtz-MSFT
Copy link
Member

Resolves #58

@simonkurtz-MSFT simonkurtz-MSFT self-assigned this Jun 17, 2025
@simonkurtz-MSFT simonkurtz-MSFT added the enhancement New feature or request label Jun 17, 2025
@simonkurtz-MSFT simonkurtz-MSFT requested a review from Copilot June 17, 2025 13:29
Copy link

Copilot AI left a comment

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 implements the changes needed to centralize shared policy fragment handling across the codebase, resolving issue #58. Key changes include:

  • Introducing a new helper function (determine_shared_policy_path) in utils.py to centralize path resolution for shared policy fragments.
  • Updating sample notebooks to use the new helper function in place of the old _get_project_root approach.
  • Modifying Bicep templates to accept a new policyFragments parameter and deploy shared policy fragments using a dedicated module.

Reviewed Changes

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

Show a summary per file
File Description
shared/python/utils.py Adds determine_shared_policy_path and an unused import that may be removed
shared/apim-policies/fragments/*.xml Adds new policy fragment definitions
samples/secure-blob-access/create.ipynb Updates policy XML path calls to use the new helper function
samples/authX-pro/create.ipynb Refactors policy fragment usage to reference shared fragments instead of project root
infrastructure/simple-apim/*.bicep & create.ipynb Introduces and utilizes the policyFragments parameter and module for fragments deployment
infrastructure/apim-aca/*.bicep & create.ipynb Introduces policyFragments parameter and related module for APIM policy fragments
infrastructure/afd-apim-pe/*.bicep & create.ipynb Adds policyFragments parameter and module; updates step numbering in comments
Comments suppressed due to low confidence (2)

shared/python/utils.py:579

  • [nitpick] Consider adding a docstring for the 'determine_shared_policy_path' function to document its purpose, inputs, and return value for better maintainability.
def determine_shared_policy_path(policy_xml_filename: str) -> str:

shared/python/utils.py:16

  • The import 'inspect' appears to be unused in this file. Consider removing it to keep the code clean and avoid unnecessary dependencies.
import inspect

@github-actions
Copy link

Python 3.13 Test Results

212 tests  ±0   212 ✅ ±0   1s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 0351261. ± Comparison against base commit 513f675.

@github-actions
Copy link

Python 3.12 Test Results

212 tests  ±0   212 ✅ ±0   2s ⏱️ -1s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 0351261. ± Comparison against base commit 513f675.

@simonkurtz-MSFT simonkurtz-MSFT merged commit 6870d9c into main Jun 17, 2025
7 checks passed
@simonkurtz-MSFT simonkurtz-MSFT deleted the feature/move-shared-policy-fragments branch June 17, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Move Shared Policy Fragment Setup From Samples to Infrastructures

2 participants