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

👽️ Update schemas #39

Merged
merged 6 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ BITBUCKET_SERVER_URL=
BITBUCKET_SERVER_TOKEN=
BITBUCKET_SERVER_TEST_PROJECT_KEY=
BITBUCKET_SERVER_TEST_PROJECT_NAME=

SKIP_BITBUCKET_CLOUD=false
SKIP_BITBUCKET_SERVER=true
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pnpm-lock.yaml linguist-generated
src/cloud/openapi/openapi-typescript.ts linguist-generated
src/cloud/openapi/swagger.v3.json linguist-generated
src/server/openapi/openapi-typescript.ts linguist-generated
src/server/openapi/swagger.v3.json linguist-generated
1 change: 0 additions & 1 deletion .github/authorized_keys

This file was deleted.

76 changes: 72 additions & 4 deletions .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: Node.js CI

on:
push:
branches: main
merge_group:
branches:
- main
pull_request:
branches: main
branches:
- main
push:
branches:
- main

jobs:
test:
Expand Down Expand Up @@ -39,7 +44,8 @@ jobs:
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
- run: pnpm run build --noEmit
- run: pnpm run lint
- run: pnpm run test run

- run: pnpm run test
if: github.actor != 'dependabot[bot]'
env:
BITBUCKET_CLOUD_USERNAME: ${{ secrets.BITBUCKET_CLOUD_USERNAME }}
Expand All @@ -48,3 +54,65 @@ jobs:
BITBUCKET_SERVER_TOKEN: ${{ secrets.BITBUCKET_SERVER_TOKEN }}
BITBUCKET_SERVER_TEST_PROJECT_KEY: ${{ vars.BITBUCKET_SERVER_TEST_PROJECT_KEY }}
BITBUCKET_SERVER_TEST_PROJECT_NAME: ${{ vars.BITBUCKET_SERVER_TEST_PROJECT_NAME }}

fix:
runs-on: ubuntu-latest

permissions:
contents: write

needs:
- test

if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act'

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: latest

- run: |
pnpm install --fix-lockfile --no-frozen-lockfile
git add .
- id: commit-lockfile
uses: qoomon/actions--create-commit@v1
with:
message: |
📌 pnpm install --fix-lockfile

[dependabot skip]
skip-empty: true

- run: |
pnpm run format
git add .
- id: commit-format
uses: qoomon/actions--create-commit@v1
with:
message: |
🎨 pnpm run format

[dependabot skip]
skip-empty: true

- run: |
pnpm run lint:fix
git add .
- id: commit-lint
uses: qoomon/actions--create-commit@v1
with:
message: |
🚨 pnpm run lint:fix

[dependabot skip]
skip-empty: true

- if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit
run: git push
9 changes: 1 addition & 8 deletions .github/workflows/pnpm-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.CODERABBIT_NPM_TOKEN }}

- run: pnpm pack --pack-gzip-level 9
- name: Sign
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.DEPLOY_KEY_PRIVATE }}'
echo '${{ vars.DEPLOY_KEY_PUBLIC }}' > '${{ runner.temp }}/DEPLOY_KEY_PUBLIC.pub'
ssh-keygen -Y sign -f '${{ runner.temp }}/DEPLOY_KEY_PUBLIC.pub' -n file coderabbitai-bitbucket-*.tgz
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
- run: gh release upload ${{ github.ref_name }} coderabbitai-bitbucket-*.tgz coderabbitai-bitbucket-*.tgz.sig
- run: gh release upload ${{ github.ref_name }} coderabbitai-bitbucket-*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 13 additions & 23 deletions .github/workflows/pnpm-version-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,25 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY_PRIVATE }}
ref: ${{ github.ref }}
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: latest
- name: Configure Git, patch, release and push
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'

git config commit.gpgsign true
git config gpg.format ssh
git config push.gpgSign 'if-asked'
git config tag.gpgSign true
git config user.signingkey 'key::${{ vars.DEPLOY_KEY_PUBLIC }}'

eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.DEPLOY_KEY_PRIVATE }}'
- id: patch
run: |
echo "VERSION=$(pnpm version patch --no-git-tag-version)" >> "$GITHUB_OUTPUT"
git add .

VERSION=$(pnpm version patch --no-git-tag-version)
- id: commit
uses: qoomon/actions--create-commit@v1
with:
message: 🔖 ${{ steps.patch.outputs.VERSION }}

git commit --all --message "🔖 $VERSION"
git tag --annotate --message "🔖 $VERSION" --sign $VERSION
- run: |
git push
git push --tags

gh release create $VERSION --generate-notes --title $VERSION --verify-tag
gh release create "$VERSION" --generate-notes --target "$COMMIT" --title "$VERSION"
env:
COMMIT: ${{ steps.commit.outputs.commit }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.patch.outputs.VERSION }}
33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
"scripts": {
"build": "tsc",
"clean": "rm -rf dist docs node_modules tsconfig.tsbuildinfo",
"dev": "tsx ./src/main.ts",
"dev": "node ./src/main.ts",
"docs": "typedoc",
"format": "prettier --write .",
"lint": "eslint . && markdownlint-cli2 \"**/*.md\" && prettier --check .",
"lint:fix": "eslint --fix --quiet .; markdownlint-cli2 \"**/*.md\" --fix; prettier --list-different --write .",
"start": "node dist/main.js",
"test": "vitest",
"test": "vitest run",
"test:watch": "vitest",
"openapi-typescript": "pnpm run openapi-typescript:cloud && pnpm run openapi-typescript:server",
"preopenapi-typescript:cloud": "curl --output ./src/cloud/openapi/swagger.v3.json https://dac-static.atlassian.com/cloud/bitbucket/swagger.v3.json",
"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",
Expand All @@ -49,24 +50,24 @@
"postopenapi-typescript:server": "ts-autofix ./src/server/openapi && pnpm run lint:fix"
},
"dependencies": {
"openapi-fetch": "^0.13.0"
"openapi-fetch": "^0.13.4"
},
"devDependencies": {
"@eslint/js": "^9.14.0",
"@types/node": "^22.9.0",
"dotenv": "^16.4.5",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.12.0",
"@eslint/js": "^9.21.0",
"@natoboram/load_env": "^1.0.0",
"@types/node": "^22.13.5",
"dotenv": "^16.4.7",
"eslint": "^9.21.0",
"eslint-config-prettier": "^10.0.2",
"globals": "^16.0.0",
"markdownlint-cli2": "^0.17.2",
"openapi-typescript": "^7.4.2",
"prettier": "^3.3.3",
"openapi-typescript": "^7.6.1",
"prettier": "^3.5.2",
"ts-autofix": "^1.0.0",
"tsx": "^4.19.2",
"typedoc": "^0.27.6",
"typescript": "5.7.3",
"typescript-eslint": "^8.13.0",
"vitest": "^3.0.4"
"typedoc": "^0.27.9",
"typescript": "5.8.1-rc",
"typescript-eslint": "^8.25.0",
"vitest": "^3.0.7"
},
"type": "module",
"exports": {
Expand Down
Loading
Loading