Skip to content

Commit 8a5b8fd

Browse files
Adds copilot agent guidelines (#3048)
* Adds copilot agent guidelines * Update docs/pr-guidelines/pull-request-guidance.md Co-authored-by: Copilot <[email protected]> * Update docs/pr-guidelines/pull-request-guidance.md Co-authored-by: Copilot <[email protected]> * Update .github/copilot-instructions.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 2ef6156 commit 8a5b8fd

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.github/copilot-instructions.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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.

docs/pr-guidelines/pr-checks.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PR CI Checks
2+
3+
The following checks should pass for all PRs:
4+
5+
- CI / Unit Tests
6+
- CI / Lint
7+
- CI / Validate
8+
- CI / Browser Destination Bundle QA
9+
- CI / Browser tests: actions-core
10+
- Required Field Check / required-field-check
11+
- Test External
12+
- codecov
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# PR request guidelines
2+
3+
- The pull request includes a description of testing performed.
4+
- The pull request doesn't introduce a new required field to an already existing action definition. This will result in failures for existing customers.
5+
- Ensure errors are handled as per [error-guidelines](../docs/error-handling.md).
6+
- Ensure the pull request uses framework features such as [Conditionally required fields](https://github.com/segmentio/action-destinations?tab=readme-ov-file#required-fields)
7+
- Check for grammatical and spelling mistakes in descriptions for Action Definition fields and Destination Definition settings.

0 commit comments

Comments
 (0)