Skip to content

Commit 34e10bd

Browse files
authored
Merge branch 'master' into breaking/mandatory-qualifying-earnings-fields
2 parents 519464d + 3caf5bc commit 34e10bd

24 files changed

Lines changed: 143 additions & 7672 deletions

.github/workflows/api-diff.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,32 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
test-branch-logic:
15+
test-conventional-commit-logic:
1616
runs-on: ubuntu-latest
1717
permissions:
1818
contents: read
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
22-
23-
- name: Run branch logic unit tests
22+
23+
- name: Run conventional commit logic unit tests
2424
run: ./scripts/api-diff/api-diff.test.sh
25-
25+
2626
api-diff:
2727
runs-on: ubuntu-latest
28-
needs: test-branch-logic
28+
needs: test-conventional-commit-logic
2929
permissions:
3030
contents: read
3131
pull-requests: write
32-
32+
3333
steps:
3434
- name: Checkout code
3535
uses: actions/checkout@v4
3636
with:
3737
fetch-depth: 0
38-
38+
3939
- name: Make script executable
4040
run: chmod +x scripts/api-diff/api-diff.sh
41-
41+
4242
- name: Run API diff check
43-
run: ./scripts/api-diff/api-diff.sh
43+
run: ./scripts/api-diff/api-diff.sh

.github/workflows/jira_create_issue.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/jira_update_issue_closed.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/jira_update_issue_reopen.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.spectral.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,3 @@ rules:
160160
path-params: off # Disable path parameter validation to address mapping key issues
161161
owasp:api8:2023-define-cors-origin: off # Disable CORS origin header requirement
162162
oas3-operation-security-defined: error # Ensure all scopes are listed in schema
163-
164-
overrides:
165-
- files:
166-
- "xero-practicemanager-v3-1.yaml#/paths/~1v3.1~1client.api~1paged-list/get/parameters/3"
167-
- "xero-practicemanager-v3-1.yaml#/paths/~1v3.1~1client.api~1contacts/get/parameters/3"
168-
rules:
169-
owasp:api2:2023-no-credentials-in-url: off # pageToken is a pagination token, not a credential

README.md

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
An OpenAPI (Swagger) specification for the Xero API with OAuth 2.0 security schema.
33

