Skip to content

Commit

Permalink
Merge pull request #7181 from donny-wong/release_2.5.0
Browse files Browse the repository at this point in the history
Release 2.5.0
  • Loading branch information
donny-wong authored Aug 15, 2024
2 parents 66cc7a1 + 21f1147 commit 072faf1
Show file tree
Hide file tree
Showing 1,817 changed files with 15,900 additions and 247,992 deletions.
2 changes: 1 addition & 1 deletion .dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:jammy AS base

ARG NODE_MAJOR=18
ARG NODE_MAJOR=20
ARG BUNDLER_VERSION='2.4.13'
ARG USER=markus

Expand Down
11 changes: 7 additions & 4 deletions .dockerfiles/entrypoint-dev-rails.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ npm list &> /dev/null || npm ci
# install python packages
[ -f ./venv/bin/python3 ] || python3 -m venv ./venv
./venv/bin/python3 -m pip install --upgrade pip > /dev/null
./venv/bin/python3 -m pip install -r requirements-jupyter.txt > /dev/null
./venv/bin/python3 -m pip install -r requirements-scanner.txt > /dev/null
./venv/bin/python3 -m pip install -r requirements-qr.txt > /dev/null
./venv/bin/python3 -m pip install -r requirements-jupyter.txt
./venv/bin/python3 -m pip install -r requirements-scanner.txt
./venv/bin/python3 -m pip install -r requirements-qr.txt

# install chromium (for nbconvert webpdf conversion)
./venv/bin/python3 -m playwright install chromium
Expand All @@ -31,5 +31,8 @@ sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' /app/db/structure.sql

rm -f ./tmp/pids/server.pid

# Then exec the container's main process (what's set as CMD in the Dockerfile or docker-compose.yml).
# cssbundling-rails development command
npm run build-dev:css &

# Then exec the container's main process (what's set as CMD in the Dockerfile or compose.yaml).
exec "$@"
2 changes: 1 addition & 1 deletion .dockerfiles/production_demo/entrypoint-prod-rails.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ bundle exec rails db:prepare

rm -f ./tmp/pids/server.pid

# Then exec the container's main process (what's set as CMD in the Dockerfile or docker-compose.yml).
# Then exec the container's main process (what's set as CMD in the Dockerfile or compose.yaml).
exec "$@"
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ app/javascript/routes.d.ts

# local docker compose overrides
docker-compose.override.yml
compose.override.yaml
76 changes: 40 additions & 36 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,54 @@
<!--- Provide a summary of your changes in the Pull Request Title above. -->
<!--- If this is a work in progress (not yet ready to be merged), make this a draft pull request. -->
## Proposed Changes
*(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, [use a keyword to link this pull request to the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).)*

## Motivation and Context
<!--- Why is this pull request required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
...

<details>
<summary>Screenshots of your changes (if applicable)</summary>

## Your Changes
<!--- Describe your changes here. -->
<!--- Include how your changes may affect other areas of the application, if relevant. -->
**Description**:
</details>

<details>
<summary>Associated <a href="https://github.com/MarkUsProject/Wiki">documentation repository</a> pull request (if applicable)</summary>

**Type of change** (select all that apply):
<!--- Put an `x` in all the boxes that apply. -->
<!--- Remove any lines that do not apply. -->
</details>

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Refactoring (internal change to codebase, without changing functionality)
- [ ] Test update (change that modifies or updates tests only)
- [ ] Other (please specify):
## Type of Change
*(Write an `X` or a brief description next to the type or types that best describe your changes.)*

| Type | Applies? |
|-----------------------------------------------------------------------------------------|----------|
| 🚨 *Breaking change* (fix or feature that would cause existing functionality to change) | |
|*New feature* (non-breaking change that adds functionality) | |
| 🐛 *Bug fix* (non-breaking change that fixes an issue) | |
| 🎨 *User interface change* (change to user interface; provide screenshots) | |
| ♻️ *Refactoring* (internal change to codebase, without changing functionality) | |
| 🚦 *Test update* (change that *only* adds or modifies tests) | |
| 📦 *Dependency update* (change that updates a dependency) | |
| 🔧 *Internal* (change that *only* affects developers or continuous integration) | |

