Fix CI: remove unused aliases, run mix format, install root yarn deps
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 1m21s
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 1m21s
- Remove unused aliases that caused warnings-as-errors in EX_CHECK mode - Run mix format to fix formatter check - Add root-level yarn install to CI for prettier (used by mix check) - All 1007 tests pass, zero warnings
This commit is contained in:
@@ -41,6 +41,7 @@ jobs:
|
||||
- name: Install deps
|
||||
run: |
|
||||
docker compose exec -T phx mix deps.get
|
||||
docker compose exec -T phx yarn install
|
||||
docker compose exec -T phx sh -c "cd assets && yarn install"
|
||||
|
||||
- name: Create and Migrate database
|
||||
|
||||
@@ -12,7 +12,6 @@ defmodule PinchflatWeb.ApiAuthPlug do
|
||||
"""
|
||||
|
||||
import Plug.Conn
|
||||
alias Pinchflat.Settings
|
||||
|
||||
def init(opts), do: opts
|
||||
|
||||
@@ -47,4 +46,4 @@ defmodule PinchflatWeb.ApiAuthPlug do
|
||||
|> send_resp(401, ~s({"errors":{"detail":"Unauthorized"}}))
|
||||
|> halt()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,6 @@ defmodule PinchflatWeb.Api.V1.ApiMediaItemController do
|
||||
|
||||
alias Pinchflat.Repo
|
||||
alias Pinchflat.Media
|
||||
alias Pinchflat.Media.MediaItem
|
||||
alias Pinchflat.Downloading.MediaDownloadWorker
|
||||
|
||||
def index(conn, params) do
|
||||
@@ -94,4 +93,4 @@ defmodule PinchflatWeb.Api.V1.ApiMediaItemController do
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,7 +6,6 @@ defmodule PinchflatWeb.Api.V1.ApiMediaProfileController do
|
||||
use PinchflatWeb, :controller
|
||||
|
||||
alias Pinchflat.Profiles
|
||||
alias Pinchflat.Profiles.MediaProfile
|
||||
|
||||
def index(conn, _params) do
|
||||
json(conn, %{data: Profiles.list_media_profiles()})
|
||||
@@ -65,4 +64,4 @@ defmodule PinchflatWeb.Api.V1.ApiMediaProfileController do
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -53,4 +53,4 @@ defmodule PinchflatWeb.Api.V1.ApiSettingController do
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,6 @@ defmodule PinchflatWeb.Api.V1.ApiSourceController do
|
||||
|
||||
alias Pinchflat.Repo
|
||||
alias Pinchflat.Sources
|
||||
alias Pinchflat.Sources.Source
|
||||
alias Pinchflat.Tasks
|
||||
alias Pinchflat.Downloading.DownloadingHelpers
|
||||
alias Pinchflat.SlowIndexing.SlowIndexingHelpers
|
||||
@@ -43,6 +42,7 @@ defmodule PinchflatWeb.Api.V1.ApiSourceController do
|
||||
case Sources.create_source(source_params) do
|
||||
{:ok, source} ->
|
||||
source = Repo.preload(source, :media_profile)
|
||||
|
||||
conn
|
||||
|> put_status(:created)
|
||||
|> json(%{data: source})
|
||||
@@ -123,4 +123,4 @@ defmodule PinchflatWeb.Api.V1.ApiSourceController do
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,6 +15,7 @@ defmodule PinchflatWeb.Api.V1.ApiTaskController do
|
||||
case params do
|
||||
%{"source_id" => source_id} ->
|
||||
source = Pinchflat.Sources.get_source!(source_id)
|
||||
|
||||
Tasks.list_tasks_for(source)
|
||||
|> Repo.preload(:job)
|
||||
|
||||
@@ -30,4 +31,4 @@ defmodule PinchflatWeb.Api.V1.ApiTaskController do
|
||||
task = Tasks.get_task!(id) |> Repo.preload(:job)
|
||||
json(conn, %{data: task})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,4 +15,4 @@ defmodule PinchflatWeb.Api.V1.FallbackController do
|
||||
|> put_status(:not_found)
|
||||
|> json(%{errors: %{detail: "Not found"}})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -62,4 +62,4 @@ defmodule PinchflatWeb.ApiAuthPlugTest do
|
||||
assert %{status: 200} = conn
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -77,4 +77,4 @@ defmodule PinchflatWeb.Api.V1.ApiMediaItemControllerTest do
|
||||
assert [_] = all_enqueued(worker: MediaDownloadWorker)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,7 +28,10 @@ defmodule PinchflatWeb.Api.V1.ApiMediaProfileControllerTest do
|
||||
|
||||
describe "POST /api/v1/media_profiles" do
|
||||
test "creates a media profile and returns 201", %{conn: conn} do
|
||||
conn = post(conn, ~p"/api/v1/media_profiles", media_profile: %{name: "Test Profile", output_path_template: "{{title}}.{{ext}}"})
|
||||
conn =
|
||||
post(conn, ~p"/api/v1/media_profiles",
|
||||
media_profile: %{name: "Test Profile", output_path_template: "{{title}}.{{ext}}"}
|
||||
)
|
||||
|
||||
assert %{status: 201} = conn
|
||||
assert json_response(conn, 201)["data"]["name"] == "Test Profile"
|
||||
@@ -40,4 +43,4 @@ defmodule PinchflatWeb.Api.V1.ApiMediaProfileControllerTest do
|
||||
assert %{status: 422} = conn
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,4 +42,4 @@ defmodule PinchflatWeb.Api.V1.ApiSettingControllerTest do
|
||||
assert data["environment"] != nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -184,4 +184,4 @@ defmodule PinchflatWeb.Api.V1.ApiSourceControllerTest do
|
||||
playlist_title: "some playlist name"
|
||||
})}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -45,4 +45,4 @@ defmodule PinchflatWeb.Api.V1.ApiTaskControllerTest do
|
||||
assert json_response(conn, 200)["data"]["id"] == task.id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user