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 "webmock", "~> 3.0"
|
||||
gem "debug", platforms: %i[mri windows]
|
||||
gem "rubocop-rails-omakase", require: false
|
||||
end
|
||||
|
||||
@@ -761,6 +761,16 @@ bundle exec rspec
|
||||
## Development
|
||||
|
||||
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
|
||||
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 SubjectAuthentication
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
module WarpEngine
|
||||
|
||||
module UpdateAuthentication
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
module WarpEngine
|
||||
|
||||
class Api::Auth::DevicesController < ApiController
|
||||
before_action :ensure_identity_configured
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
module WarpEngine
|
||||
|
||||
class Api::Auth::TokensController < ApiController
|
||||
resource_description do
|
||||
short "Client tokens"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
module WarpEngine
|
||||
|
||||
class Api::ServiceController < ApiController
|
||||
resource_description do
|
||||
short "Service descriptor"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module WarpEngine
|
||||
module Build
|
||||
|
||||
class ConfigsController < ApiController
|
||||
resource_description do
|
||||
short "CI pipeline configs"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
module WarpEngine
|
||||
|
||||
class DeviceGrant < ApplicationRecord
|
||||
self.table_name = "device_grants"
|
||||
|
||||
@@ -58,7 +57,6 @@ module WarpEngine
|
||||
end
|
||||
|
||||
def self.generate_user_code
|
||||
|
||||
10.times do
|
||||
candidate = Array.new(USER_CODE_LENGTH) { USER_CODE_ALPHABET.chars.sample }.join
|
||||
return candidate unless exists?(user_code: candidate)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module WarpEngine
|
||||
module Platforms
|
||||
module Builds
|
||||
|
||||
module BuildLinuxArm64
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
module WarpEngine
|
||||
|
||||
class DeviceGrantService
|
||||
class NotConfigured < StandardError; end
|
||||
class UnknownCode < StandardError; end
|
||||
|
||||
@@ -2,7 +2,6 @@ require "warp_engine/access_denied"
|
||||
|
||||
module WarpEngine
|
||||
class DownloadService
|
||||
|
||||
Denied = WarpEngine::AccessDenied
|
||||
|
||||
include AccessPolicyGuard
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module WarpEngine
|
||||
class FileManagerService
|
||||
|
||||
def base_path
|
||||
@base_path ||= Pathname.new(WarpEngine.config.file_container_path)
|
||||
end
|
||||
|
||||
@@ -2,7 +2,6 @@ require "warp_engine/access_denied"
|
||||
|
||||
module WarpEngine
|
||||
class FileService
|
||||
|
||||
include AccessPolicyGuard
|
||||
|
||||
def show(input, subject: nil)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module WarpEngine
|
||||
class PublishService
|
||||
|
||||
NOTIFICATION = "warp_engine.publish".freeze
|
||||
|
||||
def publish(input)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace :warp_engine do
|
||||
checklist = WarpEngine::AssetCoverageChecklist.new(
|
||||
coverage, only_missing: ENV["ONLY"] == "missing"
|
||||
)
|
||||
puts checklist.to_s
|
||||
puts checklist
|
||||
|
||||
if ENV["STRICT"] == "1" && coverage.totals[:missing].positive?
|
||||
abort "\nSTRICT: #{coverage.totals[:missing]} expected assets are missing."
|
||||
|
||||
@@ -13,7 +13,6 @@ require "warp_engine/images"
|
||||
require "warp_engine/ci"
|
||||
|
||||
module WarpEngine
|
||||
|
||||
def self.table_name_prefix
|
||||
""
|
||||
end
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
module WarpEngine
|
||||
|
||||
module AccessPolicy
|
||||
|
||||
class Open
|
||||
def visible_software_scope(subject: nil)
|
||||
WarpEngine::Software.kept
|
||||
@@ -39,7 +37,6 @@ module WarpEngine
|
||||
end
|
||||
|
||||
class Access
|
||||
|
||||
attr_reader :gated, :entitled, :price_cents, :currency, :purchase_url, :web_url
|
||||
|
||||
def initialize(gated: false, entitled: true, price_cents: nil, currency: nil,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
module WarpEngine
|
||||
|
||||
module CI
|
||||
class Error < StandardError; end
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module WarpEngine
|
||||
class Configuration
|
||||
|
||||
attr_accessor :site_url,
|
||||
:file_container_path,
|
||||
:update_secret,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
module WarpEngine
|
||||
|
||||
module Images
|
||||
|
||||
class HostModel
|
||||
URL_PREFIX = "/api/image".freeze
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
module WarpEngine
|
||||
|
||||
module Storage
|
||||
Location = Struct.new(:kind, :path, :url, keyword_init: true) do
|
||||
def file? = kind == :file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module WarpEngine
|
||||
VERSION = "0.9.0"
|
||||
VERSION = "0.9.1"
|
||||
|
||||
VERSION_HEADER = "WarpEngine-Version".freeze
|
||||
end
|
||||
|
||||
@@ -20,12 +20,13 @@ RSpec.describe WarpEngine::PlatformLink, type: :model do
|
||||
end
|
||||
end
|
||||
|
||||
describe "default scope" do
|
||||
it "excludes soft-deleted records" do
|
||||
describe "scopes" do
|
||||
it "keeps soft-deleted records out of .kept, not out of .all" do
|
||||
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
|
||||
|
||||
it "does not order: ordering is asked for, not inherited" do
|
||||
|
||||
Reference in New Issue
Block a user