Skip to content

Add applyTo frontmatter to copilot-instructions.md for TypeSpec file reviews#3

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/review-copilot-instructions-file
Closed

Add applyTo frontmatter to copilot-instructions.md for TypeSpec file reviews#3
Copilot wants to merge 2 commits intomainfrom
copilot/review-copilot-instructions-file

Conversation

Copy link

Copilot AI commented Dec 29, 2025

ARM (Control Plane) API Specification Update Pull Request

Tip

Overwhelmed by all this guidance? See the Getting help section at the bottom of this PR description.

PR review workflow diagram

Please understand this diagram before proceeding. It explains how to get your PR approved & merged.

spec_pr_review_workflow_diagram

Purpose of this PR

What's the purpose of this PR? Check the specific option that applies. This is mandatory!

  • New resource provider.
  • New API version for an existing resource provider. (If API spec is not defined in TypeSpec, the PR should have been created in adherence to OpenAPI specs PR creation guidance).
  • Update existing version for a new feature. (This is applicable only when you are revising a private preview API version.)
  • Update existing version to fix OpenAPI spec quality issues in S360.
  • Convert existing OpenAPI spec to TypeSpec spec (do not combine this with implementing changes for a new API version).
  • Other, please clarify:
    • Fix instruction file mapping for TypeSpec reviews

Due diligence checklist

To merge this PR, you must go through the following checklist and confirm you understood
and followed the instructions by checking all the boxes:

  • I confirm this PR is modifying Azure Resource Manager (ARM) related specifications, and not data plane related specifications.
  • I have reviewed following Resource Provider guidelines, including
    ARM resource provider contract and
    REST guidelines (estimated time: 4 hours).
    I understand this is required before I can proceed to the diagram Step 2, "ARM API changes review", for this PR.
  • A release plan has been created. If not, please create one as it will help guide you through the REST API and SDK creation process.

Description

The instruction system uses YAML frontmatter with applyTo to map instruction files to file patterns. copilot-instructions.md lacked this frontmatter, preventing it from being applied during TypeSpec file reviews.

Changes

  • Added YAML frontmatter to .github/copilot-instructions.md:
---
applyTo: "**/*.tsp"
---

This mirrors the pattern used in openapi-review.instructions.md (applyTo: "**/*.json"), ensuring TypeSpec-specific guidance is now automatically loaded when reviewing .tsp files.

Additional information

Viewing API changes

For convenient view of the API changes made by this PR, refer to the URLs provided in the table
in the Generated ApiView comment added to this PR. You can use ApiView to show API versions diff.

Suppressing failures

If one or multiple validation error/warning suppression(s) is detected in your PR, please follow the
suppressions guide to get approval.

Getting help

  • First, please carefully read through this PR description, from top to bottom. Please fill out the Purpose of this PR and Due diligence checklist.
  • If you don't have permissions to remove or add labels to the PR, request write access per aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories
  • To understand what you must do next to merge this PR, see the Next Steps to Merge comment. It will appear within few minutes of submitting this PR and will continue to be up-to-date with current PR state.
  • For guidance on fixing this PR CI check failures, see the hyperlinks provided in given failure
    and https://aka.ms/ci-fix.
  • For help with ARM review (PR workflow diagram Step 2), see https://aka.ms/azsdk/pr-arm-review.
  • If the PR CI checks appear to be stuck in queued state, please add a comment with contents /azp run.
    This should result in a new comment denoting a PR validation pipeline has started and the checks should be updated after few minutes.
  • If the help provided by the previous points is not enough, post to https://aka.ms/azsdk/support/specreview-channel and link to this PR.
  • For guidance on SDK breaking change review, refer to https://aka.ms/ci-fix.
Original prompt

For this pull request #1 , why was the copilot-instructions.md file not used as instructions for the review ?


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: raosuhas <11067581+raosuhas@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate absence of copilot-instructions.md in review Add applyTo frontmatter to copilot-instructions.md for TypeSpec file reviews Dec 29, 2025
Copilot AI requested a review from raosuhas December 29, 2025 23:51
@raosuhas
Copy link
Owner

@copilot when making a PR into a branch , is the copilot-instructions.md from the source branch used or is it used from the target branch ?

Copy link
Author

Copilot AI commented Dec 29, 2025

@copilot when making a PR into a branch , is the copilot-instructions.md from the source branch used or is it used from the target branch ?

When making a PR, the copilot-instructions.md file is loaded from the source branch (the branch with your changes), not the target branch.

This is the expected behavior because:

  1. The instruction files are evaluated in the context of the code being reviewed (your changes)
  2. The system reads files from the current state of the PR, which includes all changes from the source branch
  3. This allows you to update instruction files as part of the same PR that needs those updated instructions

In the case of PR #1, since copilot-instructions.md on the target branch (suhasrao/codereview) didn't have the applyTo frontmatter, it wasn't being applied to TypeSpec file reviews. By adding the frontmatter in this PR, future PRs that include TypeSpec files will now have these instructions automatically loaded during review.

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

Comments