Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Update deps #486

Merged
merged 27 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 20 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
11 changes: 6 additions & 5 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '20.x'
- run: npm install
- run: npm run build
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- run: pnpm install
- run: pnpm run build

# Go through all open PRs and run the bot over them
- run: node ./dist/run.js
Expand All @@ -28,5 +29,5 @@ jobs:
permissions:
actions: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: gautamkrishnar/keepalive-workflow@14b7c72e9af14bddbbc1022a6f0bd20b1eac2619 # v2.0.0
22 changes: 12 additions & 10 deletions .github/workflows/master_dtmergebot2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Node ${{ env.NODE_VERSION }} Environment
uses: actions/setup-node@v3
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: ${{ env.NODE_VERSION }}

- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0

- name: 'Resolve Project Dependencies Using Npm'
shell: bash
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
npm install
npm run build --if-present
npm run test --if-present
npm prune --production
pnpm install
pnpm run --if-present build
pnpm run --if-present test
pnpm prune --prod
popd

- name: Zip artifact for deployment
run: zip release.zip ./* -r

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: node-app
path: release.zip
Expand All @@ -55,22 +57,22 @@ jobs:

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.1
with:
name: node-app

- name: Unzip artifact for deployment
run: unzip release.zip

- name: Login to Azure
uses: azure/login@v1
uses: azure/login@8c334a195cbb38e46038007b304988d888bf676a # v2.0.0
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_F48D2355658C4BA982E5F494D5C5CF7E }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_D6BE3FFD6BCF49F49E487BF36A42D2CF }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_FCA8F48ECEE2498486BBAE81FF556731 }}

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
uses: Azure/functions-action@238dc3c45bb1b04e5d16ff9e75cddd1d86753bd6 # v1.5.1
id: fa
with:
app-name: 'dtmergebot2'
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/print-tree.js

This file was deleted.

21 changes: 12 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '20.x'
- run: npm install
- run: npm run lint
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- run: pnpm install
- run: pnpm run lint
- run: pnpm knip
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '20.x'
- run: npm install
- run: npm run build
- run: npm test
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- run: pnpm install
- run: pnpm run build
- run: pnpm test
15 changes: 15 additions & 0 deletions .knip.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": [
"src/run.ts",
"src/commands/*.ts",
"src/functions/*.ts",
"src/scripts/*.ts",
"src/_tests/testEnvironment.js"
],
"project": [
"**/*.{js,ts,tsx}"
],
"ignore": ["src/queries/schema/**", "dist/**"],
"ignoreExportsUsedInFile": true
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"azureFunctions.projectLanguage": "TypeScript",
"azureFunctions.projectRuntime": "~3",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "npm prune"
"azureFunctions.preDeployTask": "pnpm prune"
}
20 changes: 10 additions & 10 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
"command": "host start",
"problemMatcher": "$func-watch",
"isBackground": true,
"dependsOn": "npm build"
"dependsOn": "pnpm build"
},
{
"type": "shell",
"label": "npm build",
"command": "npm run build",
"dependsOn": "npm install",
"label": "pnpm build",
"command": "pnpm run build",
"dependsOn": "pnpm install",
"problemMatcher": "$tsc"
},
{
"type": "shell",
"label": "npm install",
"command": "npm install"
"label": "pnpm install",
"command": "pnpm install"
},
{
"type": "shell",
"label": "npm prune",
"command": "npm prune --production",
"dependsOn": "npm build",
"label": "pnpm prune",
"command": "pnpm prune --prod",
"dependsOn": "pnpm build",
"problemMatcher": []
}
]
}
}
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ git clone https://github.com/DefinitelyTyped/dt-mergebot.git
cd dt-mergebot

# Deps
npm install
pnpm install

# Validate it works
npm test
pnpm test
```

# How the app works
Expand Down Expand Up @@ -60,12 +60,12 @@ Then to run locally you'll need to install the [Azure Functions cli](https://doc

```sh
# Build
npm run build
pnpm run build

# Run the CLI to see what would happen to an existing PR
npm run single-info -- [PR_NUM]
pnpm run single-info -- [PR_NUM]
# or
npm run single-info-debug -- [PR_NUM]
pnpm run single-info-debug -- [PR_NUM]
```

### If you update any queries
Expand All @@ -74,7 +74,7 @@ Run this to update the generate types:

```sh
# Code-gen the schema
npm run graphql-schema
pnpm run graphql-schema
```

### If you change project columns or labels
Expand All @@ -83,14 +83,14 @@ Run this to update the cached values:

```sh
# Regenerate src/_tests/cachedQueries.json
npm run update-test-data
pnpm run update-test-data
```

# Tests

```sh
# Run tests, TypeScript is transpiled at runtime
npm test
pnpm test
```

Most of the tests run against a fixtured PR, these are high level integration tests which store the PR info and then re-run the latter two phases of the app.
Expand All @@ -99,16 +99,16 @@ To create fixtures of a current PR:

```sh
# To create a fixture for PR 43161
npm run create-fixture -- 43161
pnpm run create-fixture -- 43161
```

Then you can work against these fixtures offline with:

```sh
# Watch mode for all tests
npm test -- --watch
pnpm test -- --watch
# Just run fixtures for one PR
npm test -- --testNamePattern 44299
pnpm test -- --testNamePattern 44299
```

Run a test with the debugger:
Expand All @@ -122,7 +122,7 @@ Then use "Attach to Process ID" to connect to that test runner
If your changes require re-creating all fixtures:

```sh
npm run update-all-fixtures
pnpm run update-all-fixtures
```

Be careful with this, because PRs may now be in a different state e.g. it's now merged and it used to be a specific
Expand Down
Loading
Loading