Skip to content

Commit ecd7a7e

Browse files
committed
Merge branch 'vanilla' v3.1.4 master
Conflicts: .circleci/config.yml app/controllers/accounts_controller.rb app/javascript/mastodon/features/public_timeline/index.js app/javascript/mastodon/locales/en.json app/javascript/mastodon/locales/pt-BR.json app/javascript/mastodon/locales/pt-PT.json app/javascript/mastodon/locales/zh-CN.json app/models/status.rb app/validators/poll_validator.rb app/views/about/show.html.haml package.json yarn.lock
2 parents 42ef60f + c9dcc2d commit ecd7a7e

1,002 files changed

Lines changed: 11304 additions & 5131 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 67 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ aliases:
55
docker:
66
- image: circleci/ruby:2.7-buster-node
77
environment: &ruby_environment
8+
BUNDLE_JOBS: 3
9+
BUNDLE_RETRY: 3
810
BUNDLE_APP_CONFIG: ./.bundle/
911
BUNDLE_PATH: ./vendor/bundle/
1012
DB_HOST: localhost
1113
DB_USER: root
1214
RAILS_ENV: test
13-
PARALLEL_TEST_PROCESSORS: 4
1415
ALLOW_NOPAM: true
1516
CONTINUOUS_INTEGRATION: true
1617
DISABLE_SIMPLECOV: true
@@ -32,21 +33,23 @@ aliases:
3233
- &restore_ruby_dependencies
3334
restore_cache:
3435
keys:
35-
- v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
36-
- v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-
37-
- v2-ruby-dependencies-
36+
- v3-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
37+
- v3-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-
38+
- v3-ruby-dependencies-
3839

3940
- &install_steps
4041
steps:
4142
- checkout
4243
- *attach_workspace
4344
- restore_cache:
4445
keys:
45-
- v1.01-node-dependencies-{{ checksum "yarn.lock" }}
46-
- v1.01-node-dependencies-
47-
- run: yarn install --frozen-lockfile
46+
- v2-node-dependencies-{{ checksum "yarn.lock" }}
47+
- v2-node-dependencies-
48+
- run:
49+
name: Install yarn dependencies
50+
command: yarn install --frozen-lockfile
4851
- save_cache:
49-
key: v1.01-node-dependencies-{{ checksum "yarn.lock" }}
52+
key: v2-node-dependencies-{{ checksum "yarn.lock" }}
5053
paths:
5154
- ./node_modules/
5255
- *persist_to_workspace
@@ -57,27 +60,28 @@ aliases:
5760
command: |
5861
sudo apt-get update
5962
sudo apt-get install -y libicu-dev libidn11-dev libprotobuf-dev protobuf-compiler
60-
61-
## TODO: FIX THESE BUSTER DEPENDANCES
62-
sudo wget http://ftp.au.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u3_amd64.deb
63-
sudo dpkg -i libicu57_57.1-6+deb9u3_amd64.deb
64-
sudo wget http://ftp.au.debian.org/debian/pool/main/p/protobuf/libprotobuf10_3.0.0-9_amd64.deb
65-
sudo dpkg -i libprotobuf10_3.0.0-9_amd64.deb
6663
6764
- &install_ruby_dependencies
6865
steps:
6966
- *attach_workspace
7067
- *install_system_dependencies
71-
- run: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
68+
- run:
69+
name: Set Ruby version
70+
command: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
7271
- *restore_ruby_dependencies
73-
- run: bundle config set clean 'true'
74-
- run: bundle config set deployment 'true'
75-
- run: bundle config set with 'pam_authentication'
76-
- run: bundle config set without 'development production'
77-
- run: bundle config set frozen 'true'
78-
- run: bundle install --jobs 16 --retry 3 && bundle clean
72+
- run:
73+
name: Set bundler settings
74+
command: |
75+
bundle config clean 'true'
76+
bundle config deployment 'true'
77+
bundle config with 'pam_authentication'
78+
bundle config without 'development production'
79+
bundle config frozen 'true'
80+
- run:
81+
name: Install bundler dependencies
82+
command: bundle check || (bundle install && bundle clean)
7983
- save_cache:
80-
key: v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
84+
key: v3-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
8185
paths:
8286
- ./.bundle/
8387
- ./vendor/bundle/
@@ -88,17 +92,26 @@ aliases:
8892
- ./mastodon/vendor/bundle/
8993

