advanced pipeline
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
inherit_gem:
|
||||||
|
rubocop-rails-omakase: rubocop.yml
|
||||||
|
|
||||||
|
AllCops:
|
||||||
|
NewCops: enable
|
||||||
|
TargetRubyVersion: 3.2
|
||||||
|
Exclude:
|
||||||
|
- "bin/**/*"
|
||||||
|
- "db/**/*"
|
||||||
|
- "config/**/*"
|
||||||
|
- "examples/**/*"
|
||||||
|
- "spec/dummy/**/*"
|
||||||
|
- "vendor/**/*"
|
||||||
@@ -10,4 +10,5 @@ group :development, :test do
|
|||||||
gem "shoulda-matchers", "~> 6.0"
|
gem "shoulda-matchers", "~> 6.0"
|
||||||
gem "webmock", "~> 3.0"
|
gem "webmock", "~> 3.0"
|
||||||
gem "debug", platforms: %i[mri windows]
|
gem "debug", platforms: %i[mri windows]
|
||||||
|
gem "rubocop-rails-omakase", require: false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -761,6 +761,16 @@ bundle exec rspec
|
|||||||
## Development
|
## Development
|
||||||
|
|
||||||
This repository is a **read-only split mirror** — development happens in the
|
This repository is a **read-only split mirror** — development happens in the
|
||||||
[`tools/teletypegames`](https://git.teletypegames.org/tools/teletypegames)
|
[`services/teletypegames`](https://git.teletypegames.org/services/teletypegames)
|
||||||
monorepo under `libs/ruby/warp_engine`, and CI republishes the mirror on every
|
monorepo under `libs/ruby/warp_engine`, and CI republishes the mirror on every
|
||||||
change. Please do not open pull requests against the mirror.
|
change. Please do not open pull requests against the mirror.
|
||||||
|
|
||||||
|
Two rules the monorepo's pipeline enforces before anything is mirrored or
|
||||||
|
published:
|
||||||
|
|
||||||
|
- **Every commit that touches the engine raises `WarpEngine::VERSION`.** A
|
||||||
|
pre-commit hook checks it locally, the pipeline's first step checks it again
|
||||||
|
over the pushed commits, and a `warp_engine-v*` tag must name the version the
|
||||||
|
tree actually holds.
|
||||||
|
- **RuboCop is green** (`.rubocop.yml`, rubocop-rails-omakase), and the suite
|
||||||
|
passes — in that order, before the gem is built.
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
module SubjectAuthentication
|
module SubjectAuthentication
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
module UpdateAuthentication
|
module UpdateAuthentication
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
class Api::Auth::DevicesController < ApiController
|
class Api::Auth::DevicesController < ApiController
|
||||||
before_action :ensure_identity_configured
|
before_action :ensure_identity_configured
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
class Api::Auth::TokensController < ApiController
|
class Api::Auth::TokensController < ApiController
|
||||||
resource_description do
|
resource_description do
|
||||||
short "Client tokens"
|
short "Client tokens"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
class Api::ServiceController < ApiController
|
class Api::ServiceController < ApiController
|
||||||
resource_description do
|
resource_description do
|
||||||
short "Service descriptor"
|
short "Service descriptor"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
module Build
|
module Build
|
||||||
|
|
||||||
class ConfigsController < ApiController
|
class ConfigsController < ApiController
|
||||||
resource_description do
|
resource_description do
|
||||||
short "CI pipeline configs"
|
short "CI pipeline configs"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
class DeviceGrant < ApplicationRecord
|
class DeviceGrant < ApplicationRecord
|
||||||
self.table_name = "device_grants"
|
self.table_name = "device_grants"
|
||||||
|
|
||||||
@@ -58,7 +57,6 @@ module WarpEngine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.generate_user_code
|
def self.generate_user_code
|
||||||
|
|
||||||
10.times do
|
10.times do
|
||||||
candidate = Array.new(USER_CODE_LENGTH) { USER_CODE_ALPHABET.chars.sample }.join
|
candidate = Array.new(USER_CODE_LENGTH) { USER_CODE_ALPHABET.chars.sample }.join
|
||||||
return candidate unless exists?(user_code: candidate)
|
return candidate unless exists?(user_code: candidate)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
module Platforms
|
module Platforms
|
||||||
module Builds
|
module Builds
|
||||||
|
|
||||||
module BuildLinuxArm64
|
module BuildLinuxArm64
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
class DeviceGrantService
|
class DeviceGrantService
|
||||||
class NotConfigured < StandardError; end
|
class NotConfigured < StandardError; end
|
||||||
class UnknownCode < StandardError; end
|
class UnknownCode < StandardError; end
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ require "warp_engine/access_denied"
|
|||||||
|
|
||||||
module WarpEngine
|
module WarpEngine
|
||||||
class DownloadService
|
class DownloadService
|
||||||
|
|
||||||
Denied = WarpEngine::AccessDenied
|
Denied = WarpEngine::AccessDenied
|
||||||
|
|
||||||
include AccessPolicyGuard
|
include AccessPolicyGuard
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
class FileManagerService
|
class FileManagerService
|
||||||
|
|
||||||
def base_path
|
def base_path
|
||||||
@base_path ||= Pathname.new(WarpEngine.config.file_container_path)
|
@base_path ||= Pathname.new(WarpEngine.config.file_container_path)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ require "warp_engine/access_denied"
|
|||||||
|
|
||||||
module WarpEngine
|
module WarpEngine
|
||||||
class FileService
|
class FileService
|
||||||
|
|
||||||
include AccessPolicyGuard
|
include AccessPolicyGuard
|
||||||
|
|
||||||
def show(input, subject: nil)
|
def show(input, subject: nil)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
class PublishService
|
class PublishService
|
||||||
|
|
||||||
NOTIFICATION = "warp_engine.publish".freeze
|
NOTIFICATION = "warp_engine.publish".freeze
|
||||||
|
|
||||||
def publish(input)
|
def publish(input)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace :warp_engine do
|
|||||||
checklist = WarpEngine::AssetCoverageChecklist.new(
|
checklist = WarpEngine::AssetCoverageChecklist.new(
|
||||||
coverage, only_missing: ENV["ONLY"] == "missing"
|
coverage, only_missing: ENV["ONLY"] == "missing"
|
||||||
)
|
)
|
||||||
puts checklist.to_s
|
puts checklist
|
||||||
|
|
||||||
if ENV["STRICT"] == "1" && coverage.totals[:missing].positive?
|
if ENV["STRICT"] == "1" && coverage.totals[:missing].positive?
|
||||||
abort "\nSTRICT: #{coverage.totals[:missing]} expected assets are missing."
|
abort "\nSTRICT: #{coverage.totals[:missing]} expected assets are missing."
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ require "warp_engine/images"
|
|||||||
require "warp_engine/ci"
|
require "warp_engine/ci"
|
||||||
|
|
||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
def self.table_name_prefix
|
def self.table_name_prefix
|
||||||
""
|
""
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
module AccessPolicy
|
module AccessPolicy
|
||||||
|
|
||||||
class Open
|
class Open
|
||||||
def visible_software_scope(subject: nil)
|
def visible_software_scope(subject: nil)
|
||||||
WarpEngine::Software.kept
|
WarpEngine::Software.kept
|
||||||
@@ -39,7 +37,6 @@ module WarpEngine
|
|||||||
end
|
end
|
||||||
|
|
||||||
class Access
|
class Access
|
||||||
|
|
||||||
attr_reader :gated, :entitled, :price_cents, :currency, :purchase_url, :web_url
|
attr_reader :gated, :entitled, :price_cents, :currency, :purchase_url, :web_url
|
||||||
|
|
||||||
def initialize(gated: false, entitled: true, price_cents: nil, currency: nil,
|
def initialize(gated: false, entitled: true, price_cents: nil, currency: nil,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
module CI
|
module CI
|
||||||
class Error < StandardError; end
|
class Error < StandardError; end
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
class Configuration
|
class Configuration
|
||||||
|
|
||||||
attr_accessor :site_url,
|
attr_accessor :site_url,
|
||||||
:file_container_path,
|
:file_container_path,
|
||||||
:update_secret,
|
:update_secret,
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
module Images
|
module Images
|
||||||
|
|
||||||
class HostModel
|
class HostModel
|
||||||
URL_PREFIX = "/api/image".freeze
|
URL_PREFIX = "/api/image".freeze
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
|
|
||||||
module Storage
|
module Storage
|
||||||
Location = Struct.new(:kind, :path, :url, keyword_init: true) do
|
Location = Struct.new(:kind, :path, :url, keyword_init: true) do
|
||||||
def file? = kind == :file
|
def file? = kind == :file
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module WarpEngine
|
module WarpEngine
|
||||||
VERSION = "0.9.0"
|
VERSION = "0.9.1"
|
||||||
|
|
||||||
VERSION_HEADER = "WarpEngine-Version".freeze
|
VERSION_HEADER = "WarpEngine-Version".freeze
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,12 +20,13 @@ RSpec.describe WarpEngine::PlatformLink, type: :model do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "default scope" do
|
describe "scopes" do
|
||||||
it "excludes soft-deleted records" do
|
it "keeps soft-deleted records out of .kept, not out of .all" do
|
||||||
active = create(:platform_link)
|
active = create(:platform_link)
|
||||||
create(:platform_link, deleted_at: Time.current)
|
deleted = create(:platform_link, deleted_at: Time.current)
|
||||||
|
|
||||||
expect(WarpEngine::PlatformLink.all).to eq([active])
|
expect(WarpEngine::PlatformLink.kept).to eq([ active ])
|
||||||
|
expect(WarpEngine::PlatformLink.all).to contain_exactly(active, deleted)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not order: ordering is asked for, not inherited" do
|
it "does not order: ordering is asked for, not inherited" do
|
||||||
|
|||||||
Reference in New Issue
Block a user