Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 3.2 upgrade #255

Draft
wants to merge 140 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
5f0c547
Bump ruby to 3.2
paranoicsan Mar 13, 2023
1b8b6f7
[Breaking] Bump js-routes to 2.2.5
paranoicsan Mar 13, 2023
7c5912f
Activate ruby 3.x support for rubocop
paranoicsan Mar 13, 2023
ecd939d
Fix Lint/RedundantDirGlobSort
paranoicsan Mar 13, 2023
73895e3
Fix Naming/BlockForwarding
paranoicsan Mar 13, 2023
2c87c78
Fix Style/HashSyntax
paranoicsan Mar 13, 2023
0ef2646
Fix Style/RedundantFreeze
paranoicsan Mar 13, 2023
f7bbd2d
Bump outdated gems for minor versions
paranoicsan Mar 13, 2023
75aca7c
Fix Style/RedundantConstantBase
paranoicsan Mar 13, 2023
ce1ad41
Fix Style/RedundantStringEscape
paranoicsan Mar 13, 2023
2029a8b
Fix Style/HashSyntax
paranoicsan Mar 13, 2023
cc47923
Fix Style/ConcatArrayLiterals
paranoicsan Mar 13, 2023
d44eb98
Bump .ruby-version
paranoicsan Mar 13, 2023
9997e1d
Bump bundler 2.4.8 inside Gemfile.lock
paranoicsan Mar 13, 2023
197bda5
[Breaking] Remove Bitly gem
paranoicsan Mar 14, 2023
4c437ad
Bump outdated gems for minor versions
paranoicsan Mar 14, 2023
d48cde2
[pre Rails 7.0] Bump spring to 3.1.1
paranoicsan Mar 14, 2023
f75d50d
[pre Rails 7.0] Add sprockets-rails
paranoicsan Mar 14, 2023
c5227c1
Bump Rails to 7.0
paranoicsan Mar 14, 2023
5b239ec
Bump bullet to 7.0
paranoicsan Mar 14, 2023
0449bc4
New Dockerfile and cleanup
paranoicsan Apr 19, 2023
3dcac54
Conditionally enable back bullet gem and fix a typo
paranoicsan Apr 24, 2023
18c0107
[WIP] Massive update
paranoicsan Jun 28, 2023
2749b9c
Add custom commands to compose
paranoicsan Jun 28, 2023
44deaf2
Stick to Ruby 3.2.1
paranoicsan Jun 28, 2023
a6b02f5
Bump Redis version in compose
paranoicsan Jun 28, 2023
c172a80
Set precise Node version
paranoicsan Jun 28, 2023
e654801
Add apt-get clean commands
paranoicsan Jun 28, 2023
22d7571
Update UI for Access codes and Users
paranoicsan Jun 29, 2023
b2b3796
Remove Download and DownloadCategories models
paranoicsan Jun 29, 2023
7f142ff
Partially working Resource page
paranoicsan Jun 29, 2023
4d8678e
Tune up Curriculum page
paranoicsan Jun 29, 2023
293f7ac
Replace selectize with tom-select and tune up some pages
paranoicsan Jul 3, 2023
280bd4d
Fix bootstrap jquery issue with turbo-rails
paranoicsan Jul 3, 2023
3a66e7f
Fix font-awesome and document import
paranoicsan Jul 3, 2023
848ed25
Fix turbo-rails and bootstrap issue on main layout
paranoicsan Jul 5, 2023
cffddb3
Multiple reimport support
paranoicsan Jul 7, 2023
0f16fe4
Remove legacy controllers and other parts
paranoicsan Jul 7, 2023
4c843ee
Fix batch reimport functionality
paranoicsan Jul 7, 2023
3bd99d3
Minor fixes in XPath
paranoicsan Jul 12, 2023
d27a54d
Fix the issue with async import flag
paranoicsan Jul 17, 2023
d7983c3
Refactoring forms for Lesson and Material
paranoicsan Jul 24, 2023
5ae21ac
Fixed rubocop warnings
paranoicsan Jul 24, 2023
29c3418
Refactor import forms
paranoicsan Jul 24, 2023
80e4638
Add new form and service to import standards
paranoicsan Jul 24, 2023
5991f63
Bump will_paginate and add styling with Bootstrap to it
paranoicsan Jul 25, 2023
b9ef278
Remove grade formatting for metadata in document model
paranoicsan Jul 28, 2023
e076b76
Remove redundant 'async' check box in materials form
paranoicsan Jul 28, 2023
f1932d2
Enhance error handling for job result fetching
paranoicsan Jul 31, 2023
01d852c
Fix fontawesome icons
paranoicsan Jul 31, 2023
c5722f3
Correct delete button methods for various models
paranoicsan Jul 31, 2023
45d5c8c
Store opts parameter as instance variable in tags
paranoicsan Aug 2, 2023
09d8aa3
Update method arguments for I18n and Google Drive API
paranoicsan Aug 3, 2023
ab2891e
Explicitly initialize @service_errors attribute
paranoicsan Aug 7, 2023
1193ecd
Normalize metadata search in Resource model
paranoicsan Aug 9, 2023
be0b46b
Add type signatures for methods of multiple classes
paranoicsan Aug 15, 2023
152f259
Add Steep dependency and update various modules for improved type che…
paranoicsan Aug 15, 2023
3dc1af8
Add unreleased version of lt-lcms with RBS
paranoicsan Aug 21, 2023
533a5e6
Remove the pandoc-ruby dependency
paranoicsan Aug 22, 2023
54af179
Move ResourceHelpers from lcms engine to spec folder
paranoicsan Aug 22, 2023
b64e1c2
Remove Agenda metadata
paranoicsan Aug 22, 2023
191ebc8
Remove unnecessary priority icon and metadata injection
paranoicsan Aug 22, 2023
0403d98
Remove PdTag and GroupTag
paranoicsan Aug 22, 2023
0d5485b
Add more RBS signatures and update codebase
paranoicsan Aug 22, 2023
e616ac0
[!!!] Remove ambiguous constant declaration
paranoicsan Aug 22, 2023
5e99a5b
Add more RBS signatures and code cleanup
paranoicsan Aug 25, 2023
cb9f84f
Fix interface signature for TocHelpers module
paranoicsan Aug 25, 2023
439e609
Add RBS signature for HtmlSanitizer
paranoicsan Aug 25, 2023
660ca6f
Remove debug leftovers
paranoicsan Aug 25, 2023
2240fd8
Fix constant definitions
paranoicsan Aug 25, 2023
2dcc665
Update lt-lcms gem reference
paranoicsan Aug 28, 2023
f2b536e
Refactor base_tag class and update type signature
paranoicsan Aug 28, 2023
ee381d5
Fix typo in Resource and refactor code to improve readability and
paranoicsan Aug 29, 2023
6c64131
Remove unused file, update certain methods and create new RBS signatures
paranoicsan Sep 1, 2023
ef05268
Correctly get the constant values from within child classes
paranoicsan Sep 1, 2023
aea8153
Add async attribute to reimport forms
paranoicsan Sep 4, 2023
ed54747
Improve error handling and cleanup methods in multiple classes
paranoicsan Sep 5, 2023
c0d17cf
Update dependencies and Rubocop fixes
paranoicsan Sep 5, 2023
5746399
Add scripts to be run on CodeShip CI
paranoicsan Sep 5, 2023
647cc0d
Update lt-lcms, lt-google-api and gems
paranoicsan Sep 5, 2023
b240d77
Added RBS signatures from non-published gems
paranoicsan Sep 5, 2023
c0e7d2a
Fix tests
paranoicsan Sep 7, 2023
8c684c4
Update dependencies
paranoicsan Sep 7, 2023
c10dc00
Add missed RBS signature
paranoicsan Sep 8, 2023
36bed96
added base presenter rbs
shlag3n Sep 19, 2023
dea0adb
updated filterable to work with materials/fixed sum deprecation
shlag3n Sep 27, 2023
8385150
updated loading yaml to support aliases
shlag3n Nov 11, 2023
dac5978
bumped lt-lcms/lt-google-api versions
shlag3n Dec 23, 2023
fdcf35c
fixed steep check
shlag3n Dec 24, 2023
72ce746
fixed elasticsearch adapter
shlag3n Dec 24, 2023
b7c4e50
Update RBS signatures and revise gem_rbs_collection revision
paranoicsan Dec 26, 2023
1e4f673
Exclude map files from CodeClimate analysis
paranoicsan Dec 26, 2023
1300279
fixed querying reimport type for import_status
shlag3n Dec 30, 2023
fbc99bb
Rails 7: Update method for retrieving DB config in tasks
paranoicsan Jan 3, 2024
4846441
Add backward compatibility for React props names
paranoicsan Jan 18, 2024
0f1769c
Refactor error handling in nested_reimportable
paranoicsan Jan 24, 2024
57585d3
Modify handling of flash messages in Lcms::Engine
paranoicsan Jan 30, 2024
063cc3f
Add Flashable module and implement message storage in Redis
paranoicsan Jan 30, 2024
d856259
updated puppeteer section for pdf generation
shlag3n Jan 31, 2024
be778c7
Fix the bug with Lcms::Engine::NestedReimportable#flatten_result
paranoicsan Jan 31, 2024
d0fd94f
Improve comments for job fetching functions
paranoicsan Jan 31, 2024
c863a29
Update lt-lcms and wicked_pdf gem versions
paranoicsan Feb 2, 2024
cd19381
Add deprecation warning and refactor RBS
paranoicsan Feb 8, 2024
c521526
Add simple bold, italic, line break tags support
paranoicsan Apr 16, 2024
7258ff9
Add RBS for module 'NestedResqueJob' and update default parameter
paranoicsan Apr 25, 2024
e9c3d72
Add more RBS files
paranoicsan Apr 25, 2024
a2bda6d
[Breaking] Rename import_status_for to import_status_for_nested
paranoicsan Apr 25, 2024
ba6c19c
Add types for `Lcms::Engine::RetryDelayed` module
paranoicsan Apr 26, 2024
02c87dc
Refactor route helper calls in PathHelper module
paranoicsan May 5, 2024
8f98fa9
extended material presenter content for with options
shlag3n Jul 28, 2024
5eb5180
fixed collecting errors for nested jobs
shlag3n Aug 21, 2024
9bc8ae7
Update docker-compose version and correct a comment typo
paranoicsan Sep 13, 2024
d75fa41
Update wicked_pdf gem to latest commit
paranoicsan Sep 22, 2024
0734501
Add detailed information links to README
paranoicsan Sep 22, 2024
5728fa6
Expand curriculum type handling for titles
paranoicsan Sep 23, 2024
f8c9051
Refactor material filtering logic and search form
paranoicsan Sep 23, 2024
cb01bba
Add seed script for development standards
paranoicsan Sep 23, 2024
adc21fa
Merge pull request #262
paranoicsan Sep 23, 2024
ea84ed7
[BREAKING] Refactor query handling in admin controllers
paranoicsan Sep 23, 2024
203a04a
Merge pull request #263
paranoicsan Sep 23, 2024
1041365
Refactor Queryable module and add Rails 7 override guide
paranoicsan Sep 24, 2024
8ef228e
Update controllers and views to include query parameters in redirects
paranoicsan Sep 24, 2024
e3e973b
Update CKEditor version
paranoicsan Sep 25, 2024
950af41
Merge pull request #264
paranoicsan Sep 25, 2024
131dce0
Destroy lessons's resources
paranoicsan Sep 27, 2024
2d94a33
Fix the specs from recent updates
paranoicsan Sep 27, 2024
a3c3fa8
RBS related updates
paranoicsan Sep 27, 2024
9536a24
Merge pull request #265
paranoicsan Sep 27, 2024
d8ad149
Improve metadata filtering for multiple table names
paranoicsan Oct 3, 2024
612b880
updated text tags substitution to parse nested text tags
shlag3n Nov 7, 2024
1429622
[hotfix] fixed rbs checks
shlag3n Nov 24, 2024
6da8c1f
Add Webhook feature and api to get resources
Oct 24, 2024
7b77c4c
Merge pull request #268 from learningtapestry/ruby-3-upgrade-api
mbruszewski Dec 2, 2024
8c20f25
[hotfix] fixed strip content to respect tag's placeholder
shlag3n Dec 5, 2024
dd5b390
Merge pull request #269
paranoicsan Dec 14, 2024
fff8595
added after reimport hook for standards reimporting service
shlag3n Jan 8, 2025
c087cea
updated gdrive list files to escape all type of quotes
shlag3n Feb 15, 2025
506d8ad
fixed parsing tables with thead
shlag3n Feb 20, 2025
97d72d5
Merge pull request #270 from learningtapestry/hotfix-tables-with-headers
shlag3n Feb 20, 2025
dae31c0
updated import status js component
shlag3n Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ checks:
method-complexity:
enabled: true
config:
threshold: 20
threshold: 30
method-count:
enabled: true
config:
Expand Down Expand Up @@ -74,6 +74,7 @@ ratings:
exclude_paths:
- app/assets/javascripts/lcms/engine/vendor/**/*
- features/**/*
- public/lcms-engine-assets/**/*.map
- spec/**/*
- vendor/**/*
- node_modules/**/*
Expand Down
20 changes: 20 additions & 0 deletions .codeship/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

