Skip to content

Commit

Permalink
Merge branch 'temp3_for-taruntarun' into for-taruntarun
Browse files Browse the repository at this point in the history
  • Loading branch information
mayaeh committed May 30, 2024
2 parents 0209d8c + 59b1e37 commit 8c118ea
Show file tree
Hide file tree
Showing 718 changed files with 11,986 additions and 5,078 deletions.
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2.1

orbs:
ruby: circleci/ruby@2.1.0
node: circleci/node@5.1.0
ruby: circleci/ruby@2.1.2
node: circleci/node@5.2.0

executors:
default:
Expand All @@ -19,7 +19,7 @@ executors:
DB_USER: root
DISABLE_SIMPLECOV: true
RAILS_ENV: test
- image: cimg/postgres:14.5
- image: cimg/postgres:15.6
environment:
POSTGRES_USER: root
POSTGRES_HOST_AUTH_METHOD: trust
Expand All @@ -36,10 +36,10 @@ commands:
prepare-yarn:
steps:
- run:
name: Specification version of yarn to 4.1.1
name: Specification version of yarn to 4.2.2
command: |
sudo corepack enable
sudo yarn set version 4.1.1
sudo yarn set version 4.2.2
install-ruby-dependencies:
parameters:
ruby-version:
Expand All @@ -52,7 +52,7 @@ commands:
bundle config without 'development production'
name: Set bundler settings
- ruby/install-deps:
bundler-version: '2.5.4'
bundler-version: '2.5.10'
key: ruby<< parameters.ruby-version >>-gems-v2
wait-db:
steps:
Expand All @@ -63,15 +63,15 @@ commands:
jobs:
build:
docker:
- image: cimg/ruby:3.2-node
- image: cimg/ruby:3.3.1-node
environment:
RAILS_ENV: test
steps:
- checkout
- install-system-dependencies
- prepare-yarn
- install-ruby-dependencies:
ruby-version: '3.2'
ruby-version: '3.3'
- node/install-packages:
cache-version: v2
pkg-manager: yarn
Expand Down Expand Up @@ -127,9 +127,9 @@ workflows:
matrix:
parameters:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
name: test-ruby<< matrix.ruby-version >>
requires:
- build
3 changes: 2 additions & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: '3'

services:
app:
working_dir: /workspaces/mastodon/
build:
context: .
dockerfile: Dockerfile
Expand Down Expand Up @@ -70,7 +71,7 @@ services:
hard: -1

libretranslate:
image: libretranslate/libretranslate:v1.5.6
image: libretranslate/libretranslate:v1.5.7
restart: unless-stopped
volumes:
- lt-data:/home/libretranslate/.local
Expand Down
4 changes: 4 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Required by ActiveRecord encryption feature
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=fkSxKD2bF396kdQbrP1EJ7WbU7ZgNokR
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=r0hvVmzBVsjxC7AMlwhOzmtc36ZCOS1E
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=PhdFyyfy5xJ7WVd2lWBpcPScRQHzRTNr
6 changes: 6 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ NODE_ENV=production
# Federation
LOCAL_DOMAIN=cb6e6126.ngrok.io
LOCAL_HTTPS=true

# Secret values required by ActiveRecord encryption feature
# Use `bin/rails db:encryption:init` to generate fresh secrets
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=test_determinist_key_DO_NOT_USE_IN_PRODUCTION
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=test_salt_DO_NOT_USE_IN_PRODUCTION
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=test_primary_key_DO_NOT_USE_IN_PRODUCTION
7 changes: 7 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@
matchUpdateTypes: ['patch', 'minor'],
groupName: 'RSpec (non-major)',
},
{
// Group all opentelemetry-ruby packages in the same PR
matchManagers: ['bundler'],
matchPackagePrefixes: ['opentelemetry-'],
matchUpdateTypes: ['patch', 'minor'],
groupName: 'opentelemetry-ruby (non-major)',
},
// Add labels depending on package manager
{ matchManagers: ['npm', 'nvm'], addLabels: ['javascript'] },
{ matchManagers: ['bundler', 'ruby-version'], addLabels: ['ruby'] },
Expand Down
21 changes: 0 additions & 21 deletions .github/stylelint-matcher.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/crowdin-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

# Create or update the pull request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6.0.2
uses: peter-evans/create-pull-request@v6.0.5
with:
commit-message: 'New Crowdin translations'
title: 'New Crowdin Translations (automated)'
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/lint-css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,5 @@ jobs:
- name: Set up Javascript environment
uses: ./.github/actions/setup-javascript

- uses: xt0rted/stylelint-problem-matcher@v1

- run: echo "::add-matcher::.github/stylelint-matcher.json"

- name: Stylelint
run: yarn lint:css
run: yarn lint:css -f github
2 changes: 1 addition & 1 deletion .github/workflows/test-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ jobs:
- name: Set up Javascript environment
uses: ./.github/actions/setup-javascript

