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

Merge development into main #33

Merged
merged 36 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ab95741
feat: SDK and command interface
whilefoo Nov 20, 2024
b27aad9
fix: cross-env
whilefoo Nov 20, 2024
e8c7724
fix: cross-env
whilefoo Nov 20, 2024
4ef4156
chore: upgrade sdk
whilefoo Nov 24, 2024
b71ef15
fix: contributor's pull-requests do not get merged automatically
gentlementlegen Nov 25, 2024
ef290fe
chore: updated deploy script
gentlementlegen Nov 25, 2024
27d0027
chore: updated deploy script
gentlementlegen Nov 25, 2024
b34e5c1
chore: moved to bun
gentlementlegen Nov 25, 2024
932cef4
chore: renamed plugin-inputs.ts to plugin-input.ts
gentlementlegen Nov 25, 2024
a17d8c4
chore: updated manifest.json and dist build
github-actions[bot] Nov 25, 2024
43f30d4
fix: console log
whilefoo Nov 25, 2024
4001255
Merge pull request #27 from ubiquity-whilefoo/command-interface
gentlementlegen Nov 25, 2024
cbce2c9
Merge branch 'development' into fix/contributor-approvals
gentlementlegen Nov 25, 2024
f519024
chore: updated manifest.json and dist build
github-actions[bot] Nov 25, 2024
c37c2ea
chore: fix cspell
gentlementlegen Nov 25, 2024
4eae211
Merge pull request #28 from gentlementlegen/fix/contributor-approvals
gentlementlegen Nov 25, 2024
ee41eea
chore: fix plugin token in Action
gentlementlegen Nov 25, 2024
9c8df86
chore: fix plugin token in Action
gentlementlegen Nov 25, 2024
bd2f03e
fix: formatting and deploy
whilefoo Nov 25, 2024
ac635d1
chore: updated manifest.json and dist build
github-actions[bot] Nov 25, 2024
4ee151c
feat: formatting checks
whilefoo Nov 25, 2024
69c1ced
fix(config): add descriptions to JSON schema properties
Keyrxng Nov 26, 2024
1f20c17
chore: updated manifest.json and dist build
ubqbot[bot] Nov 26, 2024
e113aa1
chore: remove node
whilefoo Nov 26, 2024
14ad597
fix: knip
whilefoo Nov 26, 2024
c89cb63
Merge pull request #29 from ubiquity-whilefoo/deploy-fix
gentlementlegen Nov 27, 2024
2fbe7b1
fix: add environment
whilefoo Nov 27, 2024
a9079f9
Merge pull request #31 from ubiquity-whilefoo/deploy-fix
gentlementlegen Nov 27, 2024
bb7b653
chore: config examples
Keyrxng Nov 27, 2024
e3fc81b
chore: updated manifest.json and dist build
ubqbot[bot] Nov 27, 2024
10d56bd
Merge remote-tracking branch 'upstream/development' into development
Keyrxng Nov 27, 2024
18f3254
chore: updated manifest.json and dist build
ubqbot[bot] Nov 27, 2024
a2b901c
fix: manifest name
Keyrxng Nov 28, 2024
0004a4b
Merge pull request #32 from ubq-testing/fix/manifest-name
gentlementlegen Nov 29, 2024
4298993
Merge pull request #30 from ubq-testing/development
gentlementlegen Nov 29, 2024
9bfa5e8
chore: reformat plugin-input.ts
gentlementlegen Nov 30, 2024
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
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts", "eslint.config.mjs"],
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts", "eslint.config.mjs", "dist"],
"useGitignore": true,
"language": "en",
"words": ["Nektos", "dataurl", "devpool", "outdir", "servedir", "Supabase", "SUPABASE", "typebox", "ubiquibot", "Smee", "typeorm", "timespan", "mswjs"],
Expand Down
4 changes: 2 additions & 2 deletions .github/knip.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
entry: ["build/index.ts"],
entry: ["src/action.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"],
ignoreExportsUsedInFile: true,
// eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier"],
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "ts-node"],
eslint: true,
};

Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,25 @@ on:
description: "Ref"
signature:
description: "The kernel signature"
command:
description: "Command"

jobs:
compute:
name: "Automated Merging"
runs-on: ubuntu-latest
permissions: write-all
environment: ${{ github.ref == 'refs/heads/main' && 'main' || 'development' }}

steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache

- run: ${{ toJSON(inputs) }}
shell: cat {0}