9094
- &test_steps
95+
parallelism: 4
9196
steps:
9297
- *attach_workspace
9398
- *install_system_dependencies
94-
- run: sudo apt-get install -y ffmpeg
9599
- run:
96-
name: Prepare Tests
97-
command: ./bin/rails parallel:create parallel:load_schema parallel:prepare
100+
name: Install FFMPEG
101+
command: sudo apt-get install -y ffmpeg
98102
- run:
99-
name: Run Tests
100-
command: ./bin/retry bundle exec parallel_test ./spec/ --group-by filesize --type rspec
101-
103+
name: Load database schema
104+
command: ./bin/rails db:create db:schema:load db:seed
105+
- run:
106+
name: Run rspec in parallel
107+
command: |
108+
bundle exec rspec --profile 10 \
109+
--format RspecJunitFormatter \
110+
--out test_results/rspec.xml \
111+
--format progress \
112+
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
113+
- store_test_results:
114+
path: test_results
102115
jobs:
103116
install:
104117
<<: *defaults
@@ -115,19 +128,14 @@ jobs:
115128
environment: *ruby_environment
116129
<<: *install_ruby_dependencies
117130

118-
install-ruby2.5:
119-
<<: *defaults
120-
docker:
121-
- image: circleci/ruby:2.5-buster-node
122-
environment: *ruby_environment
123-
<<: *install_ruby_dependencies
124-
125131
build:
126132
<<: *defaults
127133
steps:
128134
- *attach_workspace
129135
- *install_system_dependencies
130-
- run: ./bin/rails assets:precompile
136+
- run:
137+
name: Precompile assets
138+
command: ./bin/rails assets:precompile
131139
- persist_to_workspace:
132140
root: ~/projects/
133141
paths:
@@ -139,28 +147,30 @@ jobs:
139147
docker:
140148
- image: circleci/ruby:2.7-buster-node
141149
environment: *ruby_environment
142-
- image: circleci/postgres:10.6-alpine
150+
- image: circleci/postgres:12.2
143151
environment:
144152
POSTGRES_USER: root
153+
POSTGRES_HOST_AUTH_METHOD: trust
145154
- image: circleci/redis:5-alpine
146155
steps:
147156
- *attach_workspace
148157
- *install_system_dependencies
149158
- run:
150159
name: Create database
151-
command: ./bin/rails parallel:create
160+
command: ./bin/rails db:create
152161
- run:
153162
name: Run migrations
154-
command: ./bin/rails parallel:migrate
163+
command: ./bin/rails db:migrate
155164

156165
test-ruby2.7:
157166
<<: *defaults
158167
docker:
159168
- image: circleci/ruby:2.7-buster-node
160169
environment: *ruby_environment
161-
- image: circleci/postgres:10.6-alpine
170+
- image: circleci/postgres:12.2
162171
environment:
163172
POSTGRES_USER: root
173+
POSTGRES_HOST_AUTH_METHOD: trust
164174
- image: circleci/redis:5-alpine
165175
<<: *test_steps
166176

@@ -169,20 +179,10 @@ jobs:
169179
docker:
170180
- image: circleci/ruby:2.6-buster-node
171181
environment: *ruby_environment
172-
- image: circleci/postgres:10.6-alpine
173-
environment:
174-
POSTGRES_USER: root
175-
- image: circleci/redis:5-alpine
176-
<<: *test_steps
177-
178-
test-ruby2.5:
179-
<<: *defaults
180-
docker:
181-
- image: circleci/ruby:2.5-buster-node
182-
environment: *ruby_environment
183-
- image: circleci/postgres:10.6-alpine
182+
- image: circleci/postgres:12.2
184183
environment:
185184
POSTGRES_USER: root
185+
POSTGRES_HOST_AUTH_METHOD: trust
186186
- image: circleci/redis:5-alpine
187187
<<: *test_steps
188188

@@ -192,17 +192,27 @@ jobs:
192192
- image: circleci/node:12-buster
193193
steps:
194194
- *attach_workspace
195-
- run: ./bin/retry yarn test:jest
195+
- run:
196+
name: Run jest
197+
command: yarn test:jest
196198

197199
check-i18n:
198200
<<: *defaults
199201
steps:
200202
- *attach_workspace
201203
- *install_system_dependencies
202-
- run: bundle exec i18n-tasks check-normalized
203-
#- run: bundle exec i18n-tasks unused -l en
204-
- run: bundle exec i18n-tasks check-consistent-interpolations
205-
- run: bundle exec rake repo:check_locales_files
204+
- run:
205+
name: Check locale file normalization
206+
command: bundle exec i18n-tasks check-normalized
207+
# - run:
208+
# name: Check for unused strings
209+
# command: bundle exec i18n-tasks unused -l en
210+
- run:
211+
name: Check for wrong string interpolations
212+
command: bundle exec i18n-tasks check-consistent-interpolations
213+
- run:
214+
name: Check that all required locale files exist
215+
command: bundle exec rake repo:check_locales_files
206216