44
## Description
5-
This repository holds the official Xero [OpenAPI](https://www.openapis.org/) descriptions.
5+
This repository holds the official Xero [OpenAPI](https://www.openapis.org/) descriptions.
66

77
OpenAPI spec 3.0
88
In Release (used for one or more SDKs)
@@ -19,43 +19,33 @@ In Release (used for one or more SDKs)
1919

2020
## Contribution guide
2121

22-
[Conventional commit](https://www.conventionalcommits.org/en/v1.0.0/#summary) format should be used when contributing to this repo.
22+
Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) for all commits.
2323

24-
**Context:**
24+
Why this matters:
2525

26-
Release notes are generated using [semantic-release](https://github.com/semantic-release/semantic-release). In brief this package analyses all the commits in the repo to determine the next version number, generate the release notes and publish the package, hence the commit message is important for the release to happen successfully. Please read more on the conventional commit [documentation](https://www.conventionalcommits.org/en/v1.0.0/#summary) before landing your commits, each commit message will determine the release notes.
26+
- We use [semantic-release](https://github.com/semantic-release/semantic-release) to calculate versions automatically.
27+
- Consistent commit formatting keeps versioning predictable and release notes accurate.
2728

28-
**Example:**
29+
Versioning rules:
2930

30-
If your commit message is - ``feat: added a new parameter in the get_account method`` - It will do a **minor version update**.
31+
- `feat:` -> minor version bump
32+
- `fix:` -> patch version bump
33+
- `!` in the header or `BREAKING CHANGE:` footer -> major version bump
3134

32-
Following release notes will be generated -
35+
Examples:
3336

37+
```text
38+
feat(accounting): add includeArchived query parameter to GET /Accounts
3439
```
35-
Release notes
3640

37-
Feature -
38-
- added a new parameter in the get_account method
41+
```text
42+
fix(files): correct nullable schema for File.ContentLength
3943
```
4044

41-
If your commit message is - ``fix: fixed the null issue with get_invoice method`` - It will do a **patch version update**.
42-
43-
Following release notes will be generated -
44-
45-
```
46-
Release notes
47-
48-
Fix -
49-
- fixed the null issue with get_invoice method
50-
```
51-
52-
53-
if your commit message is as below it will do a **major version update** (Breaking change)
45+
```text
46+
feat(payroll-nz)!: remove deprecated EarningsRateID field from Payslip response
5447
55-
```
56-
chore!: drop support for Node 6
57-
58-
BREAKING CHANGE: use JavaScript features not available in Node 6
48+
BREAKING CHANGE: clients must use EarningsRateIdentifier instead of EarningsRateID.
5949
```
6050

6151

@@ -64,7 +54,7 @@ We are using [OpenAPI generator](https://github.com/OpenAPITools/openapi-generat
6454

6555
## Preview
6656
### Online
67-
There are lots of tools available for viewing and editing OpenAPI descriptions in a nicely formatted way. A popular tool is SwaggerHub - a version of which is [hosted here](https://app.swaggerhub.com/home).
57+
There are lots of tools available for viewing and editing OpenAPI descriptions in a nicely formatted way. A popular tool is SwaggerHub - a version of which is [hosted here](https://app.swaggerhub.com/home).
6858

6959
Once you sign up or login, you can create a new API under your account and import a Xero API spec.
7060

@@ -99,10 +89,13 @@ This repository includes automated API diff checking using [oasdiff](https://git
9989
./scripts/api-diff/api-diff.sh xero_accounting.yaml
10090
```
10191

102-
### Branch Naming Convention
103-
Branches containing `breaking` anywhere in the name will allow breaking changes without failing the build. All other branches will fail if breaking changes are detected.
92+
### Breaking Change Enforcement
93+
By default, API diff checks fail when breaking changes are detected.
94+
95+
Breaking changes are allowed only when commit messages include a Conventional Commits breaking marker:
10496

105-
**Examples:** `breaking-api-v2`, `feature-breaking-change`, `api-breaking-update`
97+
- `!` in the commit header, for example `feat!: remove deprecated endpoint`
98+
- `BREAKING CHANGE:` in the commit body/footer
10699

107100
### Full Documentation
108101
For detailed usage, configuration options, environment variables, and integration details, see [scripts/api-diff/README.md](scripts/api-diff/README.md).

manifest.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
"path": "/xero-payroll-uk.yaml",
4040
"canPreview": true
4141
},
42-
"practiceManagerV31": {
43-
"path": "/xero-practicemanager-v3-1.yaml",
44-
"canPreview": true
45-
},
4642
"projects": {
4743
"path": "/xero-projects.yaml",
4844
"canPreview": true

scripts/api-diff/README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,39 @@ Main script that compares OpenAPI specifications against the master branch.
2727
- `BASE_BRANCH` - Branch to compare against (default: `origin/master`)
2828

2929
### `api-diff.test.sh`
30-
Unit tests for the branch logic pattern matching used in GitHub Actions.
30+
Unit tests for conventional commit breaking marker detection used in GitHub Actions.
3131

3232
**Usage:**
3333
```bash
3434
./scripts/api-diff/api-diff.test.sh
3535
```
3636

3737
Tests validate that:
38-
- Branches containing `breaking` anywhere in the name are correctly identified
39-
- Other branches are handled with breaking change enforcement
38+
- Commits with `!` in the conventional commit header are correctly identified
39+
- Commits with `BREAKING CHANGE:` footer are correctly identified
40+
- Other commits are handled with breaking change enforcement
4041

4142
## Integration
4243

4344
These scripts are integrated into the GitHub Actions workflow at `.github/workflows/api-diff.yml`:
44-
- **test-branch-logic** job - Runs unit tests
45+
- **test-conventional-commit-logic** job - Runs unit tests
4546
- **api-diff** job - Runs API diff checks with conditional breaking change enforcement
4647

47-
### Branch Naming Convention
48-
The GitHub Actions workflow automatically adjusts its behavior based on branch names:
48+
### Conventional Commit Breaking Markers
49+
The API diff script automatically adjusts behavior based on commit messages:
4950

5051
**Allow Breaking Changes:**
51-
- Any branch containing `breaking` in the name
52-
- Examples: `breaking-api-v2`, `feature-breaking-change`, `api-breaking-update`
52+
- Commit header with `!`, for example: `feat!: remove deprecated endpoint`
53+
- Commit header with scope and `!`, for example: `feat(api)!: remove deprecated endpoint`
54+
- Commit body/footer containing `BREAKING CHANGE: ...`
5355
- The `--fail-on-breaking` flag is NOT passed to the script
5456

5557
**Fail on Breaking Changes:**
56-
- All other branches (main, master, develop, feature branches, etc.)
58+
- Commits without these conventional commit breaking markers
5759
- The `--fail-on-breaking` flag IS passed to the script
5860
- Build will fail if breaking changes are detected
5961

60-
This allows developers to explicitly signal when they're working on breaking changes by including `breaking` in their branch name.
62+
This keeps enforcement aligned with [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) and semantic-release expectations.
6163

6264
## Known Limitations
6365

0 commit comments

Comments
 (0)