Merge commit '520974e05211e988b0447f7f29e88798b1794bcf' into glitch-soc/merge-upstream

Conflicts:
- `app/serializers/rest/status_serializer.rb`:
  Not a real conflict, just glitch-soc code textually adjacent to code added
  upstream.
This commit is contained in:
Claire
2025-06-05 18:02:40 +02:00
48 changed files with 446 additions and 177 deletions

View File

@@ -23,7 +23,7 @@ module Mastodon
def announce_countdown
WARNING_SECONDS.downto(1) do |i|
say "Continuing in #{i} second#{i == 1 ? '' : 's'}...", true
say "Continuing in #{i} second#{'s' unless i == 1}...", true
sleep 1
end
end

View File

@@ -75,7 +75,7 @@ module Mastodon
end
def user_agent
@user_agent ||= "Mastodon/#{Version} (#{HTTP::Request::USER_AGENT}; +http#{Rails.configuration.x.use_https ? 's' : ''}://#{Rails.configuration.x.web_domain}/)"
@user_agent ||= "Mastodon/#{Version} (#{HTTP::Request::USER_AGENT}; +http#{'s' if Rails.configuration.x.use_https}://#{Rails.configuration.x.web_domain}/)"
end
def version_configuration

View File

@@ -57,7 +57,7 @@ namespace :repo do
response = nil
loop do
response = HTTP.headers('Authorization' => "token #{ENV['GITHUB_API_TOKEN']}").get("https://api.github.com/repos/#{REPOSITORY_NAME}/pulls/#{pull_request_number}")
response = HTTP.headers('Authorization' => "token #{ENV.fetch('GITHUB_API_TOKEN')}").get("https://api.github.com/repos/#{REPOSITORY_NAME}/pulls/#{pull_request_number}")
if response.code == 403
sleep_for = (response.headers['X-RateLimit-Reset'].to_i - Time.now.to_i).abs