Skip to content

Commit

Permalink
Merge branch 'mastodon:main' into BirdUI
Browse files Browse the repository at this point in the history
  • Loading branch information
DismalShadowX authored Jun 22, 2024
2 parents 4ae6245 + 4743657 commit f7ad9f8
Show file tree
Hide file tree
Showing 297 changed files with 2,032 additions and 1,626 deletions.
6 changes: 0 additions & 6 deletions .bundler-audit.yml

This file was deleted.

30 changes: 4 additions & 26 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ module.exports = defineConfig({
es6: true,
},

globals: {
ATTACHMENT_HOST: false,
},

parser: '@typescript-eslint/parser',

plugins: [
Expand Down Expand Up @@ -79,7 +75,7 @@ module.exports = defineConfig({
],
},
],
'no-empty': 'off',
'no-empty': ['error', { "allowEmptyCatch": true }],
'no-restricted-properties': [
'error',
{ property: 'substring', message: 'Use .slice instead of .substring.' },
Expand All @@ -94,7 +90,6 @@ module.exports = defineConfig({
message: "Use '·' (middle dot) instead of '•' (bullet)",
},
],
'no-self-assign': 'off',
'no-unused-expressions': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
Expand All @@ -119,12 +114,10 @@ module.exports = defineConfig({
'react/jsx-tag-spacing': 'error',
'react/jsx-uses-react': 'off', // not needed with new JSX transform
'react/jsx-wrap-multilines': 'error',
'react/no-deprecated': 'off',
'react/react-in-jsx-scope': 'off', // not needed with new JSX transform
'react/self-closing-comp': 'error',

// recommended values found in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/v6.8.0/src/index.js#L46
'jsx-a11y/accessible-emoji': 'warn',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/media-has-caption': 'off',
Expand All @@ -139,23 +132,6 @@ module.exports = defineConfig({
// ],
'jsx-a11y/no-interactive-element-to-noninteractive-role': 'off',
// recommended rule is:
// 'jsx-a11y/no-noninteractive-element-interactions': [
// 'error',
// {
// body: ['onError', 'onLoad'],
// iframe: ['onError', 'onLoad'],
// img: ['onError', 'onLoad'],
// },
// ],
'jsx-a11y/no-noninteractive-element-interactions': [
'warn',
{
handlers: [
'onClick',
],
},
],
// recommended rule is:
// 'jsx-a11y/no-noninteractive-tabindex': [
// 'error',
// {
Expand All @@ -165,7 +141,6 @@ module.exports = defineConfig({
// },
// ],
'jsx-a11y/no-noninteractive-tabindex': 'off',
'jsx-a11y/no-onchange': 'off',
// recommended is full 'error'
'jsx-a11y/no-static-element-interactions': [
'warn',
Expand Down Expand Up @@ -349,6 +324,9 @@ module.exports = defineConfig({
// Disable formatting rules that have been enabled in the base config
'indent': 'off',

// This is not needed as we use noImplicitReturns, which handles this in addition to understanding types
'consistent-return': 'off',

'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],

'@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
Expand Down
3 changes: 3 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
// to `null` after any other rule set it to something.
dependencyDashboardHeader: 'This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. Before approving any upgrade: read the description and comments in the [`renovate.json5` file](https://github.com/mastodon/mastodon/blob/main/.github/renovate.json5).',
postUpdateOptions: ['yarnDedupeHighest'],
lockFileMaintenance: {
enabled: true,
},
packageRules: [
{
// Require Dependency Dashboard Approval for major version bumps of these node packages
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/bundler-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ on:
paths:
- 'Gemfile*'
- '.ruby-version'
- '.bundler-audit.yml'
- '.github/workflows/bundler-audit.yml'

pull_request:
paths:
- 'Gemfile*'
- '.ruby-version'
- '.bundler-audit.yml'
- '.github/workflows/bundler-audit.yml'

schedule:
Expand All @@ -23,12 +21,17 @@ jobs:
security:
runs-on: ubuntu-latest

env:
BUNDLE_ONLY: development

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Set up Ruby environment
uses: ./.github/actions/setup-ruby
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Run bundler-audit
run: bundle exec bundler-audit
run: bundle exec bundler-audit check --update
10 changes: 8 additions & 2 deletions .github/workflows/lint-haml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ on:
jobs:
lint:
runs-on: ubuntu-latest

env:
BUNDLE_ONLY: development

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Set up Ruby environment
uses: ./.github/actions/setup-ruby
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Run haml-lint
run: |
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/lint-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,24 @@ jobs:
lint:
runs-on: ubuntu-latest

env:
BUNDLE_ONLY: development

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Set up Ruby environment
uses: ./.github/actions/setup-ruby
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Set-up RuboCop Problem Matcher
uses: r7kamura/rubocop-problem-matchers-action@v1

- name: Run rubocop
run: bundle exec rubocop
run: bin/rubocop

- name: Run brakeman
if: always() # Run both checks, even if the first failed
run: bundle exec brakeman
run: bin/brakeman
2 changes: 1 addition & 1 deletion .github/workflows/rebase-needed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Check for merge conflicts
uses: eps1lon/actions-label-merge-conflict@releases/2.x
uses: eps1lon/actions-label-merge-conflict@v3
with:
dirtyLabel: 'rebase needed :construction:'
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand Down
95 changes: 0 additions & 95 deletions .github/workflows/test-migrations-two-step.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Test one step migrations
name: Historical data migration test

on:
push:
branches-ignore:
Expand All @@ -17,7 +18,7 @@ jobs:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
paths: '["Gemfile*", ".ruby-version", "**/*.rb", ".github/workflows/test-migrations-one-step.yml", "lib/tasks/tests.rake"]'
paths: '["Gemfile*", ".ruby-version", "**/*.rb", ".github/workflows/test-migrations.yml", "lib/tasks/tests.rake"]'

test:
runs-on: ubuntu-latest
Expand All @@ -40,32 +41,31 @@ jobs:
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-interval 10ms
--health-timeout 3s
--health-retries 50
ports:
- 5432:5432

redis:
image: redis:7-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-interval 10ms
--health-timeout 3s
--health-retries 50
ports:
- 6379:6379

env:
CONTINUOUS_INTEGRATION: true
DB_HOST: localhost
DB_USER: postgres
DB_PASS: postgres
DISABLE_SIMPLECOV: true
RAILS_ENV: test
BUNDLE_CLEAN: true
BUNDLE_FROZEN: true
BUNDLE_WITHOUT: 'development production'
BUNDLE_WITHOUT: 'development:production'
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3

Expand All @@ -75,14 +75,19 @@ jobs:
- name: Set up Ruby environment
uses: ./.github/actions/setup-ruby

- name: Create database
run: './bin/rails db:create'

- name: Run historical migrations with data population
run: './bin/rails tests:migrations:prepare_database'

- name: Run all remaining migrations
run: './bin/rails db:migrate'
- name: Test "one step migration" flow
run: |
bin/rails db:drop
bin/rails db:create
bin/rails tests:migrations:prepare_database
bin/rails db:migrate
bin/rails tests:migrations:check_database
- name: Check migration result
run: './bin/rails tests:migrations:check_database'
- name: Test "two step migration" flow
run: |
bin/rails db:drop
bin/rails db:create
SKIP_POST_DEPLOYMENT_MIGRATIONS=true bin/rails tests:migrations:prepare_database
SKIP_POST_DEPLOYMENT_MIGRATIONS=true bin/rails db:migrate
bin/rails db:migrate
bin/rails tests:migrations:check_database
Loading

0 comments on commit f7ad9f8

Please sign in to comment.