warp_engine: CiRepository -> Pipeline rename everywhere, ci_ service prefixes dropped, unknown platform allowed

This commit is contained in:
2026-08-06 19:46:06 +02:00
parent 05beb6230b
commit 2a94fc785f
22 changed files with 223 additions and 199 deletions
@@ -1,8 +1,8 @@
require "rails_helper"
RSpec.describe WarpEngine::CiRepository do
RSpec.describe WarpEngine::Pipeline do
describe "validations" do
subject { build(:ci_repository) }
subject { build(:pipeline) }
it { is_expected.to validate_presence_of(:woodpecker_repo_id) }
it { is_expected.to validate_uniqueness_of(:woodpecker_repo_id) }
@@ -11,29 +11,34 @@ RSpec.describe WarpEngine::CiRepository do
it { is_expected.to validate_presence_of(:platform) }
it "rejects unsupported platforms" do
repo = build(:ci_repository, platform: "amiga")
repo = build(:pipeline, platform: "amiga")
expect(repo).not_to be_valid
expect(repo.errors[:platform]).to be_present
end
WarpEngine::PlatformLink::SUPPORTED_PLATFORMS.each do |p|
it "accepts #{p}" do
repo = build(:ci_repository, platform: p)
repo = build(:pipeline, platform: p)
expect(repo).to be_valid
end
end
it "accepts the unknown placeholder platform" do
repo = build(:pipeline, platform: WarpEngine::Pipeline::UNKNOWN_PLATFORM)
expect(repo).to be_valid
end
end
describe "#full_name" do
it "returns owner/name" do
repo = build(:ci_repository, repo_owner: "games", repo_name: "mygame")
repo = build(:pipeline, repo_owner: "games", repo_name: "mygame")
expect(repo.full_name).to eq("games/mygame")
end
end
describe "default_scope" do
it "excludes soft-deleted records" do
repo = create(:ci_repository)
repo = create(:pipeline)
repo.update_column(:deleted_at, Time.current)
expect(described_class.all).not_to include(repo)
@@ -43,8 +48,8 @@ RSpec.describe WarpEngine::CiRepository do
describe ".active" do
it "returns only active repos" do
active = create(:ci_repository, active: true)
inactive = create(:ci_repository, active: false)
active = create(:pipeline, active: true)
inactive = create(:pipeline, active: false)
expect(described_class.active).to include(active)
expect(described_class.active).not_to include(inactive)