From 9ac7fb5b3174d7dd1a90d822950ea47fd22db640 Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Thu, 21 May 2026 15:52:00 -0700 Subject: [PATCH 1/4] Migrate CI/CD from GitHub Actions to Forgejo Actions - Move workflows from .github/ to .forgejo/ so they only run on Forgejo - Replace styfle/cancel-workflow-action with native concurrency block - Use full GitHub URLs for all third-party actions to bypass mirror - Switch Docker layer cache from type=gha to type=registry - Drop label-subissues workflow (relies on GitHub-specific GraphQL API) - Add timeout-minutes to all jobs; cancel-in-progress only for non-main branches Co-Authored-By: Claude Sonnet 4.6 --- {.github => .forgejo}/workflows/deploy.yml | 47 ++++++++++------------ .github/workflows/label-subissues.yaml | 35 ---------------- 2 files changed, 22 insertions(+), 60 deletions(-) rename {.github => .forgejo}/workflows/deploy.yml (77%) delete mode 100644 .github/workflows/label-subissues.yaml diff --git a/.github/workflows/deploy.yml b/.forgejo/workflows/deploy.yml similarity index 77% rename from .github/workflows/deploy.yml rename to .forgejo/workflows/deploy.yml index b62eaea..393deb7 100644 --- a/.github/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -5,21 +5,18 @@ on: - main pull_request: {} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + permissions: - actions: write contents: read jobs: - cancel: - name: ๐Ÿ›‘ Cancel Previous Runs - runs-on: ubuntu-latest - steps: - - uses: styfle/cancel-workflow-action@0.12.1 - test: name: ๐Ÿงช Test - needs: [cancel] runs-on: ubuntu-latest + timeout-minutes: 20 services: postgres: @@ -38,10 +35,10 @@ jobs: steps: - name: โฌ‡๏ธ Checkout repo - uses: actions/checkout@v4 + uses: https://github.com/actions/checkout@v4 - name: โŽ” Setup node - uses: actions/setup-node@v4 + uses: https://github.com/actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: 'npm' @@ -57,14 +54,14 @@ jobs: typecheck: name: สฆ TypeScript - needs: [cancel] runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: โฌ‡๏ธ Checkout repo - uses: actions/checkout@v4 + uses: https://github.com/actions/checkout@v4 - name: โŽ” Setup node - uses: actions/setup-node@v4 + uses: https://github.com/actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: 'npm' @@ -77,14 +74,14 @@ jobs: lint: name: ๐Ÿ” Lint - needs: [cancel] runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: โฌ‡๏ธ Checkout repo - uses: actions/checkout@v4 + uses: https://github.com/actions/checkout@v4 - name: โŽ” Setup node - uses: actions/setup-node@v4 + uses: https://github.com/actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: 'npm' @@ -98,42 +95,42 @@ jobs: build: name: ๐Ÿณ Build needs: [test, typecheck, lint] - # only build/deploy main branch on pushes if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} runs-on: ubuntu-latest + timeout-minutes: 30 steps: - name: โฌ‡๏ธ Checkout repo - uses: actions/checkout@v4 + uses: https://github.com/actions/checkout@v4 - name: ๐Ÿณ Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: https://github.com/docker/setup-buildx-action@v3 - name: ๐Ÿ”“ Login to Container Registry - uses: docker/login-action@v3 + uses: https://github.com/docker/login-action@v3 with: registry: ${{ vars.CONTAINER_REGISTRY }} username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - name: ๐Ÿ—„๏ธ Build and Push to Container Registry - uses: docker/build-push-action@v5 + uses: https://github.com/docker/build-push-action@v5 with: context: . push: true tags: ${{ vars.CONTAINER_REGISTRY }}/brackt:latest - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ vars.CONTAINER_REGISTRY }}/brackt:buildcache + cache-to: type=registry,ref=${{ vars.CONTAINER_REGISTRY }}/brackt:buildcache,mode=max deploy: name: ๐Ÿš€ Deploy runs-on: ubuntu-latest + timeout-minutes: 10 needs: [build] - # only deploy main branch on pushes if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} steps: - name: ๐Ÿš€ Deploy app to server - uses: appleboy/ssh-action@v1.0.3 + uses: https://github.com/appleboy/ssh-action@v1.0.3 env: REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} diff --git a/.github/workflows/label-subissues.yaml b/.github/workflows/label-subissues.yaml deleted file mode 100644 index fb67e66..0000000 --- a/.github/workflows/label-subissues.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Label Subissues -on: - issues: - types: [opened, edited] - -jobs: - apply-label: - runs-on: ubuntu-latest - permissions: - issues: write - steps: - - name: Check for Parent and Label - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_NODE_ID: ${{ github.event.issue.node_id }} - run: | - # Use GraphQL to check if this issue has a parent - PARENT_ID=$(gh api graphql -f query=' - query($id: ID!) { - node(id: $id) { - ... on Issue { - parent { - id - } - } - } - }' -f id=$ISSUE_NODE_ID --jq '.data.node.parent.id') - - # If PARENT_ID is not null, it is a subissue - if [ "$PARENT_ID" != "null" ] && [ -n "$PARENT_ID" ]; then - echo "Subissue detected. Applying label..." - gh issue edit ${{ github.event.issue.number }} --add-label "subissue" - else - echo "This is a top-level issue." - fi From 0b8f7edc08a441bea2df31af72bf7190f61d7295 Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Thu, 21 May 2026 16:14:27 -0700 Subject: [PATCH 2/4] Fix postgres service for Forgejo Docker runner Remove host port binding (conflicts with local postgres on runner) and use service name hostname instead of localhost for DATABASE_URL. Co-Authored-By: Claude Sonnet 4.6 --- .forgejo/workflows/deploy.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 393deb7..830e133 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -30,8 +30,6 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - ports: - - 5432:5432 steps: - name: โฌ‡๏ธ Checkout repo @@ -49,7 +47,7 @@ jobs: - name: ๐Ÿงช Run unit tests run: npm run test:run env: - DATABASE_URL: postgresql://test:test@localhost:5432/brackt_test + DATABASE_URL: postgresql://test:test@postgres:5432/brackt_test NODE_OPTIONS: --max-old-space-size=4096 typecheck: From 2192f1790dc0027d2075cb5f93e4e2b80073738a Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Thu, 21 May 2026 17:01:02 -0700 Subject: [PATCH 3/4] Add oxlint config and fix unicorn/no-array-sort violation Promote unicorn/no-array-sort to error in oxlint.json and replace [...teams].sort() with teams.toSorted() in discord.ts. Co-Authored-By: Claude Sonnet 4.6 --- app/services/discord.ts | 2 +- oxlint.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 oxlint.json diff --git a/app/services/discord.ts b/app/services/discord.ts index 8c8eda5..d9d6091 100644 --- a/app/services/discord.ts +++ b/app/services/discord.ts @@ -208,7 +208,7 @@ export async function sendDraftOrderNotification({ ? `Draft Order Manually Set โ€” ${leagueName}` : `Draft Order Randomized โ€” ${leagueName}`; - const sorted = [...teams].sort((a, b) => a.position - b.position); + const sorted = teams.toSorted((a, b) => a.position - b.position); let description = sorted .map((t) => { const teamLabel = escapeMarkdown(t.name); diff --git a/oxlint.json b/oxlint.json new file mode 100644 index 0000000..91c983e --- /dev/null +++ b/oxlint.json @@ -0,0 +1,5 @@ +{ + "rules": { + "unicorn/no-array-sort": "error" + } +} From b9a1ea2cb4424637a6982fa45dd34ad028de5778 Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Thu, 21 May 2026 17:04:12 -0700 Subject: [PATCH 4/4] Remove setup-node from CI jobs Node 20 is already in the node:20-bookworm runner image; setup-node was hanging ~5min trying to reach an unconfigured npm cache service. Co-Authored-By: Claude Sonnet 4.6 --- .forgejo/workflows/deploy.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 830e133..84ab00d 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -35,12 +35,6 @@ jobs: - name: โฌ‡๏ธ Checkout repo uses: https://github.com/actions/checkout@v4 - - name: โŽ” Setup node - uses: https://github.com/actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'npm' - - name: ๐Ÿ“ฅ Install dependencies run: npm ci @@ -58,12 +52,6 @@ jobs: - name: โฌ‡๏ธ Checkout repo uses: https://github.com/actions/checkout@v4 - - name: โŽ” Setup node - uses: https://github.com/actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'npm' - - name: ๐Ÿ“ฅ Install dependencies run: npm ci @@ -78,12 +66,6 @@ jobs: - name: โฌ‡๏ธ Checkout repo uses: https://github.com/actions/checkout@v4 - - name: โŽ” Setup node - uses: https://github.com/actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'npm' - - name: ๐Ÿ“ฅ Install dependencies run: npm ci