Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request guidelines #293

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a17039e
Add PR conventions file
kin0992 Feb 19, 2025
0599019
Update website/docs/conventions/pull-request.md
kin0992 Feb 19, 2025
7d1307a
Add reason why title should not contain Jira task id
kin0992 Feb 19, 2025
aec329a
Improve breaking change description
kin0992 Feb 19, 2025
6ce3ec5
Create guidelines section
kin0992 Feb 19, 2025
5d07c98
Start Git section
kin0992 Feb 19, 2025
3136ee6
Add short description
kin0992 Feb 19, 2025
1449636
Improve sentence
kin0992 Feb 19, 2025
36da4ad
Update changeset file
kin0992 Feb 19, 2025
2ff812d
Update PR format and front matter
kin0992 Feb 20, 2025
f049487
Add examples on PR description format
kin0992 Feb 20, 2025
f99112f
Remove files that have been moved in a separate PR
kin0992 Feb 20, 2025
e55fae2
Update description
kin0992 Feb 20, 2025
e5916d0
Remove size criteria
kin0992 Feb 20, 2025
e4953da
Update heading type
kin0992 Feb 20, 2025
f4566dc
Fix formatting
kin0992 Feb 20, 2025
43166f6
Update title's description
kin0992 Feb 20, 2025
9c343f2
Describe PR dependency and add more exaples
kin0992 Feb 20, 2025
7d529f2
Add changelog
kin0992 Feb 20, 2025
45bb016
Add example for using changeset in a monorepo
kin0992 Feb 20, 2025
373c8b2
Update description sencence
kin0992 Feb 24, 2025
8506771
Update acceptance criteria intro message
kin0992 Feb 24, 2025
d84775c
Add principles in the index page
kin0992 Feb 24, 2025
a11ed25
Update Transparency and Pragmatic Minimalism descriptions
kin0992 Feb 25, 2025
8faa043
Clarify the use of GitHub key words
kin0992 Feb 25, 2025
826d31e
Create auto merge document
kin0992 Feb 25, 2025
93d2f7c
Update pages order
kin0992 Feb 25, 2025
f4d7175
Add introduction to auto merge
kin0992 Feb 25, 2025
bd8fd22
Add benefits of auto merge feature
kin0992 Feb 25, 2025
6eb9afa
Add instruction to enable auto merge
kin0992 Feb 25, 2025
8ca70fd
Replace Terraform module link
kin0992 Feb 26, 2025
39d17f0
Update CI acceptance criteria
kin0992 Mar 5, 2025
2079afc
Add new acceptance criteria
kin0992 Mar 5, 2025
4f9fcbe
Format files
kin0992 Mar 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions website/docs/guidelines/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 3
---

# Guidelines
17 changes: 17 additions & 0 deletions website/docs/guidelines/pull-request/acceptance-criteria.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
sidebar_label: Contribution Acceptance Criteria
sidebar_position: 3
---

# Contribution Acceptance Criteria

To ensure that a PR can be approved, the following criteria must be met:

- Code and comments must be written in English
- A PR must contain the **smallest number of changes** possible allowing the feedback loop to be as quick as possible
- If backward compatibility is broken, an explanation must be included. Make sure to include a migration guide within the changelog, using [changeset](changeset.md)
- The changes must include passing unit tests. The only exception is for tests that expose an existing bug
- The PR must be free of merge conflicts
- The PR should address only **one specific issue** or add **only one feature**. Avoid combining multiple changes; always submit separate PRs for different issues or features
- The CI pipeline must run successfully without errors
- The PR should contain a changeset file to properly handle the versioning of the project
33 changes: 33 additions & 0 deletions website/docs/guidelines/pull-request/changeset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
sidebar_label: Changeset
sidebar_position: 2
---

# Changeset

This document provides guidelines on how to create and manage changesets, which are used to document and track changes in the codebase. Proper use of changesets ensures that all modifications are recorded systematically, facilitating easier tracking and auditing of changes over time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it would be useful to include a short guide on this page with the commands for creating the changeset file. For example, in the root folder of the repository, you can run:

yarn install  
yarn corepack enable  
yarn changeset  

Then, follow the steps suggested by the prompt.

## Breaking Changes

In cases where the code added in a PR breaks backward compatibility, a migration path or guide must be included in the changeset with `major` update. This ensures that users can transition smoothly to the new version without disruption.

### Example

```markdown
---
"dx-website": major
---

Upgrade to Turbo 2.x

## Migration guide
First, check the [official documentation](https://turbo.build/repo/docs/crafting-your-repository/upgrading) for any doubts.

- Run `yarn dlx @turbo/codemod migrate` or `npx @turbo/codemod migrate` (official tool that should help to migrate. Follow the wizard)
- This will update the `turbo.json` file and try to install the latest version of `turbo`
- In case of errors, you can manually update the `turbo.json` file [following these steps](https://turbo.build/repo/docs/reference/turbo-codemod#turborepo-2x)
- In case it wasn't possible to install `turbo`, try to do it manually:
- `yarn add -D turbo`
- Now you should be ready to use the latest version of `turbo`
- Eventually, update the workflow pointing to a specific SHA
```
60 changes: 60 additions & 0 deletions website/docs/guidelines/pull-request/format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
sidebar_label: Format
sidebar_position: 1
---

# Format for Pull Requests

This document outlines the required format for pull requests to ensure clarity and consistency.
Adhering to these guidelines will facilitate smoother reviews and better communication among team members.

## Title

The title of a pull request should be concise and meaningful, summarizing the changes made.
Keep the title within 72 characters to avoid truncation by GitHub.
Avoid including references to tracking systems (e.g., Jira task IDs) in the title, as they can clutter it and may not be useful for external reviewers.

## Description

The description of a pull request must explain the rationale behind the modifications, offering a brief overview of the updates along with any relevant context.
It should include:

- A summary of the problem being solved or the feature being added
- If applicable, include a reference to the tracking system at the end of the description using `Resolves #<Jira task ID>` (e.g., `Resolves #DX-1234`)

### Tracking System References

When referencing an activity, such as a Jira task, in a pull request, use one of [GitHub's supported keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) followed by the task ID.
This ensures that the pull request is automatically linked to the relevant issue.
We enforce the use of `Resolves #<issue-number>` in the description rather than the title. This approach allows for multiple issue references within the description while keeping the title clean and focused.
The reference should be placed on a separate line at the end of the description, preceded by a blank line for separation. The sentence should begin with an uppercase letter.

### Examples

#### Good Examples

```markdown
<Pull Request description>

Resolves #DX-001
```
```markdown
<Pull Request description>

Close #DX-002 #CES-50
```
This applies when a single PR resolves multiple tasks tracked by different teams or boards.

#### Bad Examples

```markdown
<Pull Request description>

Close #DX-002 #DX-003
```
In this case, you should follow the [Contribution Acceptance Criteria](acceptance-criteria.md) and split the work into two separate PRs, each linked to a single task. This ensures better traceability and avoids merging unrelated changes together.

```markdown
This PR fixes #DX-002
```
This format is discouraged because the reference is embedded within the description, making it harder to read and potentially lacking a clear explanation of the issue being addressed. Instead, provide a meaningful description and place the reference on a separate line at the end.
5 changes: 5 additions & 0 deletions website/docs/guidelines/pull-request/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Pull Request

Pull requests (PRs) are a critical part of the development workflow, enabling collaboration and code review.

Establishing conventions for PRs ensures clarity and consistency, making it easier for team members to understand and review changes.
Loading