gem update --system 3.4.12
gem install bundler:2.4.12

bundle _2.4.12_ install

rbs collection install
rbs collection update

bin/overcommit --sign
if ! [email protected] GIT_AUTHOR_NAME='ci user' bundle exec overcommit --run; then
exit 1
fi

# Setup environment
echo -e 'APPLICATION_DOMAIN=example.org' > .env
RAILS_ENV="test" bin/rails db:create
RAILS_ENV="test" bin/rails db:schema:load
RAILS_ENV="test" bin/rails db:migrate
3 changes: 3 additions & 0 deletions .codeship/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

RAILS_ENV="test" bundle exec rspec
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pdfs
.DS_Store
.generators
.rakeTasks
public/lcms_engine_packs
yarn-debug.log*
yarn-integrity
yarn-error.log
3 changes: 1 addition & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ POSTGRESQL_DATABASE=
POSTGRESQL_USERNAME=
POSTGRESQL_PASSWORD=
POSTGRESQL_PORT=
WEBPACKER_CHECK_YARN=
WKHTMLTOPDF_PATH=

# OTHER VARIABLES
AIR_BRAKE_PROJECT_ID=
AIR_BRAKE_PROJECT_KEY=
BITLY_API_TOKEN=
ENABLE_BASE64_CACHING=
GOOGLE_APPLICATION_FOLDER_ID=
GOOGLE_APPLICATION_PREVIEW_FOLDER_ID=
Expand All @@ -32,3 +30,4 @@ GOOGLE_API_CLIENT_UPLOAD_TIMEOUT=
PUPPETEER_TIMEOUT=
RESQUE_NAMESPACE=
WORKERS_COUNT=
API_SECRET_KEY=
4 changes: 1 addition & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
"globals": {
"$": false,
"ga": false,
"Foundation": false,
"Modernizr": false,
"Routes": false
"Modernizr": false
},
"plugins": ["react", "jsx-a11y", "prettier"],
"settings": {
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ spec/dummy/public/assets/

coverage
/yarn-error.log
/.gem_rbs_collection/

docker-compose.personal.yml
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.17.0
18.15.0
15 changes: 13 additions & 2 deletions .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ PreCommit:
BundleCheck:
enabled: true

BundleOutdated:
enabled: true
# BundleOutdated:
# enabled: true

LocalPathsInGemfile:
enabled: true

ExecutePermissions:
enabled: true
exclude:
- .codeship/*
- bin/*
- spec/dummy/bin/*

Expand All @@ -36,6 +37,16 @@ PreCommit:
TrailingWhitespace:
enabled: true

TypeCheck:
enabled: true
description: RBS check
command: [ 'steep', 'check' ]

ShellCheck:
enabled: true
exclude:
- node_modules/**/*

PostCheckout:
ALL:
quiet: true # Change all post-checkout hooks to only display output on failure
Expand Down
8 changes: 6 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ AllCops:
- spec/dummy/db/schema.rb
- spec/dummy/bin/*
- templates/*
- config/initializers/simple_form_bootstrap.rb
- Steepfile
NewCops: enable
TargetRubyVersion: 2.7
TargetRubyVersion: 3.2

Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec

Layout/LineLength:
Max: 120
Expand All @@ -38,7 +43,6 @@ Metrics/BlockLength:
- '**/*_spec.rb'
- 'config/routes.rb'
- 'lcms-engine.gemspec'
- 'lib/tasks/elasticsearch.rake'
AllowedMethods: ['guard', 'included', 'class_eval']

Metrics/ClassLength:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.4
3.2.1
1 change: 0 additions & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
docs
coverage
app/assets/stylesheets/lcms/engine/vendors/*
app/assets/stylesheets/lcms/engine/utils/_styles_override.scss
app/assets/stylesheets/lcms/engine/utils/_mixins.scss
app/assets/stylesheets/lcms/engine/base/_typography.scss
app/assets/stylesheets/lcms/engine/print/_typography.scss
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/learningtapestry/lcms-engine/compare/v0.5.4...HEAD)

### Added

- Parse error propagation: errors in tags and inside metadata tables are now displayed after import - [@paranoicsan](https://github.com/paranoicsan)

### Changed

- [BREAKING] Update CKEditor version (see [CKEditor usage](docs/ckeditor-usage.md)) - [@paranoicsan](https://github.com/paranoicsan)
- [BREAKING] Refactor query handling in admin controllers - [@paranoicsan](https://github.com/paranoicsan)
- [BREAKING] Rename `import_status_for` to `import_status_for_nested` inside `Lcms::Engine::NestedReimportable` - [@paranoicsan](https://github.com/paranoicsan)
- Normalize metadata search in Resource model - [@paranoicsan](https://github.com/paranoicsan)

## [0.5.4](https://github.com/learningtapestry/lcms-engine/compare/v0.5.3...v0.5.4) - 2022.12.30

### Changed
Expand Down
52 changes: 41 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
FROM ruby:2.7.7
FROM ruby:3.2.1

ENV APP_PATH /app/
ENV LANG C.UTF-8
ENV APP_PATH=/app/
ENV LANG=C.UTF-8

WORKDIR $APP_PATH

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
RUN apt-get autoclean \
&& apt-get clean \
&& apt-get update -qqy \
&& apt-get install -y --no-install-recommends nodejs yarn \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
&& apt-get install -y --no-install-recommends \
build-essential \
chromium-driver \
postgresql-client-13 \
shellcheck \
tzdata \
&& rm -r /var/lib/apt/lists/* /var/cache/apt/*

# install specific wkhtmltopdf binary
RUN apt-get update -qqy \
&& WK_VERSION=0.12.6.1-2 \
&& ARCH=$(dpkg --print-architecture) \
&& CODENAME=$(. /etc/os-release; echo $VERSION_CODENAME) \
&& curl -LSfso wkhtmltopdf.deb https://github.com/wkhtmltopdf/packaging/releases/download/$WK_VERSION/wkhtmltox_$WK_VERSION.${CODENAME}_$ARCH.deb \
&& apt-get install -qy xfonts-75dpi xfonts-base ./wkhtmltopdf.deb \
&& rm wkhtmltopdf.deb \
&& rm -r /var/lib/apt/lists/* /var/cache/apt/*

# Add codebase
COPY . $APP_PATH

# Install gems
RUN gem install bundler:2.4.8 \
RUN gem update --system 3.4.12 \
&& gem install bundler:2.4.12 \
&& bundle install --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3 \
&& rm -rf /usr/local/bundle/cache/*.gem \
&& find /usr/local/bundle/gems/ -name "*.c" -delete \
&& find /usr/local/bundle/gems/ -name "*.o" -delete

# Install yarn packages
# install nvm & yarn & packages
COPY .nvmrc $APP_PATH
COPY package.json yarn.lock $APP_PATH
RUN yarn install

ENV NVM_DIR=/usr/local/nvm
ENV NODE_VERSION=18.15.0
ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

SHELL ["/bin/bash", "--login", "-i", "-c"]
RUN mkdir -p /usr/local/nvm \
&& curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default \
&& npm install -g yarn \
&& yarn install
12 changes: 10 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ gemspec
# To use a debugger
# gem 'byebug', group: [:development, :test]

gem 'wicked_pdf', git: 'https://github.com/learningtapestry/wicked_pdf.git',
gem 'lt-google-api', github: 'learningtapestry/lt-google-api',
branch: 'ruby-3-upgrade',
ref: '3dd76b6'

gem 'lt-lcms', github: 'learningtapestry/lt-lcms',
branch: 'ruby-3-upgrade',
ref: '9394667'

gem 'wicked_pdf', github: 'learningtapestry/wicked_pdf',
branch: 'puppeteer-support',
ref: '964a090'
ref: '50d961e'
Loading