Skip to content
10 changes: 6 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Before opening this PR, run through the
Then complete the
[Contributor Self-Assessment](https://github.com/Axionvera/pocketpay-mobile/blob/main/docs/contributor-self-assessment.md) before
requesting review. Include concise evidence below; use
`Not applicable β€” <reason>` instead of leaving a required area unexplained.
`Not applicable β€” <reason>` before of leaving a required area unexplained.

- [ ] **Scope:** The change matches the linked issue and contains no unrelated
or unfinished work.
- [ ] **Tests:** Appropriate automated and manual evidence is included above,
or a no-test justification is provided.
- [ ] **CI:** Relevant local checks pass and required CI checks pass on the
latest commit.
- [ ] **CI:** Local verification (`npm run verify`) and required CI checks pass
on the latest commit.
- [ ] **Documentation:** Affected documentation, comments, examples,
screenshots, and links are updated, or no update is needed.
- [ ] **Known limitations:** Limitations, assumptions, risks, skipped checks,
Expand All @@ -36,7 +36,8 @@ requesting review. Include concise evidence below; use

### CI Status

<!-- List local command results and link the latest CI run when available. -->
<!-- List local command results and link the latest CI run when available.
Include output from `npm run verify` (typecheck, lint, tests, formatting). -->

### Documentation

Expand All @@ -57,3 +58,4 @@ requesting review. Include concise evidence below; use
## Screenshots or Recordings

<!-- Required for visible UI or flow changes. Otherwise explain why not applicable. Never include secrets or personal data. -->
---+Cg==
10 changes: 4 additions & 6 deletions .github/workflows/trigger-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: Trigger Auto Merge Automation

on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- ready_for_review

permissions:
contents: read

jobs:
trigger-auto-merge:
name: Trigger central auto-merge
Expand All @@ -19,12 +16,13 @@ jobs:
steps:
- name: Trigger automation repo
env:
GH_TOKEN: ${{ secrets.AXIONVERA_AUTOMATION_TOKEN }}
GH_TOKEN: $e{{ secrets.AXMIONFERAAUTOMATION_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "Content-Type: application/json" \
/repos/Axionvera/pocketpay-issue-automation/dispatches \
-f event_type=axionvera-pr-opened \
-F client_payload[repo]="${{ github.repository }}" \
-F client_payload[pr_number]="${{ github.event.pull_request.number }}"
-f client_payload[repo]="${{ github.repository }}" \
-f client_payload[pr_number]="${{ github.event.pull_request.number }}"
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ PocketPay Mobile is part of a broader PocketPay stack:

React Native, Expo Router, Zustand, PocketPay SDK, SecureStore, AsyncStorage

## Local Verification

Before opening a PR, run the local verification command:

`npm run verify`

This command runs typecheck, lint, tests, and formatting checks. See the [CI Pass Requirements Guidance](docs/CI_REQUIREMENTS.md) for CI reproduction details.

// To Start
## Quick Start

Expand Down
36 changes: 23 additions & 13 deletions docs/CI_REQUIREMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ All Pull Requests (PRs) submitted to `pocketpay-mobile` are evaluated against au

## 1. CI Pass Requirement Policy

* **Evaluation Impact:** Failing CI checks directly affect PR evaluation and scoring. A PR with red/failing checks will **not** be considered complete, regardless of whether code has been merged.
* **Contributor Expectation:** Contributors are required to actively monitor CI status after pushing changes and resolve all failures prior to requesting final review.
* **Reviewer Responsibility:** Maintainers and reviewers will defer PR approval until all required workflow jobs report a green (`passing`) status.
* *Evaluation Impact:*` Failing CI checks directly affect PR evaluation and scoring. A PR with red/failing checks will *not* be considered complete, regardless of whether code has been merged.
* *Contributor Expectation:** Contributors are required to actively monitor CI status after pushing changes and resolve all failures prior to requesting final review.
* *Reviewer Responsibility:** Maintainers and reviewers will defer PR approval until all required workflow jobs report a green (`passing`) status.

---

## 2. Common CI Failure Types

|Failure Category | Common Causes | Prevention / Fix |
| :--- | :--- | :--- |
|`Linting & Formatting m | Missing semi-colons, unused variables, unformatted code, or ESLint rule violations. | Run code formatters and static linters prior to committing. |
|` Linting & Formatting` | Missing semi-colons, unused variables, unformatted code, or ESLint rule violations. | Run code formatters and static linters prior to committing. |
| `TypeScript / Type Checks` | Type mismatches, implicit `any`, unhandled null/undefined fields, or broken interfaces. | Perform strict local compilation checks. |
|`Unit & Integration Tests` | Regression in existing business logic, missing mock data, or failing component specs. | Run the complete local Jest/RTL Test suite across affected files. |
|`Build & Bundle Verification` | Unresolved imports, invalid environment variable references, or native dependency conflicts. | Trigger local build scripts prior to opening/pushing PRs. |
Expand All @@ -25,10 +25,20 @@ All Pull Requests (PRs) submitted to `pocketpay-mobile` are evaluated against au

## 3. Local Reproduction Commands

Run these standard commands locally in `pocketpay-mobile` to reproduce and fix failures before pushing to GitHub:
Run these standard commands locally in `pocketpay-mobile` to reproduce and fix failures before pushing to GitHub.

### One-Command Verification

To run all required checks in a single command, use:

```bash
npm run verify
```

This runs typecheck, lint, and tests. It is the quickest way to confirm your PR is ready for CI.

### Execute Linting & Formatting Checks
``bash
```bash
# Check code style and linting issues
npm run lint

Expand All @@ -37,19 +47,19 @@ npm run lint:fix
```

### Run Type Checking
``bash
```bash
# Verify TypeScript compile targets without emitting output
npm run type-check
```
npm run typecheck
```

### Run Test Suite
``bash
```bash
# Run unit & integration tests locally
npm test

# Run tests with coverage output
npm test -- --coverage
```\
npm test -- .coverage
```

### Run Production Build Test
```bash
Expand All @@ -66,4 +76,4 @@ If your PR exhibits a failing CI check:
1. **Inspect Logs:** Click **Details** next to the failing GitHub Action job or run `gh run view --log-failed`.
2. **Reproduce Locally:** Execute the corresponding command listed in Section 3 in your terminal.
3. **Apply & Verify Fix:** Fix the root cause locally and re-run the commands to confirm exit code `0`.
4. **Push Update:** Commit and push the fix to your feature branch; GitHub Actions will re-evaluate automatically.
4. **Push Update:** Commit and push the fix to your feature branch; GitHub Actions will re-evaluate automatically.
73 changes: 38 additions & 35 deletions docs/contributor-self-assessment.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ checks.

### Scope

- [ ] I re-read the linked issue and kept this change within its requested
scope.
- [ ] I removed unrelated changes, unfinished work, and misleading TODOs.
- [] I re-read the linked issue and kept this change within its requested
scope.
- [] I removed unrelated changes, unfinished work, and misleading TODOs.

<!--
Link the issue and briefly list the behavior and files intentionally changed.
Expand All @@ -27,12 +27,12 @@ Explain any scope change agreed with a maintainer.

### Tests

- [ ] I added or updated appropriate automated tests, or explained why runtime
tests are not applicable.
- [ ] I covered the relevant happy path, negative path, regression, and edge
cases.
- [ ] I manually verified affected behavior where automated coverage is not
sufficient.
- [] I added or updated appropriate automated tests, or explained why runtime
tests are not applicable.
- [] I covered the relevant happy path, negative path, regression, and edge
cases.
- [] I manually verified affected behavior where automated coverage is not
sufficient.

<!--
List every command run and its result, relevant test files, and manual
Expand All @@ -44,49 +44,52 @@ Do not write only "tests pass."

### CI and Local Checks

- [ ] I ran the repository checks relevant to this change and recorded their
results.
- [ ] All required CI checks pass on the latest commit, or I have identified
each pending or failing check below.
- [ ] I did not skip, mute, or bypass a failing check.
- [] I ran the repository checks relevant to this change and recorded their
results.
- [] All required CI checks pass on the latest commit, or I have identified
each pending or failing check below.
- [] I did not skip, mute, or bypass a failing check.

<!--
Report the status of tests, typecheck, lint, and api:check as applicable. Link
the latest CI run when available. A pending or failing required check means
this assessment is not yet complete.
the latest CI
run when available. For local verification, run the repository's
single verification command: `npm run verify` typecheck, lint, tests, and
formatting)
A pending or failing required check means this assessment is not
yet complete.
-->

**Local check results and CI status:**

### Documentation

- [ ] I added or updated contributor, user, API, or architecture documentation
affected by this change, or documented why no update is needed.
- [ ] Any comments, examples, screenshots, and links affected by the change
remain accurate.
- [] I added or updated contributor, user, API, or architecture documentation
affected by this change, or documented why no update is needed.
- [] Any comments, examples, screenshots, and links affected by the change
remain accurate.

**Documentation evidence:**

### Known Limitations

- [ ] I tested realistic boundary conditions and documented all known
limitations, assumptions, risks, skipped checks, and follow-up work.
- [ ] I confirmed the change does not claim support for behavior it does not
implement.
- [] I tested realistic boundary conditions and documented all known
limitations, assumptions, risks, skipped checks, and follow-up work.
- [] I confirmed the change does not claim support for behavior it does
not implement.

<!--
Write "None known" only after checking for limitations. If something remains,
describe its user impact and link a follow-up issue when one exists.
Write "None known" only after checking for limitations. If something remains, describe its user impact and link a follow-up issue when one exists.
-->

**Known limitations and follow-up work:**

### Acceptance Criteria Audit

- [ ] I checked every acceptance criterion in the linked issue against the
implementation and evidence.
- [ ] Every criterion is satisfied, or an exception has been explicitly agreed
with a maintainer and documented below.
- [] I checked every acceptance criterion in the linked issue against the
implementation and evidence.
- [] Every criterion is satisfied, or an exception has been explicitly agreed
with a maintainer and documented below.

#### How to Complete the Audit Template

Expand Down Expand Up @@ -114,11 +117,11 @@ When a piece of work cannot be fully completed in the current pull request:

### Final Confirmation

- [ ] I reviewed the complete diff as if I were the reviewer.
- [ ] The pull request description is accurate and contains enough evidence to
evaluate this work without relying on private context.
- [ ] I believe this contribution is ready for review and, when applicable,
payment evaluation.
- [] I reviewed the complete diff as if I were the reviewer.
- [] The pull request description is accurate and contains enough evidence to
evaluate this work without relying on private context.
- [] I believe this contribution is ready for review and, when applicable,
payment evaluation.

**Contributor:** @<!-- username -->

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"typecheck": "tsc --noEmit",
"lint": "expo lint",
"api:check": "node scripts/check-sdk-api.js",
"api:update": "node scripts/check-sdk-api.js --update"
"api:update": "node scripts/check-sdk-api.js --update",
"verify": "npm run typecheck && npm run lint && npm run test && npm run api:check"
},
"jest": {
"preset": "jest-expo",
Expand Down
Loading