Skip to content

Commit 07faee0

Browse files
authored
👽️ Update schemas (#39)
* ✨ Add GPG key management API * 👷 Modernize CI * 🔧 erasableSyntaxOnly * 🔧 Add .gitattributes to mark generated files * ⬆️ Upgrade all dependencies, remove tsx * ✅ Skip e2e tests on Bitbucket Server
1 parent 85ff5b9 commit 07faee0

16 files changed

+2714
-1773
lines changed

.env

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ BITBUCKET_SERVER_URL=
66
BITBUCKET_SERVER_TOKEN=
77
BITBUCKET_SERVER_TEST_PROJECT_KEY=
88
BITBUCKET_SERVER_TEST_PROJECT_NAME=
9+
10+
SKIP_BITBUCKET_CLOUD=false
11+
SKIP_BITBUCKET_SERVER=true

.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pnpm-lock.yaml linguist-generated
2+
src/cloud/openapi/openapi-typescript.ts linguist-generated
3+
src/cloud/openapi/swagger.v3.json linguist-generated
4+
src/server/openapi/openapi-typescript.ts linguist-generated
5+
src/server/openapi/swagger.v3.json linguist-generated

.github/authorized_keys

-1
This file was deleted.

.github/workflows/node.js.yaml

+72-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
name: Node.js CI
22

33
on:
4-
push:
5-
branches: main
4+
merge_group:
5+
branches:
6+
- main
67
pull_request:
7-
branches: main
8+
branches:
9+
- main
10+
push:
11+
branches:
12+
- main
813

914
jobs:
1015
test:
@@ -39,7 +44,8 @@ jobs:
3944
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
4045
- run: pnpm run build --noEmit
4146
- run: pnpm run lint
42-
- run: pnpm run test run
47+
48+
- run: pnpm run test
4349
if: github.actor != 'dependabot[bot]'
4450
env:
4551
BITBUCKET_CLOUD_USERNAME: ${{ secrets.BITBUCKET_CLOUD_USERNAME }}
@@ -48,3 +54,65 @@ jobs:
4854
BITBUCKET_SERVER_TOKEN: ${{ secrets.BITBUCKET_SERVER_TOKEN }}
4955
BITBUCKET_SERVER_TEST_PROJECT_KEY: ${{ vars.BITBUCKET_SERVER_TEST_PROJECT_KEY }}
5056
BITBUCKET_SERVER_TEST_PROJECT_NAME: ${{ vars.BITBUCKET_SERVER_TEST_PROJECT_NAME }}
57+
58+
fix:
59+
runs-on: ubuntu-latest
60+
61+
permissions:
62+
contents: write
63+
64+
needs:
65+
- test
66+
67+
if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act'
68+
69+
steps:
70+
- uses: actions/checkout@v4
71+
with:
72+
ref: ${{ github.ref }}
73+
- uses: pnpm/action-setup@v4
74+
with:
75+
version: latest
76+
- uses: actions/setup-node@v4
77+
with:
78+
cache: pnpm
79+
node-version: latest
80+
81+
- run: |
82+
pnpm install --fix-lockfile --no-frozen-lockfile
83+
git add .
84+
- id: commit-lockfile
85+
uses: qoomon/actions--create-commit@v1
86+
with:
87+
message: |
88+
📌 pnpm install --fix-lockfile
89+
90+
[dependabot skip]
91+
skip-empty: true
92+
93+
- run: |
94+
pnpm run format
95+
git add .
96+
- id: commit-format
97+
uses: qoomon/actions--create-commit@v1
98+
with:
99+
message: |
100+
🎨 pnpm run format
101+
102+
[dependabot skip]
103+
skip-empty: true
104+
105+
- run: |
106+
pnpm run lint:fix
107+
git add .
108+
- id: commit-lint
109+
uses: qoomon/actions--create-commit@v1
110+
with:
111+
message: |
112+
🚨 pnpm run lint:fix
113+
114+
[dependabot skip]
115+
skip-empty: true
116+
117+
- if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit
118+
run: git push

.github/workflows/pnpm-publish.yaml

+1-8
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ jobs:
4545
NODE_AUTH_TOKEN: ${{ secrets.CODERABBIT_NPM_TOKEN }}
4646

4747
- run: pnpm pack --pack-gzip-level 9
48-
- name: Sign
49-
run: |
50-
eval `ssh-agent -s`
51-
ssh-add - <<< '${{ secrets.DEPLOY_KEY_PRIVATE }}'
52-
echo '${{ vars.DEPLOY_KEY_PUBLIC }}' > '${{ runner.temp }}/DEPLOY_KEY_PUBLIC.pub'
53-
ssh-keygen -Y sign -f '${{ runner.temp }}/DEPLOY_KEY_PUBLIC.pub' -n file coderabbitai-bitbucket-*.tgz
54-
ssh-keygen -Y verify -f ./.github/authorized_keys -I '41898282+github-actions[bot]@users.noreply.github.com' -n file -s coderabbitai-bitbucket-*.tgz.sig < coderabbitai-bitbucket-*.tgz
55-
- run: gh release upload ${{ github.ref_name }} coderabbitai-bitbucket-*.tgz coderabbitai-bitbucket-*.tgz.sig
48+
- run: gh release upload ${{ github.ref_name }} coderabbitai-bitbucket-*.tgz
5649
env:
5750
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pnpm-version-patch.yaml

+13-23
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,25 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616
with:
17-
ssh-key: ${{ secrets.DEPLOY_KEY_PRIVATE }}
17+
ref: ${{ github.ref }}
1818
- uses: pnpm/action-setup@v4
1919
with:
2020
version: latest
21-
- uses: actions/setup-node@v4
22-
with:
23-
cache: pnpm
24-
node-version: latest
25-
- name: Configure Git, patch, release and push
26-
run: |
27-
git config user.name 'github-actions[bot]'
28-
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
29-
30-
git config commit.gpgsign true
31-
git config gpg.format ssh
32-
git config push.gpgSign 'if-asked'
33-
git config tag.gpgSign true
34-
git config user.signingkey 'key::${{ vars.DEPLOY_KEY_PUBLIC }}'
3521

36-
eval `ssh-agent -s`
37-
ssh-add - <<< '${{ secrets.DEPLOY_KEY_PRIVATE }}'
22+
- id: patch
23+
run: |
24+
echo "VERSION=$(pnpm version patch --no-git-tag-version)" >> "$GITHUB_OUTPUT"
25+
git add .
3826
39-
VERSION=$(pnpm version patch --no-git-tag-version)
27+
- id: commit
28+
uses: qoomon/actions--create-commit@v1
29+
with:
30+
message: 🔖 ${{ steps.patch.outputs.VERSION }}
4031

41-
git commit --all --message "🔖 $VERSION"
42-
git tag --annotate --message "🔖 $VERSION" --sign $VERSION
32+
- run: |
4333
git push
44-
git push --tags
45-
46-
gh release create $VERSION --generate-notes --title $VERSION --verify-tag
34+
gh release create "$VERSION" --generate-notes --target "$COMMIT" --title "$VERSION"
4735
env:
36+
COMMIT: ${{ steps.commit.outputs.commit }}
4837
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
VERSION: ${{ steps.patch.outputs.VERSION }}

package.json

+17-16
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@
3333
"scripts": {
3434
"build": "tsc",
3535
"clean": "rm -rf dist docs node_modules tsconfig.tsbuildinfo",
36-
"dev": "tsx ./src/main.ts",
36+
"dev": "node ./src/main.ts",
3737
"docs": "typedoc",
3838
"format": "prettier --write .",
3939
"lint": "eslint . && markdownlint-cli2 \"**/*.md\" && prettier --check .",
4040
"lint:fix": "eslint --fix --quiet .; markdownlint-cli2 \"**/*.md\" --fix; prettier --list-different --write .",
4141
"start": "node dist/main.js",
42-
"test": "vitest",
42+
"test": "vitest run",
43+
"test:watch": "vitest",
4344
"openapi-typescript": "pnpm run openapi-typescript:cloud && pnpm run openapi-typescript:server",
4445
"preopenapi-typescript:cloud": "curl --output ./src/cloud/openapi/swagger.v3.json https://dac-static.atlassian.com/cloud/bitbucket/swagger.v3.json",
4546
"openapi-typescript:cloud": "openapi-typescript ./src/cloud/openapi/swagger.v3.json --output ./src/cloud/openapi/openapi-typescript.ts --immutable --empty-objects-unknown --alphabetize --root-types",
@@ -49,24 +50,24 @@
4950
"postopenapi-typescript:server": "ts-autofix ./src/server/openapi && pnpm run lint:fix"
5051
},
5152
"dependencies": {
52-
"openapi-fetch": "^0.13.0"
53+
"openapi-fetch": "^0.13.4"
5354
},
5455
"devDependencies": {
55-
"@eslint/js": "^9.14.0",
56-
"@types/node": "^22.9.0",
57-
"dotenv": "^16.4.5",
58-
"eslint": "^9.14.0",
59-
"eslint-config-prettier": "^9.1.0",
60-
"globals": "^15.12.0",
56+
"@eslint/js": "^9.21.0",
57+
"@natoboram/load_env": "^1.0.0",
58+
"@types/node": "^22.13.5",
59+
"dotenv": "^16.4.7",
60+
"eslint": "^9.21.0",
61+
"eslint-config-prettier": "^10.0.2",
62+
"globals": "^16.0.0",
6163
"markdownlint-cli2": "^0.17.2",
62-
"openapi-typescript": "^7.4.2",
63-
"prettier": "^3.3.3",
64+
"openapi-typescript": "^7.6.1",
65+
"prettier": "^3.5.2",
6466
"ts-autofix": "^1.0.0",
65-
"tsx": "^4.19.2",
66-
"typedoc": "^0.27.6",
67-
"typescript": "5.7.3",
68-
"typescript-eslint": "^8.13.0",
69-
"vitest": "^3.0.4"
67+
"typedoc": "^0.27.9",
68+
"typescript": "5.8.1-rc",
69+
"typescript-eslint": "^8.25.0",
70+
"vitest": "^3.0.7"
7071
},
7172
"type": "module",
7273
"exports": {

0 commit comments

Comments
 (0)