Skip to content

Commit

Permalink
Merge branch 'master' into update-to-rails-7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
abdellani authored Jun 19, 2024
2 parents fdc3a16 + ef7f1d3 commit 9f34bf3
Show file tree
Hide file tree
Showing 903 changed files with 34,494 additions and 5,336 deletions.
12 changes: 2 additions & 10 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ TIMEZONE="Melbourne"
DEFAULT_COUNTRY_CODE="AU"

# Locale for translation.
LOCALE="en"
LOCALE="en_AU"

# For multilingual - ENV doesn't have array so pass it as string with commas
AVAILABLE_LOCALES="en,es"
AVAILABLE_LOCALES="en_AU,es"

# Spree zone.
CHECKOUT_ZONE="Australia"
Expand Down Expand Up @@ -42,14 +42,6 @@ SMTP_PASSWORD="f00d"
# Javascript error reporting via Bugsnag.
# BUGSNAG_JS_KEY=""

# SingleSignOn login for Discourse
#
# DISCOURSE_SSO_SECRET should be a random string. It must be the same as provided to your Discourse instance.
# DISCOURSE_SSO_SECRET=""
#
# DISCOURSE_URL must be the URL of your Discourse instance.
# DISCOURSE_URL="https://noticeboard.openfoodnetwork.org.au"

# see="https://developers.google.com/maps/documentation/javascript/get-api-key
# GOOGLE_MAPS_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# see https://developers.google.com/maps/documentation/javascript/localization#Region
Expand Down
5 changes: 5 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#
# cp .env.development .env.local

# Locale for translation. Using a locale other than `en` tests the
# successful fallback to `en`. You will also see up-to-date text used
# in production
LOCALE="en_AU"

VERBOSE_QUERY_LOGS=true

SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Expand Down
3 changes: 3 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# ENV vars for the test environment
# Override locally with `.env.test.local`

# Locale for translation.
LOCALE="en_TEST"

OFN_REDIS_JOBS_URL="redis://localhost:6379/2"

SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The full process is described at https://github.com/openfoodfoundation/openfoodn

[Ready To Go]: https://github.com/orgs/openfoodfoundation/projects/8?filterQuery=status%3A%22Ready+to+go+%F0%9F%9A%80%22
[Transifex pull request]: https://github.com/openfoodfoundation/openfoodnetwork/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+head%3Atransifex
[Draft new release]: https://github.com/openfoodfoundation/openfoodnetwork/releases/new?tag=v&title=v+Code+Name&body=Congrats%0A%0ADescription%0A%0A
[Draft new release]: https://github.com/openfoodfoundation/openfoodnetwork/releases/new?title=v+Code+Name&body=Congrats%0A%0ADescription%0A%0A
[releases]: https://github.com/openfoodfoundation/openfoodnetwork/releases
[#instance-managers]: https://app.slack.com/client/T02G54U79/CG7NJ966B
[#testing]: https://openfoodnetwork.slack.com/app_redirect?channel=C02TZ6X00
Expand Down
65 changes: 21 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

# JS is required in order for webpacker to compile, in order to render templates containing image urls
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
Expand All @@ -64,8 +65,7 @@ jobs:

- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bin/rake db:create db:schema:load
- name: Run tests
env:
Expand All @@ -83,7 +83,7 @@ jobs:
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/controllers/**/*_spec.rb}"
run: |
git show --no-patch # the commit being tested (which is often a merge due to actions/checkout@v3)
bundle exec rake knapsack_pro:rspec
bin/rake knapsack_pro:rspec
models:
runs-on: ubuntu-22.04
Expand All @@ -106,10 +106,10 @@ jobs:
# [n] - where the n is a number of parallel jobs you want to run your tests on.
# Use a higher number if you have slow tests to split them between more parallel jobs.
# Remember to update the value of the `ci_node_index` below to (0..n-1).
ci_node_total: [5]
ci_node_total: [4]
# Indexes for parallel jobs (starting from zero).
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
ci_node_index: [0, 1, 2, 3, 4]
ci_node_index: [0, 1, 2, 3]
steps:
- uses: actions/checkout@v3

Expand All @@ -123,20 +123,11 @@ jobs:
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- uses: actions/setup-node@v3
with:
node-version-file: .node-version

- name: Install JS dependencies
run: yarn install --frozen-lockfile

- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bin/rake db:create db:schema:load
- name: Run tests

env:
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 09476e2ce491c12083df62768667c674
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
Expand All @@ -150,9 +141,8 @@ jobs:
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/models/**/*_spec.rb}"

