Skip to content

Testscript#777

Closed
arthurclares wants to merge 9 commits into
Azure:mainfrom
arthurclares:testscript
Closed

Testscript#777
arthurclares wants to merge 9 commits into
Azure:mainfrom
arthurclares:testscript

Conversation

@arthurclares
Copy link
Copy Markdown
Collaborator

Overview/Summary

Related Issues/Work Items

Breaking Changes

  1. Replace me
  2. Replace me

As part of this pull request I have

  • Read the Contribution Guide and ensured this PR is compliant with the guide
  • Checked for duplicate Pull Requests
  • Associated it with relevant GitHub Issues or ADO Work Items (Internal Only)
  • Ensured my code/branch is up-to-date with the latest changes in the main branch
  • Ensured PR tests are passing
  • Performed testing and provided evidence (e.g. screenshot of output) for any changes associated to ARG queries
  • Updated relevant and associated documentation (e.g. Contribution Guide, Docs etc.)

@arthurclares arthurclares requested a review from a team as a code owner September 11, 2025 13:49
Copilot AI review requested due to automatic review settings September 11, 2025 13:49
Copy link
Copy Markdown
Contributor

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 introduces a test workflow for validating hardened PR processes and modifies comment formatting in PowerShell scripts. The changes include creating a comprehensive test workflow and updating comment styles in KQL validation scripts.

  • Adds a new GitHub Actions workflow for testing hardened PR validation logic
  • Updates comment formatting in PowerShell validation scripts from single # to double ## delimiters
  • Implements integrity checks and simulation capabilities for testing purposes

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/test-hardened-pr.yml New test workflow implementing hardened PR validation with integrity checks and simulation capabilities
.github/scripts/validate-kql-syntax.ps1 Updates comment formatting for the Az.ResourceGraph module installation
.github/scripts/validate-kql-comments.ps1 Updates comment formatting for the Functions section header

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +31 to +38
ref: main
fetch-depth: 1

# 3) Simulate PR metadata (purely informational)
- name: Simulate PR Context
run: |
echo "Simulating PR #${{ github.event.inputs.simulate_pr_number }}"
echo "Base branch: main"
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded branch reference 'main' should be made configurable or use a dynamic reference like ${{ github.event.repository.default_branch }} to support repositories with different default branch names.

Suggested change
ref: main
fetch-depth: 1
# 3) Simulate PR metadata (purely informational)
- name: Simulate PR Context
run: |
echo "Simulating PR #${{ github.event.inputs.simulate_pr_number }}"
echo "Base branch: main"
ref: ${{ github.event.repository.default_branch }}
fetch-depth: 1
# 3) Simulate PR metadata (purely informational)
- name: Simulate PR Context
run: |
echo "Simulating PR #${{ github.event.inputs.simulate_pr_number }}"
echo "Base branch: ${{ github.event.repository.default_branch }}"

Copilot uses AI. Check for mistakes.
Comment on lines +101 to +106
# 6) Conditional Execution Simulation (purely illustrative)
- name: Check Approval Condition (simulated)
run: |
echo "Simulating reviewDecision = APPROVED"
echo "PR approved"

Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step serves no functional purpose and only outputs static simulation messages. Consider removing this step or making it perform actual validation logic if this workflow will be used for real testing scenarios.

Suggested change
# 6) Conditional Execution Simulation (purely illustrative)
- name: Check Approval Condition (simulated)
run: |
echo "Simulating reviewDecision = APPROVED"
echo "PR approved"
# 6) Check PR Approval Status (actual validation)
- name: Check PR Approval Status
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.inputs.simulate_pr_number }}
run: |
echo "Checking approval status for PR #$PR_NUMBER"
APPROVAL_COUNT=$(gh pr reviews $PR_NUMBER --json state --jq '[.[] | select(.state=="APPROVED")] | length')
if [ "$APPROVAL_COUNT" -eq 0 ]; then
echo "PR is NOT approved. Failing workflow."
exit 1
else
echo "PR is approved."
fi

Copilot uses AI. Check for mistakes.
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.

2 participants