Add: #391 開発中のブランチにベータ版のバージョン表記ができるよう整備・Bump version to 11.0-dev (#447)

* Add: #391 開発中のブランチにベータ版のバージョン表記ができるよう整備・Bump version to 11.0-dev

* Fix test
This commit is contained in:
KMY(雪あすか) 2024-01-12 09:35:17 +09:00 committed by GitHub
parent 2ef5fdb6fb
commit b044cbeb63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View file

@ -34,6 +34,7 @@ class SoftwareUpdateCheckService < BaseService
if ENV.fetch('UPDATE_CHECK_SOURCE', 'kmyblue') == 'kmyblue'
@version = "#{Mastodon::Version.kmyblue_major}.#{Mastodon::Version.kmyblue_minor}"
@version += '-lts' if Setting.check_lts_version_only
@version += '-dev' if Mastodon::Version.dev?
else
@version = Mastodon::Version.to_s.split('+')[0]
end

View file

@ -5,7 +5,7 @@ module Mastodon
module_function
def kmyblue_major
10
11
end
def kmyblue_minor
@ -13,7 +13,9 @@ module Mastodon
end
def kmyblue_flag
nil # 'LTS'
# 'LTS'
'dev'
# nil
end
def major
@ -80,6 +82,14 @@ module Mastodon
end
end
def lts?
kmyblue_flag == 'LTS'
end
def dev?
kmyblue_flag == 'dev'
end
def repository
ENV.fetch('GITHUB_REPOSITORY', 'kmycode/mastodon')
end

View file

@ -6,7 +6,7 @@ RSpec.describe SoftwareUpdateCheckService, type: :service do
subject { described_class.new }
shared_examples 'when the feature is enabled' do
let(:full_update_check_url) { "#{update_check_url}?version=#{Mastodon::Version.kmyblue_major}.#{Mastodon::Version.kmyblue_minor}-lts" }
let(:full_update_check_url) { "#{update_check_url}?version=#{Mastodon::Version.kmyblue_major}.#{Mastodon::Version.kmyblue_minor}-lts#{Mastodon::Version.dev? ? '-dev' : ''}" }
let(:devops_role) { Fabricate(:user_role, name: 'DevOps', permissions: UserRole::FLAGS[:view_devops]) }
let(:owner_user) { Fabricate(:user, role: UserRole.find_by(name: 'Owner')) }