run: |
bundle exec rake knapsack_pro:rspec
bin/rake knapsack_pro:rspec
system_admin:
runs-on: ubuntu-22.04
Expand All @@ -175,10 +165,10 @@ jobs:
# [n] - where the n is a number of parallel jobs you want to run your tests on.
# Use a higher number if you have slow tests to split them between more parallel jobs.
# Remember to update the value of the `ci_node_index` below to (0..n-1).
ci_node_total: [13]
ci_node_total: [14]
# Indexes for parallel jobs (starting from zero).
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
steps:
- uses: actions/checkout@v3

Expand All @@ -201,8 +191,7 @@ jobs:

- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bin/rake db:create db:schema:load
- name: Run tests

Expand All @@ -221,7 +210,7 @@ jobs:
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/admin/**/*_spec.rb}"

run: |
bundle exec rake knapsack_pro:queue:rspec
bin/rake knapsack_pro:queue:rspec
- name: Archive failed tests screenshots
if: failure()
Expand Down Expand Up @@ -279,8 +268,7 @@ jobs:

- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bin/rake db:create db:schema:load
- name: Run tests

Expand All @@ -299,7 +287,7 @@ jobs:
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/consumer/**/*_spec.rb}"

run: |
bundle exec rake knapsack_pro:queue:rspec
bin/rake knapsack_pro:queue:rspec
- name: Archive failed tests screenshots
if: failure()
Expand Down Expand Up @@ -348,6 +336,7 @@ jobs:
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

# JS is required in order for webpacker to compile, in order to render templates linking to mail.css
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
Expand All @@ -357,8 +346,7 @@ jobs:

- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bin/rake db:create db:schema:load
- name: Run tests

Expand All @@ -377,7 +365,7 @@ jobs:
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/lib/**/*_spec.rb,spec/migrations/**/*_spec.rb,spec/serializers/**/*_spec.rb,engines/**/*_spec.rb}"

run: |
bundle exec rake knapsack_pro:rspec
bin/rake knapsack_pro:rspec
- name: Archive failed tests screenshots
if: failure()
Expand Down Expand Up @@ -426,6 +414,7 @@ jobs:
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

# JS is required in order for webpacker to compile, in order to render templates linking to mail.css
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
Expand All @@ -435,11 +424,9 @@ jobs:

- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bin/rake db:create db:schema:load
- name: Run tests

env:
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: e3b8800198d2d89b70c7edbdd85f8fd8
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
Expand All @@ -453,10 +440,8 @@ jobs:
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN: "{engines/**/*_spec.rb,spec/models/**/*_spec.rb,spec/controllers/**/*_spec.rb,spec/serializers/**/*_spec.rb,spec/lib/**/*_spec.rb,spec/migrations/**/*_spec.rb,spec/system/**/*_spec.rb}"


run: |
bundle exec rake knapsack_pro:rspec
bin/rake knapsack_pro:rspec
non_knapsack_jest_karma:
runs-on: ubuntu-22.04
Expand All @@ -476,11 +461,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup redis
uses: supercharge/[email protected]
with:
redis-version: 6

# Rails is required for the Karma rake script
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -493,12 +474,8 @@ jobs:
- name: Install JS dependencies
run: yarn install --frozen-lockfile

- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run JS tests
run: bundle exec rake karma:run
run: bin/rake karma:run

- name: Run jest tests
run: yarn jest
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require base_spec_helper
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
# The configuration is split into three files. Look into those files for more details.
#
require:
- rubocop-capybara
- rubocop-factory_bot
- rubocop-rails
- rubocop-rspec
- rubocop-rspec_rails

inherit_from:

# The automatically generated todo list to ignore all current violations.
Expand Down
Loading

0 comments on commit 9f34bf3

Please sign in to comment.