diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 0dddc3e290..78530d65b4 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -9,7 +9,9 @@ ], stabilityDays: 3, // Wait 3 days after the package has been published before upgrading it // packageRules order is important, they are applied from top to bottom and are merged, - // so for example grouping rules needs to be at the bottom + // meaning the most important ones must be at the bottom, for example grouping rules + // If we do not want a package to be grouped with others, we need to set its groupName + // to `null` after any other rule set it to something. packageRules: [ { // Ignore major version bumps for these node packages @@ -45,6 +47,7 @@ // Ignore major version bumps for these Ruby packages matchManagers: ['bundler'], matchPackageNames: [ + 'rack', // Needs to be synced with Rails version 'sprockets', // Requires manual upgrade https://github.com/rails/sprockets/blob/master/UPGRADING.md#guide-to-upgrading-from-sprockets-3x-to-4x 'strong_migrations', // Requires manual upgrade 'sidekiq', // Requires manual upgrade @@ -84,12 +87,17 @@ // Update devDependencies every week, with one grouped PR matchDepTypes: 'devDependencies', matchUpdateTypes: ['patch', 'minor'], - excludePackageNames: [ - 'typescript', // Typescript has many changes in minor versions, needs to be checked every time - ], groupName: 'devDependencies (non-major)', extends: ['schedule:weekly'], }, + { + // Group all eslint-related packages with `eslint` in the same PR + matchManagers: ['npm'], + matchPackageNames: ['eslint'], + matchPackagePrefixes: ['eslint-', '@typescript-eslint/'], + matchUpdateTypes: ['patch', 'minor'], + groupName: 'eslint (non-major)', + }, { // Update @types/* packages every week, with one grouped PR matchPackagePrefixes: '@types/', @@ -98,6 +106,14 @@ extends: ['schedule:weekly'], addLabels: ['typescript'], }, + { + // We want those packages to always have their own PR + matchManagers: ['npm'], + matchPackageNames: [ + 'typescript', // Typescript has code-impacting changes in minor versions + ], + groupName: null, // We dont want them to belong to any group + }, // Add labels depending on package manager { matchManagers: ['npm', 'nvm'], addLabels: ['javascript'] }, { matchManagers: ['bundler', 'ruby-version'], addLabels: ['ruby'] }, diff --git a/.github/workflows/rebase-needed.yml b/.github/workflows/rebase-needed.yml index 295039c414..06d835c090 100644 --- a/.github/workflows/rebase-needed.yml +++ b/.github/workflows/rebase-needed.yml @@ -23,5 +23,5 @@ jobs: repoToken: '${{ secrets.GITHUB_TOKEN }}' commentOnClean: This pull request has resolved merge conflicts and is ready for review. commentOnDirty: This pull request has merge conflicts that must be resolved before it can be merged. - retryMax: 10 + retryMax: 30 continueOnMissingPermissions: false diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index 31b79f7db2..94aeadfff0 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -1,17 +1,13 @@ # This configuration was generated by # `haml-lint --auto-gen-config` -# on 2023-07-11 23:58:05 +0200 using Haml-Lint version 0.48.0. +# on 2023-07-17 12:00:21 -0400 using Haml-Lint version 0.48.0. # The point is for the user to remove these configuration records # one by one as the lints are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of Haml-Lint, may require this file to be generated again. linters: - # Offense count: 94 - RuboCop: - enabled: false - - # Offense count: 960 + # Offense count: 959 LineLength: enabled: false @@ -19,6 +15,10 @@ linters: UnnecessaryStringOutput: enabled: false + # Offense count: 67 + RuboCop: + enabled: false + # Offense count: 3 ViewLength: exclude: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7104c7a1b2..ee346fdb05 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp` -# using RuboCop version 1.54.1. +# using RuboCop version 1.54.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -194,7 +194,6 @@ RSpec/AnyInstance: - 'spec/models/account_spec.rb' - 'spec/models/setting_spec.rb' - 'spec/services/activitypub/process_collection_service_spec.rb' - - 'spec/validators/blacklisted_email_validator_spec.rb' - 'spec/validators/follow_limit_validator_spec.rb' - 'spec/workers/activitypub/delivery_worker_spec.rb' - 'spec/workers/web/push_notification_worker_spec.rb' @@ -333,11 +332,7 @@ RSpec/MessageChain: RSpec/MessageSpies: Exclude: - 'spec/controllers/admin/accounts_controller_spec.rb' - - 'spec/controllers/api/base_controller_spec.rb' - - 'spec/controllers/auth/registrations_controller_spec.rb' - 'spec/helpers/admin/account_moderation_notes_helper_spec.rb' - - 'spec/helpers/application_helper_spec.rb' - - 'spec/lib/status_finder_spec.rb' - 'spec/lib/webfinger_resource_spec.rb' - 'spec/models/admin/account_action_spec.rb' - 'spec/models/concerns/remotable_spec.rb' @@ -372,7 +367,7 @@ Rails/ApplicationController: # Configuration parameters: Database, Include. # SupportedDatabases: mysql, postgresql -# Include: db/migrate/*.rb +# Include: db/**/*.rb Rails/BulkChangeTable: Exclude: - 'db/migrate/20160222143943_add_profile_fields_to_accounts.rb' @@ -408,7 +403,7 @@ Rails/BulkChangeTable: - 'db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb' # Configuration parameters: Include. -# Include: db/migrate/*.rb +# Include: db/**/*.rb Rails/CreateTableWithTimestamps: Exclude: - 'db/migrate/20170508230434_create_conversation_mutes.rb' @@ -808,7 +803,6 @@ Style/MutableConstant: Exclude: - 'app/models/tag.rb' - 'app/services/delete_account_service.rb' - - 'config/initializers/twitter_regex.rb' - 'lib/mastodon/migration_warning.rb' # This cop supports safe autocorrection (--autocorrect). diff --git a/Gemfile.lock b/Gemfile.lock index 87d8ef7d25..1d43b687d5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -103,20 +103,20 @@ GEM attr_required (1.0.1) awrence (1.2.1) aws-eventstream (1.2.0) - aws-partitions (1.780.0) - aws-sdk-core (3.175.0) + aws-partitions (1.786.0) + aws-sdk-core (3.178.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.67.0) - aws-sdk-core (~> 3, >= 3.174.0) + aws-sdk-kms (1.71.0) + aws-sdk-core (~> 3, >= 3.177.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.126.0) - aws-sdk-core (~> 3, >= 3.174.0) + aws-sdk-s3 (1.130.0) + aws-sdk-core (~> 3, >= 3.177.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.2) + aws-sigv4 (~> 1.6) + aws-sigv4 (1.6.0) aws-eventstream (~> 1, >= 1.0.2) bcrypt (3.1.18) better_errors (2.10.1) @@ -493,7 +493,7 @@ GEM net-smtp premailer (~> 1.7, >= 1.7.9) private_address_check (0.5.0) - public_suffix (5.0.1) + public_suffix (5.0.3) puma (6.3.0) nio4r (~> 2.0) pundit (2.3.0) @@ -596,7 +596,7 @@ GEM sidekiq (>= 2.4.0) rspec-support (3.12.0) rspec_chunked (0.6) - rubocop (1.54.1) + rubocop (1.54.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) diff --git a/app/controllers/api/v1/tags_controller.rb b/app/controllers/api/v1/tags_controller.rb index 284ec85937..672535a018 100644 --- a/app/controllers/api/v1/tags_controller.rb +++ b/app/controllers/api/v1/tags_controller.rb @@ -19,6 +19,7 @@ class Api::V1::TagsController < Api::BaseController def unfollow TagFollow.find_by(account: current_account, tag: @tag)&.destroy! + TagUnmergeWorker.perform_async(@tag.id, current_account.id) render json: @tag, serializer: REST::TagSerializer end diff --git a/app/helpers/database_helper.rb b/app/helpers/database_helper.rb index 965eeaf41d..79227bb109 100644 --- a/app/helpers/database_helper.rb +++ b/app/helpers/database_helper.rb @@ -2,10 +2,10 @@ module DatabaseHelper def with_read_replica(&block) - ApplicationRecord.connected_to(role: :read, prevent_writes: true, &block) + ApplicationRecord.connected_to(role: :reading, prevent_writes: true, &block) end def with_primary(&block) - ApplicationRecord.connected_to(role: :primary, &block) + ApplicationRecord.connected_to(role: :writing, &block) end end diff --git a/app/javascript/mastodon/components/column_back_button.jsx b/app/javascript/mastodon/components/column_back_button.jsx index 38ffa607a9..74a03b093a 100644 --- a/app/javascript/mastodon/components/column_back_button.jsx +++ b/app/javascript/mastodon/components/column_back_button.jsx @@ -23,9 +23,7 @@ export default class ColumnBackButton extends PureComponent { if (onClick) { onClick(); - // Check if there is a previous page in the app to go back to per https://stackoverflow.com/a/70532858/9703201 - // When upgrading to V6, check `location.key !== 'default'` instead per https://github.com/remix-run/history/blob/main/docs/api-reference.md#location - } else if (router.route.location.key) { + } else if (router.history.location?.state?.fromMastodon) { router.history.goBack(); } else { router.history.push('/'); diff --git a/app/javascript/mastodon/components/column_header.jsx b/app/javascript/mastodon/components/column_header.jsx index 89eade262e..9d29bbae03 100644 --- a/app/javascript/mastodon/components/column_header.jsx +++ b/app/javascript/mastodon/components/column_header.jsx @@ -63,10 +63,12 @@ class ColumnHeader extends PureComponent { }; handleBackClick = () => { - if (window.history && window.history.state) { - this.context.router.history.goBack(); + const { router } = this.context; + + if (router.history.location?.state?.fromMastodon) { + router.history.goBack(); } else { - this.context.router.history.push('/'); + router.history.push('/'); } }; @@ -83,6 +85,7 @@ class ColumnHeader extends PureComponent { }; render () { + const { router } = this.context; const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues } = this.props; const { collapsed, animating } = this.state; @@ -126,7 +129,7 @@ class ColumnHeader extends PureComponent { pinButton = ; } - if (!pinned && (multiColumn || showBackButton)) { + if (!pinned && ((multiColumn && router.history.location?.state?.fromMastodon) || showBackButton)) { backButton = (