towerops/vendor/README.md
Graham McIntire 6c05d45dd6 deps: upgrade oban_pro to 1.7.0
Bumps vendored Oban Pro from 1.6.13 to 1.7.0, which transitively bumps
oban core to 2.22.1 (requires migrations v14) and db_connection to 2.10.0.

- mix.exs constraint: ~> 1.6 → ~> 1.7
- vendor/oban_pro/ replaced with v1.7.0 hex package
- migration 20260430142200: Oban core v12 → v14 (must run first)
- migration 20260430142241: Oban Pro 1.7.0 schema additions

Also corrects a pre-existing constraint name in AgentAssignment that was
left stale by the equipment→devices rename migration (20260117190134).
The unique index is named agent_assignments_device_id_index, but the
schema's unique_constraint/3 still pointed at the old equipment_id name,
causing the test suite to surface Ecto.ConstraintError instead of a
changeset error. Required to get the suite green for this upgrade.
2026-04-30 10:26:18 -05:00

138 lines
2.9 KiB
Markdown

# Vendored Dependencies
This directory contains vendored Elixir dependencies that are included directly in the repository instead of being fetched from external sources during build/CI.
## Why Vendor?
These dependencies are vendored to:
- Avoid requiring authentication during CI/CD builds
- Ensure consistent builds without external dependencies
- Enable offline development
## Docker Build
**IMPORTANT**: The `vendor/` directory must be copied into the Docker build before running `mix deps.get`.
In `Dockerfile`, ensure this order:
```dockerfile
COPY mix.exs mix.lock ./
COPY vendor vendor # ← Must be before mix deps.get
RUN mix deps.get --only $MIX_ENV
```
## Vendored Packages
### Oban Pro
**Version**: 1.7.0
**Source**: https://getoban.pro/repo (private)
**License**: Commercial (licensed)
Advanced Oban features including batching, workflows, dynamic partitioning, and more.
**Configuration in mix.exs**:
```elixir
{:oban_pro, "~> 1.7", path: "vendor/oban_pro"}
```
### Oban Web
**Version**: 2.12.1
**Source**: https://hex.pm/packages/oban_web
**License**: Apache-2.0
Web dashboard for Oban job monitoring and management.
**Configuration in mix.exs**:
```elixir
{:oban_web, "~> 2.11", path: "vendor/oban_web"}
```
**Router Configuration** (superuser only):
```elixir
# lib/towerops_web/router.ex
scope "/" do
pipe_through [:browser, :require_authenticated_user, :require_superuser]
oban_dashboard "/oban"
end
```
### Oban Met
**Version**: 1.1.0
**Source**: https://hex.pm/packages/oban_met
**License**: Apache-2.0
Metrics and telemetry support for Oban Web (required dependency).
**Configuration in mix.exs**:
```elixir
{:oban_met, "~> 1.0", path: "vendor/oban_met", override: true}
```
## Updating Vendored Dependencies
### Step 1: Configure Oban Repository (if needed)
```bash
mix hex.repo add oban https://getoban.pro/repo \
--fetch-public-key SHA256:4/OSKi0NRF91QVVXlGAhb/BIMLnK8NHcx/EWs+aIWPc \
--auth-key <your-auth-key>
```
### Step 2: Update Dependencies
```bash
# Update version constraints in mix.exs if desired
# Then fetch latest versions
mix deps.unlock oban_pro oban_web oban_met
mix deps.get
# Verify versions
mix deps | grep oban
```
### Step 3: Update Vendored Code
```bash
# Remove old vendored versions
rm -rf vendor/oban_pro vendor/oban_web vendor/oban_met
# Copy new versions from deps
cp -r deps/oban_pro vendor/
cp -r deps/oban_web vendor/
cp -r deps/oban_met vendor/
# Compile and test
mix deps.compile
mix test
```
### Step 4: Commit Changes
```bash
git add vendor/
git commit -m "Update vendored Oban packages
- oban_pro: 1.6.x → 1.6.y
- oban_web: 2.11.x → 2.11.y
- oban_met: 1.0.x → 1.0.y
"
```
## Verifying Vendored Dependencies
To verify that vendored dependencies are being used correctly:
```bash
# Check that path dependencies are recognized
mix deps
# Compile from scratch
mix deps.clean --all
mix deps.compile
# Run tests
mix test
```