|
| 1 | +# Copilot Instructions |
| 2 | + |
| 3 | +This document provides instructions for GitHub Copilot to assist with reviewing pull requests and performing tasks based on user prompts. It references existing guidelines and role-specific instructions available in this repository. |
| 4 | + |
| 5 | +## Understanding the repository |
| 6 | + |
| 7 | +Read the [README](../README.md) to understand the purpose of this repository and its structure. On high level, this repository contains the following key packages: |
| 8 | + |
| 9 | +- [`action-destinations`](../packages/destination-actions): This contains all cloud-mode destinations. All new destinations are registered manually and the destination metadata id is then updated in [index.ts](../packages/destination-actions/src/index.ts). |
| 10 | +- [`browser-destinations`](../packages/browser-destinations): This contains all browser-mode destinations. All new destinations are registered manually and the destination metadata id is then updated in [destination-manifest/index.ts](../packages/destinations-manifest/src/index.ts). |
| 11 | +- [`core`](../packages/core): This contains all the core framework for running the destinations. Any changes made here will affect both cloud-mode and browser-mode destinations. Thorough regression testing is required for these changes. |
| 12 | +- [`destination-subscriptions`](../packages/destination-subscriptions): This package validates event payloads against an action's subscription AST. |
| 13 | +- [`browser-destination-runtime`](../packages/browser-destination-runtime): This package contains the runtime for browser-mode destinations, including the logic for executing actions and handling events. |
| 14 | + |
| 15 | +## Reviewing Pull Requests |
| 16 | + |
| 17 | +When reviewing pull requests, Copilot should: |
| 18 | + |
| 19 | +1. Ensure all the required checks mentioned [here](../docs/pr-guidelines/pr-checks.md) have passed. |
| 20 | +2. Follow the expectations outlined in the [Reviewer Guidelines](../docs/pr-guidelines/pull-request-guidance.md). |
| 21 | +3. Suggest splitting changes to multiple destinations into separate pull requests. |
| 22 | +4. Ensure that the pull request doesn't introduce known breaking changes as called out in the [Pull Request Guidance](../docs/pr-guidelines/pull-request-guidance.md). |
| 23 | + |
| 24 | +## Performing Tasks |
| 25 | + |
| 26 | +When performing tasks based on user prompts, Copilot should: |
| 27 | + |
| 28 | +1. Refer to the relevant guidelines and documentation in this repository. |
| 29 | +2. Ensure that any code changes follow the principles outlined in the [Contributor Guidelines](../docs/pr-guidelines/pull-request-guidance.md). |
| 30 | +3. Ensure that code changes are implemented using as many framework features as possible, such as conditionally required fields, error handling etc. |
| 31 | +4. Write clear unit tests for any new functionality or changes made to existing functionality. |
| 32 | + - Use the existing tests as a reference for writing new tests. |
| 33 | + - All external calls should be mocked in the tests. For cloud-mode destinations, we use `nock` to mock external calls. |
0 commit comments