## Testing
<!--- Please describe in detail how you tested this pull request. -->
<!--- This can include tests you added and manual testing through the web interface. -->

## Checklist
*(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the `[ ]` into a `[x]` in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)*

## Questions and Comments (if applicable)
<!-- Ask any questions you have for the maintainers of this project regarding this PR. -->
<!-- Please describe the steps you have already taken to find the answer to your question. -->
<!-- This will ensure that we can give you clear and relevant advice. -->
<!-- If you have additional comments add them here as well. -->
Before opening your pull request:

- [ ] I have performed a self-review of my changes.
- Check that all changed files included in this pull request are intentional changes.
- Check that all changes are relevant to the purpose of this pull request, as described above.
- [ ] I have added tests for my changes, if applicable.
- This is **required** for all bug fixes and new features.
- [ ] I have updated the project documentation, if applicable.
- This is **required** for new features.
- [ ] If this is my first contribution, I have added myself to the list of contributors.

## Checklist
After opening your pull request:

- [ ] I have performed a self-review of my own code.
- [ ] I have verified that the pre-commit.ci checks have passed. <!-- (check after opening pull request) -->
- [ ] I have verified that the CI tests have passed. <!-- (check after opening pull request) -->
- [ ] I have reviewed the test coverage changes reported on Coveralls. <!-- (check after opening pull request) -->
- [ ] I have added tests for my changes. <!-- (delete this checklist item if not applicable) -->
- [ ] I have updated the Changelog.md file. <!-- (delete this checklist item if not applicable) -->
- [ ] I have made changes to the documentation and linked to that pull request below. <!-- (delete this checklist item if not applicable) -->
- [ ] I have updated the project Changelog (this is required for all changes).
- [ ] I have verified that the pre-commit.ci checks have passed.
- [ ] I have verified that the CI tests have passed.
- [ ] I have reviewed the test coverage changes reported by Coveralls.
- [ ] I have [requested a review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) from a project maintainer.