- name: Jest testing
- name: JavaScript testing
run: yarn jest --reporters github-actions summary
48 changes: 41 additions & 7 deletions .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
env:
RAILS_ENV: ${{ matrix.mode }}
BUNDLE_WITH: ${{ matrix.mode }}
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY: precompile_placeholder
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT: precompile_placeholder
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY: precompile_placeholder
OTP_SECRET: precompile_placeholder
SECRET_KEY_BASE: precompile_placeholder

Expand Down Expand Up @@ -111,10 +114,9 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '.ruby-version'
- '3.3'
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -143,6 +145,8 @@ jobs:
uses: codecov/codecov-action@v4
with:
files: coverage/lcov/mastodon.lcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test-e2e:
name: End to End testing
Expand Down Expand Up @@ -182,15 +186,16 @@ jobs:
DISABLE_SIMPLECOV: true
RAILS_ENV: test
BUNDLE_WITH: test
LOCAL_DOMAIN: localhost:3000
LOCAL_HTTPS: false

strategy:
fail-fast: false
matrix:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '.ruby-version'
- '3.3'

steps:
- uses: actions/checkout@v4
Expand All @@ -212,7 +217,7 @@ jobs:
- name: Load database schema
run: './bin/rails db:create db:schema:load db:seed'

- run: bundle exec rake spec:system
- run: bin/rspec spec/system --tag streaming --tag js

- name: Archive logs
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -259,6 +264,33 @@ jobs:
ports:
- 6379:6379

elasticsearch:
image: ${{ contains(matrix.search-image, 'elasticsearch') && matrix.search-image || '' }}
env:
discovery.type: single-node
xpack.security.enabled: false
options: >-
--health-cmd "curl http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 9200:9200

opensearch:
image: ${{ contains(matrix.search-image, 'opensearch') && matrix.search-image || '' }}
env:
discovery.type: single-node
DISABLE_INSTALL_DEMO_CONFIG: true
DISABLE_SECURITY_PLUGIN: true
options: >-
--health-cmd "curl http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 9200:9200

env:
DB_HOST: localhost
DB_USER: postgres
Expand All @@ -274,14 +306,16 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '.ruby-version'
- '3.3'
search-image:
- docker.elastic.co/elasticsearch/elasticsearch:7.17.13
include:
- ruby-version: '.ruby-version'
search-image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
- ruby-version: '.ruby-version'
search-image: opensearchproject/opensearch:2

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
/public/announcements.json
.env
.env.production
.env.development
/node_modules/
/build/

Expand Down Expand Up @@ -70,3 +69,6 @@ yarn-debug.log

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

# Ignore dotenv .local files
.env*.local
1 change: 0 additions & 1 deletion .haml-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
exclude:
- 'vendor/**/*'
- lib/templates/haml/scaffold/_form.html.haml

require:
- ./lib/linter/haml_middle_dot.rb
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12
20.13
19 changes: 18 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ inherit_mode:
require:
- rubocop-rails
- rubocop-rspec
- rubocop-rspec_rails
- rubocop-performance
- rubocop-capybara
- ./lib/linter/rubocop_middle_dot

AllCops:
TargetRubyVersion: 3.0 # Set to minimum supported version of CI
TargetRubyVersion: 3.1 # Set to minimum supported version of CI
DisplayCopNames: true
DisplayStyleGuide: true
ExtraDetails: true
Expand Down Expand Up @@ -80,6 +81,11 @@ Metrics/CyclomaticComplexity:
Metrics/ParameterLists:
CountKeywordArgs: false

# Reason: Prefer seeing a variable name
# https://docs.rubocop.org/rubocop/cops_naming.html#namingblockforwarding
Naming/BlockForwarding:
EnforcedStyle: explicit

# Reason: Prevailing style is argument file paths
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsfilepath
Rails/FilePath:
Expand Down Expand Up @@ -176,10 +182,16 @@ Style/FormatStringToken:
AllowedMethods:
- redirect_with_vary

# Reason: Prevailing style choice
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashaslastarrayitem
Style/HashAsLastArrayItem:
Enabled: false

# Reason: Enforce modern Ruby style
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashsyntax
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
EnforcedShorthandSyntax: either

# Reason:
# https://docs.rubocop.org/rubocop/cops_style.html#stylenumericliterals
Expand All @@ -199,6 +211,11 @@ Style/PercentLiteralDelimiters:
Style/RedundantBegin:
Enabled: false

# Reason: Prevailing style choice
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantfetchblock
Style/RedundantFetchBlock:
Enabled: false

# Reason: Overridden to reduce implicit StandardError rescues
# https://docs.rubocop.org/rubocop/cops_style.html#stylerescuestandarderror
Style/RescueStandardError:
Expand Down
Loading

0 comments on commit 8c118ea

Please sign in to comment.