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,6 +1,10 @@
module WarpEngine
class CiRepository < ApplicationRecord
self.table_name = "ci_repositories"
class Pipeline < ApplicationRecord
self.table_name = "pipelines"
# Repos synced from Woodpecker without a matching Software land here
# until a platform is assigned by hand.
UNKNOWN_PLATFORM = "unknown".freeze
belongs_to :software, class_name: "WarpEngine::Software", optional: true
@@ -10,7 +14,7 @@ module WarpEngine
validates :repo_owner, presence: true
validates :repo_name, presence: true
validates :platform, presence: true,
inclusion: { in: WarpEngine::PlatformLink::SUPPORTED_PLATFORMS }
inclusion: { in: WarpEngine::PlatformLink::SUPPORTED_PLATFORMS + [ UNKNOWN_PLATFORM ] }
scope :active, -> { where(active: true) }
@@ -27,6 +31,6 @@ module WarpEngine
%w[software]
end
ActiveSupport.run_load_hooks(:warp_engine_ci_repository, self)
ActiveSupport.run_load_hooks(:warp_engine_pipeline, self)
end
end
+1 -1
View File
@@ -11,7 +11,7 @@ module WarpEngine
has_many :releases, foreign_key: :software_id
has_many :downloads, through: :releases
has_many :external_links, foreign_key: :software_id
has_one :ci_repository, foreign_key: :software_id
has_one :pipeline, foreign_key: :software_id
accepts_nested_attributes_for :software_images, allow_destroy: true
accepts_nested_attributes_for :external_links, allow_destroy: true