107 Commits

Author SHA1 Message Date
jamps
a9e0e230f2 fix: add pnpm binary to nativeBuildInputs
Some checks are pending
CI / test (push) Waiting to run
pnpmConfigHook only sets up config, doesn't include the pnpm binary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-11 12:15:15 +11:00
jamps
7b97f50f3e fix: use non-deprecated pnpm nixpkgs attributes
Some checks failed
CI / test (push) Has been cancelled
- pkgs.pnpm.configHook → pkgs.pnpmConfigHook
- pkgs.pnpm.fetchDeps → pkgs.fetchPnpmDeps
- Update nixpkgs flake input

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-11 10:52:15 +11:00
jamps
00da3e3d15 fix(bootstrap): skip Jellyfin restart if API key exists
Some checks failed
CI / test (push) Has been cancelled
Check if the API key already exists in the database before stopping
and restarting Jellyfin. This prevents unnecessary restarts on every
jellarr timer trigger, avoiding race conditions where Jellyfin returns
503 while still initializing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-11 09:48:59 +11:00
jamps
ae6eaddfe6 fix(bootstrap): prevent deadlock during NixOS activation
Some checks failed
CI / test (push) Has been cancelled
The bootstrap service was using wantedBy=multi-user.target which caused
it to run during NixOS activation. Since the script calls systemctl
stop/start on jellyfin, this deadlocked - systemd can't process service
state changes while in an activation transaction.

Changed to requiredBy/before jellarr.service so bootstrap only runs
when the jellarr timer fires, after activation is complete.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-10 23:11:35 +11:00
Venkatesan Ravi
934a73f106 Merge pull request #34 from bjackman/docs
docs: Update jellarr input version in example
2025-12-21 02:43:50 -08:00
Brendan Jackman
892ad56f11 docs: Update jellarr input version in example
This example uses 0.0.1 and also enables the bootstrap feature, but that
feature did not exist in that version.

