Skip to content

Add GitHub Copilot instruction files for PowerShell CI build system#26253

Merged
TravisEz13 merged 6 commits into
masterfrom
copilot/analyze-action-usage-sync-pstags
Oct 21, 2025
Merged

Add GitHub Copilot instruction files for PowerShell CI build system#26253
TravisEz13 merged 6 commits into
masterfrom
copilot/analyze-action-usage-sync-pstags

Conversation

Copilot AI commented Oct 20, 2025

Copy link
Copy Markdown
Contributor

Overview

This PR adds comprehensive GitHub Copilot instruction files that provide guidance for working with the PowerShell CI build system. All files follow GitHub's custom instructions format with proper naming convention and frontmatter.

Instruction Files Created

  1. build-checkout-prerequisites.instructions.md - Documents checkout configuration and tag synchronization requirements:

    • Why fetch-depth: 1000 is required across all CI workflows
    • How Sync-PSTags synchronizes Git tags from the upstream repository
    • Best practices for maintaining proper Git history for version calculation
  2. build-configuration-guide.instructions.md - Explains build configuration best practices:

    • Choosing the right configuration for different scenarios (Debug, Release, CodeCoverage)
    • Platform considerations
    • Output locations
  3. start-psbuild-basics.instructions.md - Covers Start-PSBuild usage:

    • Default usage and common configurations
    • Common parameters and their purposes
    • Workflow examples
  4. troubleshooting-builds.instructions.md - Documents common build issues and solutions:

    • Git describe errors
    • Version information problems
    • Module restore issues
    • Bootstrap failures
  5. instruction-file-format.instructions.md - Format guide for maintaining instruction files:

    • File naming convention (.instructions.md suffix)
    • Required frontmatter structure with applyTo patterns
    • Content structure best practices
    • Guidelines for when to create, update, merge, or delete instruction files

Format Compliance

All instruction files follow GitHub's custom instructions guidelines:

  • ✅ Proper .instructions.md naming convention
  • ✅ YAML frontmatter with applyTo sections to scope instructions to relevant files
  • ✅ Clear, actionable guidance with code examples
  • ✅ No duplicate content across files

Changes Made

  • Analyzed existing instruction files and removed duplicates (git-requirements-for-builds.md, workflow-prerequisites.md)
  • Renamed files to follow .instructions.md convention
  • Added applyTo frontmatter to all instruction files
  • Created format guide to ensure consistency for future instruction files
Original prompt

Analyze how .github/actions/build/ci/action.yml uses sync-pstags for building, also look at the fetch depth in checkout

create a .gihub/instructions/build-checkout-prerequisites.instructions.md to describe this for other github copilot session.

reference
https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions#writing-your-own-copilot-instructionsmd-file


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Copilot AI changed the title [WIP] Analyze usage of sync-pstags in build action Add build and checkout prerequisites documentation for GitHub Copilot sessions Oct 20, 2025
Copilot AI requested a review from TravisEz13 October 20, 2025 22:48
Comment thread .github/instructions/build-checkout-prerequisites.instructions.md
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
@TravisEz13 TravisEz13 marked this pull request as ready for review October 20, 2025 22:56
Copilot AI review requested due to automatic review settings October 20, 2025 22:56

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.

Pull Request Overview

This PR adds comprehensive documentation about build and checkout prerequisites for PowerShell's CI workflows, specifically targeting GitHub Copilot sessions. The documentation explains the critical relationship between Git fetch depth and the Sync-PSTags operation used for version calculation across all CI platforms.

Key Changes:

  • Documents why fetch-depth: 1000 is used across all CI build and test jobs
  • Explains the Sync-PSTags function's role in fetching tags for version calculation
  • Provides best practices for working with PowerShell's CI system

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

@TravisEz13 TravisEz13 added the CL-Docs Indicates that a PR should be marked as a documentation change in the Change Log label Oct 20, 2025
@TravisEz13 TravisEz13 enabled auto-merge (squash) October 20, 2025 22:58
@TravisEz13

TravisEz13 commented Oct 20, 2025

Copy link
Copy Markdown
Member

@copilot analyze all the file in .github/instructions and remove duplicate information and make sure they all follow the guideline at https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions#writing-your-own-copilot-instructionsmd-file

GitHub Docs
Create repository custom instructions files that give Copilot additional context on how to understand your project and how to build, test and validate its changes.

- Remove duplicate files (git-requirements-for-builds.md, workflow-prerequisites.md)
- Rename all instruction files to use .instructions.md suffix
- Add applyTo frontmatter to all instruction files
- Create instruction-file-format.instructions.md guide

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>

Copilot AI commented Oct 20, 2025

Copy link
Copy Markdown
Contributor Author

@copilot analyze all the file in .github/instructions and remove duplicate information and make sure they all follow the guideline at https://docs.github.com/en/copilot/how-tos/configure-custom-inst...

Analyzed all instruction files and made the following changes:

Removed duplicates:

  • git-requirements-for-builds.md (duplicated fetch-depth and Sync-PSTags info from build-checkout-prerequisites)
  • workflow-prerequisites.md (duplicated workflow setup info)

Ensured proper format:

  • Renamed 3 files to use .instructions.md suffix (build-configuration-guide, start-psbuild-basics, troubleshooting-builds)
  • Added applyTo frontmatter to all instruction files

Added format guide:

  • Created instruction-file-format.instructions.md documenting the format guidelines per the GitHub docs

Final result: 5 instruction files, all following naming convention, all with proper frontmatter, no duplicate content. Commit: [short hash will be in next message]

auto-merge was automatically disabled October 20, 2025 23:11

Head branch was pushed to by a user without write access

Copilot AI changed the title Add build and checkout prerequisites documentation for GitHub Copilot sessions Add GitHub Copilot instruction files for PowerShell CI build system Oct 20, 2025
Copilot AI requested a review from TravisEz13 October 20, 2025 23:12
@TravisEz13 TravisEz13 requested a review from Copilot October 20, 2025 23:15

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.

Pull Request Overview

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


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

Comment thread .github/instructions/instruction-file-format.instructions.md
Comment thread .github/instructions/build-checkout-prerequisites.instructions.md
@TravisEz13 TravisEz13 enabled auto-merge (squash) October 20, 2025 23:15
@TravisEz13 TravisEz13 merged commit eeefcd7 into master Oct 21, 2025
33 checks passed
@TravisEz13 TravisEz13 deleted the copilot/analyze-action-usage-sync-pstags branch October 21, 2025 19:45
@microsoft-github-policy-service

microsoft-github-policy-service Bot commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

📣 Hey @@Copilot, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request Dec 12, 2025
…owerShell#26253)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request Jan 2, 2026
…owerShell#26253)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
JustinGrote pushed a commit to JustinGrote/PowerShell that referenced this pull request Jun 2, 2026
…owerShell#26253)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Docs Indicates that a PR should be marked as a documentation change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants