From 07df4be133bf0514aacba86d8da46d29c0f4219a Mon Sep 17 00:00:00 2001 From: Kazz3r24 Date: Sat, 27 Sep 2025 09:50:46 -0400 Subject: [PATCH 1/2] Fix: Update snap build version (from upstream PR) --- .github/copilot-instructions.md | 49 +++++++++++++++++++ .../{snap.yaml.disabled => snap.yaml} | 0 2 files changed, 49 insertions(+) create mode 100644 .github/copilot-instructions.md rename .github/workflows/{snap.yaml.disabled => snap.yaml} (100%) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000000..48a3689ded --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,49 @@ +# Copilot Instructions for Overseerr + +## Project Overview +- **Overseerr** is a TypeScript/Node.js web application for managing media requests, tightly integrated with Plex, Sonarr, and Radarr. +- The backend (in `server/`) is an Express app with TypeORM, job scheduling, and a modular notification system (see `server/lib/notifications/agents/`). +- The frontend (in `src/`) is a Next.js React app. +- Configuration, migrations, and settings are managed in `server/lib/settings.ts` and `server/datasource.ts`. + +## Key Workflows +- **Development:** + - Start dev server: `yarn dev` (runs backend and Next.js frontend together) + - Build: `yarn build` (see `package.json` for details) + - Lint: `yarn lint` (ESLint, Prettier, Stylelint) + - Type-check: `yarn typecheck` + - Run tests: `yarn cypress:open` (Cypress E2E) +- **Database:** + - Migrations: `yarn migration:generate`, `yarn migration:run` (TypeORM, see `package.json`) +- **Notifications:** + - Add/modify notification agents in `server/lib/notifications/agents/` and register in `server/index.ts`. + +## Conventions & Patterns +- **Imports:** Use `@server/` and `@src/` aliases (see `tsconfig.json`). +- **Settings:** All persistent settings are managed via `server/lib/settings.ts`. +- **Notifications:** Each agent extends `BaseAgent` and implements `NotificationAgent`. +- **Routes:** API endpoints are organized under `server/routes/`. +- **Frontend:** Use functional React components, hooks, and context from `src/`. +- **Testing:** E2E tests live in `cypress/e2e/`. + +## Integration Points +- **Plex:** User authentication, library scan, and user import (see `server/api/plexapi.ts`). +- **Sonarr/Radarr:** Media request fulfillment (see `server/api/sonarr.ts`, `server/api/radarr.ts`). +- **Notifications:** Discord, Email, Gotify, LunaSea, Pushbullet, Pushover, Slack, Telegram, Webhook, WebPush (see `server/lib/notifications/agents/`). + +## Tips for AI Agents +- Always check `package.json` for scripts and workflow details. +- Reference `docs/` for user-facing and developer documentation. +- Follow the modular pattern for new notification agents and API routes. +- Use TypeScript types from `server/types/` and `src/types/` for consistency. +- For settings or config changes, update both backend and frontend as needed. + +## Key Files & Directories +- `server/index.ts` — Backend entry point, agent registration +- `server/lib/settings.ts` — Settings schema and logic +- `server/lib/notifications/agents/` — Notification agent implementations +- `src/` — Next.js frontend +- `cypress/` — E2E tests +- `docs/` — Documentation + +For more, see [README.md](../README.md) and [CONTRIBUTING.md](../CONTRIBUTING.md). diff --git a/.github/workflows/snap.yaml.disabled b/.github/workflows/snap.yaml similarity index 100% rename from .github/workflows/snap.yaml.disabled rename to .github/workflows/snap.yaml From a9470671103882bc5b547140a8cb31c97edaaf8c Mon Sep 17 00:00:00 2001 From: Kazz3r24 Date: Sat, 27 Sep 2025 09:52:47 -0400 Subject: [PATCH 2/2] Fixed snapcraft --- .github/workflows/snap.yaml | 4 ++-- snap/snapcraft.yaml | 30 ++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index 67084d6e7d..54cf076ffa 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -9,7 +9,7 @@ jobs: jobs: name: Job Check runs-on: ubuntu-22.04 - if: "!contains(github.event.head_commit.message, '[skip ci]')" + if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.10.0 @@ -66,7 +66,7 @@ jobs: discord: name: Send Discord Notification needs: build-snap - if: always() && !contains(github.event.head_commit.message, '[skip ci]') + if: ${{ always() && !contains(github.event.head_commit.message, '[skip ci]') }} runs-on: ubuntu-22.04 steps: - name: Get Build Job Status diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 6faf23191e..8845612731 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -5,7 +5,7 @@ summary: Request management and media discovery tool for the Plex ecosystem. description: > Overseerr is a free and open source software application for managing requests for your media library. It integrates with your existing services such as Sonarr, Radarr and Plex! -base: core18 +base: core22 confinement: strict architectures: @@ -15,10 +15,9 @@ architectures: parts: overseerr: - plugin: nodejs - nodejs-version: '18.18.2' - nodejs-package-manager: 'yarn' - nodejs-yarn-version: v1.22.19 + plugin: npm + npm-node-version: '18.18.2' + npm-include-node: true build-packages: - git - on arm64: @@ -34,7 +33,7 @@ parts: - python-gi-dev source: . override-pull: | - snapcraftctl pull + craftctl default # Get information to determine snap grade and version git config --global --add safe.directory /data/parts/overseerr/src #setup yarn.rc @@ -61,8 +60,8 @@ parts: \"commit\": \"$COMMIT\"}" echo "{\"commitTag\": \"$COMMIT\"}" > committag.json # Set snap version and grade - snapcraftctl set-version "$SNAP_VERSION" - snapcraftctl set-grade "$GRADE" + craftctl set version="$SNAP_VERSION" + craftctl set grade="$GRADE" build-environment: - PATH: '$SNAPCRAFT_PART_BUILD/node_modules/.bin:$SNAPCRAFT_PART_BUILD/../npm/bin:$PATH' - CYPRESS_INSTALL_BINARY: '0' @@ -70,15 +69,26 @@ parts: set -e # Set COMMIT_TAG before the build begins export COMMIT_TAG=$(cat $SNAPCRAFT_PART_BUILD/commit.txt) + + # Use snapcraftctl build to execute the build step snapcraftctl build + + # Use yarn for building (yarn is already available in /usr/local/bin) yarn build + # Copy files needed for staging cp $SNAPCRAFT_PART_BUILD/committag.json $SNAPCRAFT_PART_INSTALL/ cp -R $SNAPCRAFT_PART_BUILD/.next $SNAPCRAFT_PART_INSTALL/ cp -R $SNAPCRAFT_PART_BUILD/dist $SNAPCRAFT_PART_INSTALL/ cp -R $SNAPCRAFT_PART_BUILD/node_modules $SNAPCRAFT_PART_INSTALL/ + # Remove .github and gitbook as it will fail snap lint - rm -rf $SNAPCRAFT_PART_INSTALL/.github && rm $SNAPCRAFT_PART_INSTALL/.gitbook.yaml + if [ -d "$SNAPCRAFT_PART_INSTALL/.github" ]; then + rm -rf "$SNAPCRAFT_PART_INSTALL/.github" + fi + if [ -f "$SNAPCRAFT_PART_INSTALL/.gitbook.yaml" ]; then + rm "$SNAPCRAFT_PART_INSTALL/.gitbook.yaml" + fi stage-packages: - on armhf: - libatomic1 @@ -87,7 +97,7 @@ parts: apps: daemon: - command: /bin/sh -c "cd $SNAP && node dist/index.js" + command: bin/node dist/index.js daemon: simple restart-condition: on-failure restart-delay: 5s