Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into AO3-6392
Browse files Browse the repository at this point in the history
  • Loading branch information
ceithir committed Apr 5, 2024
2 parents 05b6e0b + bed484d commit e9a349d
Show file tree
Hide file tree
Showing 416 changed files with 7,799 additions and 3,613 deletions.
4 changes: 4 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
EnableDefaultLinters: true
linters:
AllowedScriptType:
allowed_types:
- "text/javascript"
- "speculationrules"
DeprecatedClasses:
enabled: true
rule_set:
Expand Down
5 changes: 2 additions & 3 deletions .github/labeler/awaiting.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"Awaiting Review":
- "**/*"
- ".*"
- ".*/**/*"
- changed-files:
- any-glob-to-any-file: "**/*"
15 changes: 8 additions & 7 deletions .github/labeler/contents.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"Gem Updates":
- "Gemfile"
- "Gemfile.lock"
- changed-files:
- any-glob-to-any-file: ["Gemfile", "Gemfile.lock"]

"Has Migrations":
- "db/migrate/**/*"
- changed-files:
- any-glob-to-any-file: "db/migrate/**/*"

"Scope: i18n Only":
- all:
- "config/locales/**/*"
- changed-files:
- any-glob-to-all-files: "config/locales/**/*"

"Scope: Tests Only":
- all:
- "{factories,features,spec,test,.github}/**/*"
- changed-files:
- any-glob-to-all-files: "{factories,features,spec,test,.github}/**/*"
11 changes: 6 additions & 5 deletions .github/labeler/review.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Label to be added when the PR is updated:
"Coder Has Actioned Review":
- "**/*"
- ".*"
- ".*/**/*"
- changed-files:
- any-glob-to-any-file: "**/*"

# Label to be removed when the PR is updated:
"Reviewed: Action Needed": []
# Condition is always false so the label is removed when the PR is updated:
"Reviewed: Action Needed":
- changed-files:
- any-glob-to-any-file: "!**/*"
15 changes: 4 additions & 11 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,17 @@ jobs:
sudo apt-get install -y redis-server
./script/gh-actions/multiple_redis.sh
- name: Cache wkhtmltopdf package
if: ${{ matrix.tests.ebook }}
uses: actions/cache@v3
with:
path: wkhtmltopdf
key: wkhtmltopdf-${{ hashFiles('script/gh-actions/ebook_converters.sh') }}

- name: Install ebook converters
if: ${{ matrix.tests.ebook }}
run: ./script/gh-actions/ebook_converters.sh

- name: Cache VCR cassettes
if: ${{ matrix.tests.vcr }}
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: features/cassette_library