This feature is not in a tagged release yet so just use the default ref
of the repo.
2025-12-21 10:33:17 +01:00
Venkatesan Ravi
4b9b1d5347 Change config type to pkgs.format.yaml 2025-12-12 11:34:02 -08:00
Venkatesan Ravi
5f19ab1035 provide option to bootstrap api keys 2025-12-11 19:35:18 -08:00
Venkatesan Ravi
a6bc767b6a ci: add Cachix caching for Nix builds 2025-11-30 16:44:04 -08:00
Venkatesan Ravi
ccc7d75b40 flake updates 2025-11-30 16:27:37 -08:00
Venkatesan Ravi
228741dc12 chore: release v0.0.3
See [CHANGELOG.md](https://github.com/venkyr77/jellarr/blob/main/CHANGELOG.md) for detailed release notes.
2025-11-30 08:43:19 -08:00
Venkatesan Ravi
9332e692d5 Merge pull request #25 from venkyr77/feature/startup-complete-wizard
feat: add startup.completeStartupWizard config option
2025-11-30 08:20:06 -08:00
Venkatesan Ravi
8f8df1d092 feat: add startup.completeStartupWizard config option
Adds support for completing the Jellyfin startup wizard via config.
When startup.completeStartupWizard is true, calls POST /Startup/Complete.

Closes #23
2025-11-30 08:13:35 -08:00
Venkatesan Ravi
a94933460b Revert "flake updates"
This reverts commit 73f79d3f14.
2025-11-30 08:07:31 -08:00
Venkatesan Ravi
73f79d3f14 flake updates 2025-11-30 07:06:19 -08:00
Venkatesan Ravi
9fbd90dbcd remove claude md 2025-11-30 06:57:25 -08:00
Venkatesan Ravi
d4570ee2bb Merge pull request #22 from venkyr77/feature/split-treefmt-modules
feat: split treefmt into format and lint modules
2025-11-22 21:40:53 -08:00
Venkatesan Ravi
b72bce14c9 feat: split treefmt into format and lint modules 2025-11-22 21:32:13 -08:00
Venkatesan Ravi
1d867de8e4 Merge pull request #20 from venkyr77/feature/eslint-improvements
Feature/eslint improvements
2025-11-22 19:26:17 -08:00
Venkatesan Ravi
392a12feba feat: add comment policy automation via uncomment tool
- Add multi-platform uncomment tool integration via Nix flake
- Configure treefmt to enforce AAA-only comment policy
- Remove all explanatory comments from codebase
- Preserve only Arrange/Act/Assert test comments
2025-11-22 19:14:20 -08:00
Venkatesan Ravi
5d55e409ef feat: add stylisticTypeChecked preset with targeted overrides
Added @typescript-eslint/stylistic-type-checked preset with selective overrides for our deliberate choices:

Preset Benefits:
- 30+ battle-tested stylistic rules from the TypeScript ESLint team
- Automatic maintenance and updates
- Comprehensive coverage of TypeScript-specific patterns

Targeted Overrides:
- array-type: "array-simple" for better readability on complex types
- consistent-generic-constructors: "type-annotation" to keep generics on left side
- no-inferrable-types: "off" to avoid conflicts with typedef strictness
- non-nullable-type-assertion-style: "off" to avoid conflicts with strict rules

Manual Fixes Applied:
- prefer-nullish-coalescing: library.ts, users.ts, users.spec.ts
- prefer-optional-chain: users.ts
- no-empty-function: logger.spec.ts, library.spec.ts
- array-type: auto-fixed across multiple test files

Zero ESLint violations remaining
2025-11-22 14:21:20 -08:00
Venkatesan Ravi
1eb2e343b9 feat: implement maximum typedef strictness for explicit type annotations
Added comprehensive typedef ESLint rule enforcement requiring explicit types everywhere:
- Arrow function parameters in forEach loops and array operations
- Object destructuring parameters in tests and source code
- Function parameters for sorting, mapping, and filtering operations
- Catch block error parameters with proper z.core.$ZodIssue typing
- Variable declarations and array destructuring patterns

All 78+ typedef violations fixed across 16 files while maintaining full test coverage.
ESLint now enforces nazi-level static typing with explicit annotations required
for all function parameters, destructuring, and variable declarations.
2025-11-22 10:53:45 -08:00
Venkatesan Ravi
099e601a31 feat(eslint): add naming convention rules
- Add @typescript-eslint/naming-convention rule
- Support API property names (PascalCase, snake_case)
- Exclude generated files from linting
- Ensure current codebase passes without errors
2025-11-22 09:41:07 -08:00
Venkatesan Ravi
bb6a7c7c5e Merge pull request #18 from venkyr77/feature/user-policy-support
Feature/user policy support
2025-11-22 07:25:01 -08:00
Venkatesan Ravi
fe26b91e03 docs: add user policy configuration examples to README
- Update User Management section with policy example (admin user)
- Update Full Configuration Example to include policy fields
- Show 3-user pattern: regular users + admin with policy
- Complete documentation for user policy support feature
2025-11-22 07:14:48 -08:00
Venkatesan Ravi
ef9403fa74 feat: add comprehensive integration tests for user policy support
- Add policy configuration to test users in sanity.nix
- Enhance user validation to verify IsAdministrator and LoginAttemptsBeforeLockout
- Add password authentication testing via /Users/AuthenticateByName
- Refactor API calls with generic jellyfin_api_call method for GET/POST
- Merge duplicate assertions for cleaner validation logic
2025-11-22 07:07:38 -08:00
Venkatesan Ravi
8d6794d989 add unit tests for user policy support - comprehensive test coverage added for types, api, mappers, and apply modules 2025-11-22 06:31:47 -08:00
Venkatesan Ravi
4b1cf56625 feat: add support for user policy configuration (src only) - manually integration tested
- Add UserPolicyConfig type with isAdministrator and loginAttemptsBeforeLockout support
- Implement mapUserPolicyConfigToSchema mapper for policy field translation
- Add calculateUserPoliciesDiff and applyUserPolicies functions following calculate/apply pattern
- Extend JellyfinClient with updateUserPolicy method for PUT /Users/{userId}/Policy
- Wire user policy management into pipeline with proper sequencing
- Update config.yml with test users featuring different policy configurations
- Comprehensive manual integration testing confirms idempotent behavior
- All 314 tests passing, buildfull validation complete
2025-11-22 05:41:57 -08:00
Venkatesan Ravi
1c4f132a98 refactor: change naming convention for new users and simplify logic 2025-11-22 04:46:36 -08:00
Venkatesan Ravi
e8d3db17f1 Merge pull request #16 from venkyr77/feature/expand-integration-tests-and-formatting
feat: expand integration tests and add Python formatting improvements
2025-11-21 22:05:19 -08:00
Venkatesan Ravi
2d27e91d12 feat: expand integration tests and add Python formatting improvements
- Replace individual it1 test with comprehensive sanity test
- Add PyHamcrest for expressive test assertions
- Implement AAA (Arrange/Act/Assert) testing pattern
- Add complete configuration validation (system, encoding, library, branding, users)
- Include initial state validation to prove declarative behavior
- Fix network connectivity with DNS resolution checks
- Add isort for Python import sorting with Black compatibility
- Update CI pipeline with sandbox bypass for GitHub Actions
- Expand test coverage while maintaining similar execution time

Resolves #15
2025-11-21 21:58:11 -08:00
Venkatesan Ravi
08617a6047 Merge pull request #14 from venkyr77/feat/user-management
feat: add user management support with secure password handling
2025-11-21 02:55:44 -08:00
Venkatesan Ravi
013e91b8ea feat: add user management support with secure password handling
- Add declarative user configuration via YAML
- Support plaintext passwords (dev) and passwordFile (production)
- Implement XOR validation: exactly one password source required
- Add comprehensive API client integration (getUsers, createUser)
- Implement calculate/apply pattern for user management
- Add sops-nix integration support for secure secret management
- Wire user management into main configuration pipeline
- Add comprehensive test coverage (15 config + 13 mapper + 12 apply tests)
- Fix API client test coverage gaps (encoding, branding, users endpoints)
- Improve root config test coverage and remove duplicates
- Update documentation with security best practices

Closes #12
Closes #13
2025-11-21 02:47:52 -08:00
Venkatesan Ravi
b0fb16c378 Merge pull request #11 from venkyr77/feature/ci-pipeline
Add comprehensive CI pipeline for automated quality validation
2025-11-20 23:22:25 -08:00
Venkatesan Ravi
8ec81fe4ba Add comprehensive CI pipeline for automated quality validation
This implements a complete CI/CD pipeline that validates code quality on every
push and pull request, ensuring all commits meet project standards.

## Key Features

- **Multi-step validation pipeline**: Dependencies → Build → Type check → Lint → Test → Format → Package → Integration
- **Fast failure mechanism**: Stops at first quality gate failure for quick feedback
- **Multi-system validation**: Tests across x86_64-linux, aarch64-linux, x86_64-darwin, aarch64-darwin
- **Comprehensive logging**: Full build logs for debugging integration test issues
- **Format validation**: Non-destructive format checking (--check mode)
- **Explicit package build**: Validates Nix package builds before expensive VM tests

## Quality Gates

- TypeScript compilation (pnpm build)
- Type checking (tsc --noEmit)
- Linting (pnpm eslint)
- Unit tests (pnpm test - 251 tests)
- Format compliance (nix fmt --check)
- Package build (nix build .#)
- Integration tests (nix flake check --all-systems --print-build-logs)

## Workflow Triggers

- Push to main branch
- All pull requests targeting main
- Provides immediate feedback to developers on code quality issues

Establishes automated quality gates preventing broken code from reaching main.
Foundation ready for future enhancements like coverage reporting and security scanning.

Resolves #10
2025-11-20 23:16:24 -08:00
Venkatesan Ravi
c37e8df4ce Merge pull request #9 from venkyr77/feature/integration-tests
Add NixOS VM integration test framework
2025-11-20 22:47:52 -08:00
Venkatesan Ravi
18128f854d Add NixOS VM integration test framework
This implements comprehensive integration testing infrastructure to validate
jellarr's declarative behavior against real Jellyfin instances.

## Key Features

- **NixOS VM test framework**: Uses pkgs.testers.runNixOSTest for isolated testing
- **Automated Jellyfin setup**: Fresh instances with API key injection via SQLite
- **Data-driven test registration**: Add tests by updating simple list
- **IT1 implementation**: Validates enableMetrics preservation when omitted
- **Scalable architecture**: Clean separation with base.nix and setup.py utilities

## Architecture

- `nix/tests/integration/default.nix` - Test registry with data-driven approach
- `nix/tests/integration/base.nix` - Common VM configuration
- `nix/tests/integration/setup.py` - Reusable Python utilities
- `nix/tests/integration/it1.nix` - First integration test (enableMetrics preservation)
- `treefmt.nix` - Added Python black formatter integration

Tests run via `nix flake check` with 600-second timeout for complex VM operations.
Foundation ready for IT2-IT10 covering all declarative behavior scenarios.

Resolves #8
2025-11-20 22:42:30 -08:00
Venkatesan Ravi
b4e24b8c68 refactor: replace ReturnType with explicit types and remove ESLint disables
- Replace all ReturnType<typeof z.url> with z.ZodURL in config types
- Replace all ReturnType<typeof createClient<paths>> with Client<paths>
- Add ApiResponse<T> interface and specific response types in jellyfin.types.ts
- Remove all 8 eslint-disable-next-line @typescript-eslint/typedef instances
- Add proper explicit type annotations for all API client methods
- Improve type safety and maintainability across API client layer

All 251 tests passing, TypeScript compilation clean, ESLint validation passing
2025-11-20 20:13:02 -08:00
Venkatesan Ravi
e85326d9a2 Add changelog link to release notes
Links to CHANGELOG.md for detailed release information
in GitHub release body.
2025-11-17 04:40:49 -08:00
Venkatesan Ravi
52c8da6853 Switch to .cjs bundle instead of binary for releases
- Publishes bundle.cjs instead of Nix binary wrapper
- Updates instructions to use 'node jellarr-v*.cjs'
- This actually works on non-Nix systems unlike the binary
- Updated README to reflect new approach
2025-11-17 04:21:27 -08:00
Venkatesan Ravi
e29aaca813 Revert to simple release workflow: single binary only
Back to the original working approach that published just the
jellarr binary wrapper which worked on non-Nix systems.

Removes the complex .cjs/.sh splitting approach.
2025-11-17 04:12:40 -08:00
Venkatesan Ravi
bdb818a232 Fix release workflow: restore bundle.cjs for standalone binary
Reverted to working release workflow that publishes both:
- bundle.cjs (the JavaScript bundle)
- wrapper script (for Node.js execution)

This fixes the broken binary release introduced in da02434.
2025-11-17 04:04:18 -08:00
Venkatesan Ravi
5ad52bb268 Simplify release notes: link to CHANGELOG.md instead of embedding
- Replace inline changelog extraction with simple link to CHANGELOG.md
- Keeps release notes clean and avoids contributor attribution issues
- Maintains usage instructions while providing changelog access
2025-11-17 03:49:57 -08:00
Venkatesan Ravi
14d0630115 Update release workflow and fix date
- Fix release date to 2025-11-17 (correct year)
- Update GitHub release workflow to include usage instructions and changelog
- Preserve installation instructions while adding changelog content
2025-11-17 03:44:16 -08:00
Venkatesan Ravi
5ebab6ced5 Fix release date in changelog: 2024 -> 2025 2025-11-17 03:40:02 -08:00
Venkatesan Ravi
5e724b1a74 Format changelog with nix fmt
- Fix formatting inconsistencies in CHANGELOG.md
- Ensure consistent line wrapping and formatting
2025-11-17 03:27:56 -08:00
Venkatesan Ravi
d2af62f4fa Release v0.0.2: Add branding configuration support
- Add comprehensive changelog documenting branding feature
- Update version to 0.0.2 in package.json and nix/package.nix
- Ready for release tagging
2025-11-17 03:23:29 -08:00
Venkatesan Ravi
7622dc0a84 Implement support for branding configuration 2025-11-17 01:28:09 -08:00
Venkatesan Ravi
5187ed56fe Implement support for branding configuration 2025-11-17 00:44:56 -08:00
Venkatesan Ravi
cdb848c44c readme fixes 2025-11-10 09:49:27 -08:00