### Pull request to make documentation changes (if applicable)
<!--- Add a link to a pull request on the MarkUsProject/Wiki repo -->
## Questions and Comments
*(Include any questions or comments you have regarding your changes.)*
26 changes: 15 additions & 11 deletions .github/workflows/test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
RSPEC_RENDER_VIEWS: true
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
Expand All @@ -52,26 +52,30 @@ jobs:
ruby-version: ruby-3.0
bundler-cache: true
- name: Set up node and cache packages
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install npm packages
run: npm ci
- name: Install python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.10"
- name: Get pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-jupyter.txt') }}-${{ hashFiles('requirements-scanner.txt') }}-${{ hashFiles('requirements-qr.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install python packages and playwright dependencies
run: |
python3.9 -m venv venv
python3.10 -m venv venv
./venv/bin/pip install -r requirements-jupyter.txt -r requirements-scanner.txt -r requirements-qr.txt
./venv/bin/playwright install chromium
./venv/bin/playwright install-deps chromium
Expand All @@ -82,13 +86,13 @@ jobs:
sudo sed -ri 's/(rights=")none("\s+pattern="PDF")/\1read\2/' /etc/ImageMagick-6/policy.xml
cp config/database.yml.ci config/database.yml
- name: Build assets
run: bundle exec rake javascript:build
run: |
bundle exec rake javascript:build
bundle exec rake css:build
- name: Set up database
run: bundle exec rails db:migrate
- name: Install chrome and chromedriver
- name: Install chromedriver
uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: '119.0.6045.199'
- name: Run chromedriver
run: chromedriver --whitelisted-ips &
- name: Run rspec tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ config/environments/*.local.yml

# local docker compose overrides
docker-compose.override.yml
compose.override.yaml
24 changes: 13 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
exclude: |
Expand All @@ -10,20 +10,19 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v3.1.0
hooks:
- id: prettier
types_or: [javascript, jsx, css, scss, html]
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v15.11.0
rev: v16.6.1
hooks:
- id: stylelint
additional_dependencies: [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
]
args: ["--fix"]
types_or: ["css", "scss"]
Expand All @@ -33,7 +32,7 @@ repos:
app/assets/stylesheets/common/_reset.scss
)$
- repo: https://github.com/rubocop/rubocop
rev: v1.57.2
rev: v1.64.1
hooks:
- id: rubocop
args: ["--autocorrect"]
Expand All @@ -46,8 +45,11 @@ repos:
Vagrantfile
)$
additional_dependencies:
- rubocop-rails:2.19.1
- rubocop-performance:1.17.1
- rubocop-rails:2.24.1
- rubocop-performance:1.21.0
- rubocop-factory_bot:2.25.1
- rubocop-rspec:2.28.0
- rubocop-rspec_rails:2.28.2

exclude: vendor

Expand Down
83 changes: 83 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require:
- rubocop-rails
- rubocop-performance
- rubocop-factory_bot
- rubocop-rspec
- rubocop-rspec_rails

AllCops:
Exclude:
Expand All @@ -12,6 +15,15 @@ AllCops:
SuggestExtensions: false
TargetRubyVersion: 2.7

Capybara/ClickLinkOrButtonStyle: # TODO: Enable and fix errors after reviewing system tests
Enabled: false

FactoryBot/AssociationStyle:
EnforcedStyle: explicit

FactoryBot/ConsistentParenthesesStyle:
EnforcedStyle: require_parentheses

Layout/EmptyLineAfterGuardClause:
Enabled: false

Expand Down Expand Up @@ -173,6 +185,77 @@ Rails/SkipsModelValidations:
Rails/UniqueValidationWithoutIndex:
Enabled: false

RSpec/AnyInstance:
Enabled: false

RSpec/ContextWording:
Enabled: false

RSpec/DescribeClass: # Disabled because some suites are note testing classes or modules
Enabled: false

RSpec/DescribedClass:
EnforcedStyle: explicit

RSpec/EmptyExampleGroup: # Does not recognize ActionPolicy tests (succeed/failed)
Enabled: false

RSpec/ExampleLength:
Enabled: false

RSpec/ExampleWording:
Enabled: false

RSpec/ExpectChange:
EnforcedStyle: block

RSpec/FactoryBot: # Extracted into rubocop-factory_bot gem
Enabled: false

RSpec/IndexedLet:
Enabled: false

RSpec/InstanceVariable: # TODO: enable this check and fix the errors
Enabled: false

RSpec/MatchArray:
Enabled: false

RSpec/MessageSpies:
EnforcedStyle: receive

RSpec/MetadataStyle:
EnforcedStyle: hash

RSpec/MultipleExpectations:
Enabled: false

RSpec/MultipleMemoizedHelpers:
Enabled: false

RSpec/NamedSubject:
Enabled: false

RSpec/NestedGroups:
Enabled: false

RSpec/PendingWithoutReason:
Enabled: false

RSpec/Rails: # Extracted into rubocop-factory_bot gem
Enabled: false

RSpec/ScatteredLet:
Exclude:
- spec/policies/**/*.rb

RSpec/ScatteredSetup:
Exclude:
- spec/policies/**/*.rb

RSpec/StubbedMock:
Enabled: false

Security/IoMethods:
Enabled: true

Expand Down
3 changes: 2 additions & 1 deletion .stylelintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extends: ["stylelint-config-sass-guidelines", "stylelint-config-prettier"]
extends: ["stylelint-config-sass-guidelines"]
rules:
scss/at-extend-no-missing-placeholder: null
scss/no-global-function-names: null
max-nesting-depth: 4
selector-class-pattern: null
selector-max-compound-selectors: 6
Expand Down
Loading

0 comments on commit 072faf1

Please sign in to comment.