# Unfortunately, the actions/cache@v3 version doesn't allow the cache
# Unfortunately, the actions/cache@v4 version doesn't allow the cache
# key to be overwritten if there's an exact match. So instead we add
# a unique identifier to the key to always force a "cache miss", and
# restore from related keys to make sure that we still get to load a
Expand Down Expand Up @@ -156,7 +149,7 @@ jobs:
run: bundle exec ${{ matrix.tests.command }} ${{ matrix.tests.arguments }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
# Optional for public repos. However, individual forks can set this
# secret to reduce the chance of being rate-limited by GitHub.
Expand All @@ -167,7 +160,7 @@ jobs:

- name: Upload failure screenshots
if: ${{ failure() && matrix.tests.command == 'cucumber' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test failures ${{ hashFiles('tmp/capybara/*') }}
path: tmp/capybara
2 changes: 1 addition & 1 deletion .github/workflows/brakeman-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ jobs:
# Upload the SARIF file generated in the previous step
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: output.sarif.json
6 changes: 3 additions & 3 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ jobs:
steps:

- name: Content-Based
uses: actions/labeler@v4
uses: actions/labeler@v5
with:
configuration-path: ".github/labeler/contents.yml"
repo-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Awaiting Review
uses: actions/labeler@v4
uses: actions/labeler@v5
if: github.event.action == 'opened'
with:
configuration-path: ".github/labeler/awaiting.yml"
repo-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Coder Has Actioned Review
uses: actions/labeler@v4
uses: actions/labeler@v5
# https://github.uint.cloudmunity/t/do-something-if-a-particular-label-is-set/17149/4
if: "contains(github.event.pull_request.labels.*.name, 'Reviewed: Action Needed')"
with:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,32 @@ permissions:
checks: write

jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-latest
env:
BUNDLE_ONLY: linters
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Ruby and run bundle install
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: rubocop
uses: reviewdog/action-rubocop@2c8048e3169487eccc1eed812daaa6e5275a809f
with:
use_bundler: true
reporter: github-pr-check
skip_install: true

erb-lint:
name: ERB Lint runner
runs-on: ubuntu-latest
env:
BUNDLE_ONLY: linters
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.idea
stdout
*~
.vscode/
# /
/*.tmproj
/sphinx
Expand Down
3 changes: 1 addition & 2 deletions .hound.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ jshint:
ignore_file: .jshintignore

rubocop:
version: 1.22.1
config_file: .rubocop.yml
enabled: false
50 changes: 50 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require:
- rubocop-rails
- rubocop-rspec
- ./rubocop/rubocop

inherit_mode:
merge:
Expand All @@ -18,6 +19,10 @@ AllCops:
Bundler/OrderedGems:
Enabled: false

I18n/DeprecatedTranslationKey:
Rules:
name_with_colon: "Prefer `name` with `mailer.general.metadata_label_indicator` over `name_with_colon`"

Layout/DotPosition:
EnforcedStyle: leading

Expand Down Expand Up @@ -72,6 +77,51 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

Migration/LargeTableSchemaUpdate:
Tables:
- abuse_reports
- admin_activities
- audits
- bookmarks
- comments
- common_taggings
- collection_items
- collection_participants
- collection_profiles
- collections
- creatorships
- external_works
- favorite_tags
- feedbacks
- filter_counts
- filter_taggings
- gifts
- inbox_comments
- invitations
- kudos
- log_items
- mutes
- preferences
- profiles
- prompts
- pseuds
- readings
- set_taggings
- serial_works
- series
- skins
- stat_counters
- subscriptions
- tag_nominations
- tag_set_associations
- tags
- taggings
- users
- works

Rails/DefaultScope:
Enabled: true

Rails/DynamicFindBy:
AllowedMethods:
# Exception for Tag.find_by_name
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.0.5
ruby-3.1.4
13 changes: 11 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
source 'https://rubygems.org'

ruby "3.0.5"
ruby "3.1.4"

gem 'test-unit', '~> 3.2'

gem 'bundler'

gem "rails", "~> 6.1.7"

gem "rails-i18n"
gem "rack", "~> 2.2"
gem "sprockets", "< 4"
Expand Down Expand Up @@ -66,6 +67,10 @@ gem 'devise'
gem 'devise-async' # To mails through queues
gem 'bcrypt'

# Needed for modern ssh
gem "ed25519", ">= 1.2", "< 2.0"
gem "bcrypt_pbkdf", ">= 1.0", "< 2.0"

# A highly updated version of the authorization plugin
gem 'permit_yo'
gem "pundit"
Expand Down Expand Up @@ -116,6 +121,9 @@ gem "mimemagic", "0.3.10"
# Library for helping run pt-online-schema-change commands:
gem "departure", "~> 6.5"

# Ruby 3.1 means we need to specify a version of mail until we get to rails 7.x
gem "mail", ">= 2.8"

group :test do
gem "rspec-rails", "~> 4.0.1"
gem 'pickle'
Expand All @@ -127,7 +135,7 @@ group :test do
gem 'capybara-screenshot'
gem 'cucumber-rails', require: false
gem 'launchy' # So you can do Then show me the page
gem 'delorean'

# Record and replay data from external URLs
gem 'vcr', '~> 3.0', '>= 3.0.1'
gem "webmock"
Expand All @@ -147,6 +155,7 @@ group :test, :development do
gem 'whiny_validation'
gem "factory_bot_rails"
gem 'minitest'
gem "listen", "~> 3.3"
gem "i18n-tasks", require: false
end

Expand Down
Loading

0 comments on commit e9a349d

Please sign in to comment.