207217
workflows:
208218
version: 2
@@ -216,10 +226,6 @@ workflows:
216226
requires:
217227
- install
218228
- install-ruby2.7
219-
- install-ruby2.5:
220-
requires:
221-
- install
222-
- install-ruby2.7
223229
- build:
224230
requires:
225231
- install-ruby2.7
@@ -234,10 +240,6 @@ workflows:
234240
requires:
235241
- install-ruby2.6
236242
- build
237-
- test-ruby2.5:
238-
requires:
239-
- install-ruby2.5
240-
- build
241243
- test-webui:
242244
requires:
243245
- install

.codeclimate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ plugins:
3030
channel: eslint-6
3131
rubocop:
3232
enabled: true
33-
channel: rubocop-0-76
33+
channel: rubocop-0-82
3434
sass-lint:
3535
enabled: true
3636
exclude_patterns:

.dependabot/config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,25 @@ update_configs:
44
- package_manager: "ruby:bundler"
55
directory: "/"
66
update_schedule: "weekly"
7+
# Supported update schedule: live daily weekly monthly
8+
version_requirement_updates: "auto"
9+
# Supported version requirements: auto widen_ranges increase_versions increase_versions_if_necessary
10+
allowed_updates:
11+
- match:
12+
dependency_type: "all"
13+
# Supported dependency types: all indirect direct production development
14+
update_type: "all"
15+
# Supported update types: all security
716

817
- package_manager: "javascript"
918
directory: "/"
1019
update_schedule: "weekly"
20+
# Supported update schedule: live daily weekly monthly
21+
version_requirement_updates: "auto"
22+
# Supported version requirements: auto widen_ranges increase_versions increase_versions_if_necessary
23+
allowed_updates:
24+
- match:
25+
dependency_type: "all"
26+
# Supported dependency types: all indirect direct production development
27+
update_type: "all"
28+
# Supported update types: all security

.env.production.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ LOCAL_DOMAIN=example.com
3333
# ALTERNATE_DOMAINS=example1.com,example2.com
3434

3535
# Application secrets
36-
# Generate each with the `RAILS_ENV=production bundle exec rake secret` task (`docker-compose run --rm web rake secret` if you use docker compose)
36+
# Generate each with the `RAILS_ENV=production bundle exec rake secret` task (`docker-compose run --rm web bundle exec rake secret` if you use docker compose)
3737
SECRET_KEY_BASE=
3838
OTP_SECRET=
3939

@@ -42,7 +42,7 @@ OTP_SECRET=
4242
# You should only generate this once per instance. If you later decide to change it, all push subscription will
4343
# be invalidated, requiring the users to access the website again to resubscribe.
4444
#
45-
# Generate with `RAILS_ENV=production bundle exec rake mastodon:webpush:generate_vapid_key` task (`docker-compose run --rm web rake mastodon:webpush:generate_vapid_key` if you use docker compose)
45+
# Generate with `RAILS_ENV=production bundle exec rake mastodon:webpush:generate_vapid_key` task (`docker-compose run --rm web bundle exec rake mastodon:webpush:generate_vapid_key` if you use docker compose)
4646
#
4747
# For more information visit https://rossta.net/blog/using-the-web-push-api-with-vapid.html
4848
VAPID_PRIVATE_KEY=

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ yarn-error.log
5858
yarn-debug.log
5959

6060
# Ignore vagrant log files
61-
ubuntu-xenial-16.04-cloudimg-console.log
61+
*-cloudimg-console.log
6262

6363
# Ignore Docker option files
6464
docker-compose.override.yml

.rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require:
22
- rubocop-rails
33

44
AllCops:
5-
TargetRubyVersion: 2.3
5+
TargetRubyVersion: 2.4
66
Exclude:
77
- 'spec/**/*'
88
- 'db/**/*'
@@ -46,7 +46,7 @@ Metrics/ClassLength:
4646
Metrics/CyclomaticComplexity:
4747
Max: 25
4848

49-
Metrics/LineLength:
49+
Layout/LineLength:
5050
AllowURI: true
5151
Enabled: false
5252

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.5
1+
2.6.6

0 commit comments

Comments
 (0)