- name: Execute directive
uses: ./
env:
KERNEL_PUBLIC_KEY: ${{ secrets.KERNEL_PUBLIC_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLUGIN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ubiquity/action-conventional-commits@master
24 changes: 0 additions & 24 deletions .github/workflows/cspell.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/formatting-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Formatting Check

on:
push:

jobs:
format-check:
name: Check for formatting errors
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install toolchain
run: bun install --frozen-lockfile

- name: Eslint
run: bun run eslint --fix-dry-run

- name: Cspell
run: bun run format:cspell

- name: Prettier
run: bun run prettier --check .
6 changes: 2 additions & 4 deletions .github/workflows/jest-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ jobs:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: "20.10.0"
- uses: oven-sh/setup-bun@v2

- uses: actions/checkout@master
with:
fetch-depth: 0

- name: Jest With Coverage
run: yarn install --immutable --immutable-cache --check-cache && yarn test
run: bun install --frozen-lockfile && bun run test

- name: Add Jest Report to Summary
if: always()
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.10.0
- uses: oven-sh/setup-bun@v2

- name: Install toolchain
run: yarn install
run: bun install --frozen-lockfile

- name: Store PR number
run: echo ${{ github.event.number }} > pr-number.txt

- name: Run Knip
run: yarn knip || yarn knip --reporter json > knip-results.json
run: bun run knip || bun run knip --reporter json > knip-results.json

- name: Upload knip result
if: failure()
Expand Down
53 changes: 8 additions & 45 deletions .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,21 @@
name: "Update Configuration"
name: "Update Configuration and Build"

on:
workflow_dispatch:
push:

jobs:
update:
name: "Update Configuration in manifest.json"
name: "Update Configuration & Build"
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
- uses: ubiquity-os/action-deploy-plugin@main
with:
node-version: "20.10.0"

- name: Install deps and run configuration update
run: |
yarn install --immutable --immutable-cache --check-cache
yarn tsc --noCheck --project tsconfig.json

- name: Update manifest configuration using GitHub Script
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');

const { pluginSettingsSchema } = require('./src/types');

const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json');
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));

const configuration = JSON.stringify(pluginSettingsSchema);

manifest["configuration"] = JSON.parse(configuration);

const updatedManifest = JSON.stringify(manifest, null, 2)
console.log('Updated manifest:', updatedManifest);
fs.writeFileSync(manifestPath, updatedManifest);

- name: Commit and Push generated types
run: |
git config --global user.name 'ubiquity-os[bot]'
git config --global user.email 'ubiquity-os[bot]@users.noreply.github.com'
git add ./manifest.json
if [ -n "$(git diff-index --cached --name-only HEAD)" ]; then
git commit -m "chore: updated generated configuration" || echo "Lint-staged check failed"
git push origin HEAD:${{ github.ref_name }}
else
echo "No changes to commit"
fi
treatAsEsm: true
sourcemap: false
pluginEntry: "${{ github.workspace }}/src/action.ts"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit "$1"
bun commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
bun lint-staged
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
coverage/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on the association of the pull-request author.
mergeTimeout:
collaborator: "3.5 days" # defaults to 3.5 days
contributor: "7 days" # defaults to 7 days
repos:
repos:
monitor: ["ubiquibot/automated-merging"]
ignore: ["ubiquibot/automated-merging"]
allowedReviewerRoles: ["COLLABORATOR", "MEMBER", "OWNER"]
Expand All @@ -26,5 +26,5 @@ on the association of the pull-request author.
## Testing

```shell
yarn test
bun test
```
11 changes: 2 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,5 @@ outputs:
description: "Conditionally merge pull requests after a timeout."
value: ${{ steps.main.outputs.result }}
runs:
using: "composite"
steps:
- run: |
yarn --cwd ${{ github.action_path }} --production=true
id: install
shell: bash
- run: yarn --cwd ${{ github.action_path }} start
shell: bash
id: main
using: "node20"
main: "dist/index.js"
Binary file added bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default tsEslint.config({
"@typescript-eslint": tsEslint.plugin,
"check-file": checkFile,
},
ignores: [".github/knip.ts"],
ignores: [".github/knip.ts", ".wrangler/**/*.ts", ".wrangler/**/*.js", "dist/**", "eslint.config.mjs"],
extends: [eslint.configs.recommended, ...tsEslint.configs.recommended, sonarjs.configs.recommended],
languageOptions: {
parser: tsEslint.parser,
Expand Down
10 changes: 0 additions & 10 deletions jest.config.json

This file was deleted.

27 changes: 27 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { Config } from "jest";

const cfg: Config = {
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
},
],
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
coveragePathIgnorePatterns: ["node_modules", "mocks"],
collectCoverage: true,
coverageReporters: ["json", "lcov", "text", "clover", "json-summary"],
reporters: ["default", "jest-junit", "jest-md-dashboard"],
coverageDirectory: "coverage",
testTimeout: 20000,
roots: ["<rootDir>", "tests"],
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
setupFilesAfterEnv: ["dotenv/config"],
};

export default cfg;
Loading
Loading