Skip to content

Commit 4abf5b5

Browse files
authored
docs: add PR submission guide (#2)
1 parent 66b3261 commit 4abf5b5

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

docs/how-to-submit-a-pr.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# How to submit a PR
2+
3+
## 1. Prerequisites
4+
5+
- Make sure you have write access to the repository (or submit a PR from a fork).
6+
- Use Node.js locally (recommended to match `package.json` `engines`).
7+
8+
## 2. Update `main` and create a branch
9+
10+
- Pull the latest `main`.
11+
- Create a new branch (recommended naming):
12+
- `feature/<short-desc>`
13+
- `fix/<short-desc>`
14+
- `chore/<short-desc>`
15+
16+
## 3. Development and local checks
17+
18+
- Make your changes.
19+
- Run minimal local checks:
20+
- `npm ci`
21+
- `npm run prepare`
22+
- Optional: run a quick manual validation relevant to your change.
23+
24+
## 4. Commit conventions
25+
26+
- Recommended commit message prefixes:
27+
- `feat: ...`
28+
- `fix: ...`
29+
- `refactor: ...`
30+
- `chore: ...`
31+
32+
- Keep the PR focused: ideally one PR addresses one category of change.
33+
34+
## 5. Push your branch and create a PR (recommended: gh)
35+
36+
- Push your branch:
37+
- `git push -u origin <your-branch>`
38+
39+
- Create the PR:
40+
- `gh pr create -R nmhjklnm/cue-command`
41+
42+
- Suggested PR description:
43+
- Why (motivation)
44+
- What (changes)
45+
- How to test
46+
- Risks / impact
47+
48+
## 6. CI and review
49+
50+
- Ensure all PR checks pass (CI runs on PRs).
51+
- Address review feedback by pushing additional commits.
52+
53+
## 7. Merge policy
54+
55+
- This repository uses a ruleset: only `squash` / `rebase` merges are allowed.
56+
- Generally, **squash merge** is recommended to keep `main` history clean.
57+
58+
## 8. Post-merge
59+
60+
- After merging, confirm `main` CI runs and succeeds.
61+
- If a release is required, follow the repository release process.
62+
63+
## 9. Common pitfalls
64+
65+
- **CI did not run**
66+
- Confirm your PR targets `main`, and check workflow triggers (`pull_request` / `push` branch filters).
67+
- Use `gh pr checks <PR_NUMBER> -R nmhjklnm/cue-command` to see if checks are present.
68+
69+
- **CI fails (works locally but fails in CI)**
70+
- Prefer `npm ci` (depends on the lockfile) and keep `package-lock.json` in sync with `package.json`.
71+
- Use `gh run view <RUN_ID> -R nmhjklnm/cue-command` to inspect the failing step.
72+
73+
- **Merge button disabled / merge method rejected**
74+
- The ruleset allows only `squash` / `rebase`; merge commits are not allowed.
75+
- Selecting a disallowed merge method in the UI will be blocked by the rules.
76+
77+
- **Conflicts / need to sync with `main`**
78+
- Update your branch with the latest `main` (rebase or merge per team preference).
79+
- After resolving conflicts, push again and CI will rerun.
80+
81+
- **Useful gh commands**
82+
- View PR: `gh pr view <PR_NUMBER> -R nmhjklnm/cue-command`
83+
- View diff: `gh pr diff <PR_NUMBER> -R nmhjklnm/cue-command`
84+
- View checks: `gh pr checks <PR_NUMBER> -R nmhjklnm/cue-command`
85+
- List main runs: `gh run list -R nmhjklnm/cue-command --branch main`

0 commit comments

Comments
 (0)