Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#syntax=docker/dockerfile:1
ARG VARIANT=3.3.10
ARG VARIANT=3.4.8
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT} AS base

# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.10
3.4.8
2 changes: 1 addition & 1 deletion Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#syntax=docker/dockerfile:1
FROM ruby:3.3.10-slim AS base
FROM ruby:3.4.8-slim AS base

ARG NODE_VERSION=20.18.2

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#syntax=docker/dockerfile:1
FROM ruby:3.3.10-slim AS base
FROM ruby:3.4.8-slim AS base

ARG NODE_VERSION=20.18.2

Expand Down
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "3.3.10"
ruby "3.4.8"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.1.5.1"
Expand Down Expand Up @@ -54,7 +54,7 @@ gem "bootsnap", ">= 1.4.4", require: false
gem "image_processing", ">= 1.2"

# Webpack bundler for rails
gem "shakapacker", "6.0.0"
gem "shakapacker", ">= 9.5.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

shakapacker 9.5 migration guide breaking changes version 6

💡 Result:

Summary: key breaking changes and migration steps when moving from Shakapacker v6 → v9.5.

What changed (most important):

  • Renamed “webpacker” → “shakapacker” across config, env vars, binstubs, rake tasks, and helpers (config/webpacker.yml → config/shakapacker.yml, WEBPACKER_* → SHAKAPACKER_*). [1][4]
  • You must upgrade both the Ruby gem and the npm package (keep versions aligned and run bundle update + your JS package manager). [2][3]
  • Default webpack config API changed: replace old webpackConfig usage with generateWebpackConfig() (or use globalMutableWebpackConfig to retain v6 behavior). [4]
  • Static asset paths: top-level directories are no longer stripped — update image_pack_tag/asset references to include the top-level folder (e.g., images/ or static/images/). [4]
  • SWC/transform behavior: newer v9.x releases include SWC-related configuration changes (users of SWC loose mode should review the SWC breaking-change notes in the v9 docs). [1]
  • Security/ENV exposure fix in v9.5: default build no longer exposes all process.env to client bundles — only NODE_ENV, RAILS_ENV, WEBPACK_SERVE are exposed; public vars must use SHAKAPACKER_PUBLIC_ prefix. Rotate any secrets if previously exposed. (Upgrade to v9.5.0+ recommended.) [2][7]

Basic migration steps:

  1. Update gem and npm package to matching shakapacker versions (use exact versions, not broad ranges). Run bundle update shakapacker and npm/yarn/pnpm install. [2][3]
  2. Run the install/binstub task to regenerate files: rails shakapacker:install or rake shakapacker:install (and run rake shakapacker:binstubs if present), then remove old bin/webpacker* files. [4][5]
  3. Rename config and environment variables (config/webpacker.yml → config/shakapacker.yml; WEBPACKER_* → SHAKAPACKER_*). Search/replace Ruby constant Webpacker → Shakapacker where used. [4]
  4. Update code that imported webpackConfig to call generateWebpackConfig() (or import globalMutableWebpackConfig). [4]
  5. Update asset helper references for any top-level static directories. [4]
  6. Review SWC and env-exposure settings; explicitly allow public env vars via SHAKAPACKER_PUBLIC_* if needed and rotate any secrets if you were on versions before v9.5. [1][7]
  7. Run full test/build: rm -rf node_modules/.cache, bundle exec rails assets:precompile, run dev server/bin tasks and test app. [1][3]

Docs / references:

  • Shakacode docs — v7/v9 upgrade notes & guidance. [1][4]
  • GitHub shakapacker repo (upgrade/installation guidance). [5]
  • Rubygems/npm release info showing v9.5 and release notes. [2][3]
  • Security advisory / v9.5 note (env exposure fix). [7]

If you want, I can fetch and paste exact changelog lines for v9.5 and the SWC breaking-change section.


Tighten version constraint for shakapacker.

The open-ended >= 9.5.0 constraint could pull in future major versions (e.g., v10) with additional breaking changes. Use the pessimistic constraint operator instead:

-gem "shakapacker", ">= 9.5.0"
+gem "shakapacker", "~> 9.5.0"

This constrains updates to compatible versions (v9.5.0 through v9.x) while still allowing patch and minor releases within the v9 series.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
gem "shakapacker", ">= 9.5.0"
gem "shakapacker", "~> 9.5.0"
🤖 Prompt for AI Agents
In `@Gemfile` at line 57, Replace the open-ended version constraint on the gem
"shakapacker" in the Gemfile with a pessimistic (tilde) constraint so it allows
patch/minor updates within the 9.x series but prevents accidental upgrades to
major version 10; locate the gem declaration gem "shakapacker" and update its
version specifier accordingly to lock to 9.x while still permitting 9.5.0+
patches/minors.


# React hook for rails
gem "react-rails", "2.6.2"
Expand Down Expand Up @@ -139,6 +139,9 @@ gem "ahoy_matey"

gem "httparty", ">= 0.24.0"

gem "csv"
gem "observer"

# Use google calendar for integration with Miru
gem "google-api-client", require: "google/apis/calendar_v3"

Expand Down
63 changes: 35 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ GEM
execjs (~> 2.0)
base64 (0.3.0)
bcrypt (3.1.18)
benchmark (0.4.1)
benchmark (0.5.0)
better_html (2.0.1)
actionview (>= 6.0)
activesupport (>= 6.0)
ast (~> 2.0)
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (3.3.1)
bigdecimal (4.0.1)
bindex (0.8.1)
bootsnap (1.16.0)
msgpack (~> 1.2)
Expand All @@ -167,8 +167,8 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
concurrent-ruby (1.3.5)
connection_pool (2.5.4)
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
countries (5.3.1)
unaccent (~> 0.3)
crack (0.4.5)
Expand Down Expand Up @@ -218,7 +218,7 @@ GEM
elasticsearch-transport (7.13.3)
faraday (~> 1)
multi_json
erb (5.1.1)
erb (6.0.1)
erubi (1.13.1)
et-orbi (1.2.11)
tzinfo
Expand Down Expand Up @@ -309,7 +309,7 @@ GEM
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
httpclient (2.8.3)
i18n (1.14.7)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
Expand All @@ -318,8 +318,8 @@ GEM
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
io-console (0.8.1)
irb (1.15.2)
io-console (0.8.2)
irb (1.16.0)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
Expand Down Expand Up @@ -355,7 +355,7 @@ GEM
railties (>= 5.2)
rexml
logger (1.7.0)
loofah (2.24.1)
loofah (2.25.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -373,7 +373,8 @@ GEM
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.9)
minitest (5.26.0)
minitest (6.0.1)
prism (~> 1.5)
mission_control-jobs (0.2.1)
importmap-rails
rails (~> 7.1)
Expand All @@ -399,14 +400,14 @@ GEM
netrc (0.11.0)
newrelic_rpm (9.8.0)
nio4r (2.7.4)
nokogiri (1.18.10)
nokogiri (1.19.0)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.18.10-arm64-darwin)
nokogiri (1.19.0-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.10-x86_64-darwin)
nokogiri (1.19.0-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.10-x86_64-linux-gnu)
nokogiri (1.19.0-x86_64-linux-gnu)
racc (~> 1.4)
oauth2 (2.0.9)
faraday (>= 0.17.3, < 3.0)
Expand All @@ -415,6 +416,7 @@ GEM
rack (>= 1.2, < 4)
snaky_hash (~> 2.0)
version_gem (~> 1.1)
observer (0.1.2)
omniauth (2.1.1)
hashie (>= 3.4.6)
rack (>= 2.2.3)
Expand All @@ -432,6 +434,7 @@ GEM
omniauth (~> 2.0)
orm_adapter (0.5.0)
os (1.1.4)
package_json (0.2.0)
pagy (5.10.1)
activesupport
parallel (1.22.1)
Expand All @@ -456,6 +459,7 @@ GEM
net-smtp
premailer (~> 1.7, >= 1.7.9)
prettyprint (0.2.0)
prism (1.8.0)
psych (4.0.6)
stringio
public_suffix (5.0.4)
Expand All @@ -465,21 +469,21 @@ GEM
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.8.1)
rack (3.2.3)
rack (3.2.4)
rack-cors (2.0.0)
rack (>= 2.0.0)
rack-mini-profiler (3.0.0)
rack-mini-profiler (4.0.1)
rack (>= 1.2.0)
rack-protection (3.0.5)
rack
rack-proxy (0.7.6)
rack-proxy (0.7.7)
rack
rack-session (2.1.1)
base64 (>= 0.1.0)
rack (>= 3.0.0)
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.2.1)
rackup (2.3.1)
rack (>= 3)
rails (7.1.5.2)
actioncable (= 7.1.5.2)
Expand Down Expand Up @@ -515,12 +519,12 @@ GEM
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.3.0)
rake (13.3.1)
ransack (4.1.1)
activerecord (>= 6.1.5)
activesupport (>= 6.1.5)
i18n
rdoc (6.15.0)
rdoc (7.1.0)
erb
psych (>= 4.0.0)
tsort
Expand All @@ -531,7 +535,7 @@ GEM
railties (>= 3.2)
tilt
regexp_parser (2.9.0)
reline (0.6.2)
reline (0.6.3)
io-console (~> 0.5)
representable (3.2.0)
declarative (< 0.1.0)
Expand Down Expand Up @@ -620,15 +624,16 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
semantic_range (3.1.0)
sentry-rails (5.17.3)
railties (>= 5.0)
sentry-ruby (~> 5.17.3)
sentry-ruby (5.17.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
shakapacker (6.0.0)
shakapacker (9.5.0)
activesupport (>= 5.2)
package_json
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
Expand Down Expand Up @@ -667,11 +672,11 @@ GEM
sprockets (>= 3.0.0)
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.7)
stringio (3.2.0)
stripe (8.2.0)
strong_migrations (1.4.2)
activerecord (>= 5.2)
thor (1.4.0)
thor (1.5.0)
tilt (2.0.11)
timeout (0.4.3)
trailblazer-option (0.1.2)
Expand Down Expand Up @@ -707,7 +712,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.7.3)
zeitwerk (2.7.4)
zerobounce-sdk (1.2.0)
dotenv
rest-client (~> 2.1)
Expand All @@ -734,6 +739,7 @@ DEPENDENCIES
bundler-audit
capybara (>= 3.26)
countries
csv
data_migrate
database_cleaner (~> 2.0)
debug (>= 1.9.0)
Expand All @@ -758,6 +764,7 @@ DEPENDENCIES
money
newrelic_rpm (~> 9.8.0)
nokogiri (>= 1.18.4)
observer
omniauth-google-oauth2 (~> 1.0)
omniauth-rails_csrf_protection (~> 1.0)
pagy (~> 5.10)
Expand Down Expand Up @@ -789,7 +796,7 @@ DEPENDENCIES
selenium-webdriver (>= 4.0.0)
sentry-rails
sentry-ruby (~> 5.17)
shakapacker (= 6.0.0)
shakapacker (>= 9.5.0)
shoulda-callback-matchers (~> 1.1.1)
shoulda-matchers (~> 5.1)
simplecov
Expand All @@ -804,7 +811,7 @@ DEPENDENCIES
zerobounce-sdk

RUBY VERSION
ruby 3.3.10p183
ruby 3.4.8p72

BUNDLED WITH
2.4.10
8 changes: 6 additions & 2 deletions app/controllers/internal_api/v1/holidays_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ def update
authorize Holiday

year = params[:year]
BulkHolidayService.new(year, holiday_params, current_company).process
render json: { notice: "Holiday Info updated successfully" }, status: :ok
service = BulkHolidayService.new(year, holiday_params, current_company)
if service.process
render json: { notice: "Holiday Info updated successfully" }, status: :ok
else
render json: { field_errors: service.errors }, status: :unprocessable_entity
end
end

private
Expand Down
20 changes: 12 additions & 8 deletions app/javascript/src/apis/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ class ApiHandler {
setTimeout(() => (window.location.href = "/"), 500);
}

Toastr.error(
error.response?.data?.errors ||
error.response?.data?.error ||
error.response?.data?.notice ||
error.message ||
error.notice ||
"Something went wrong!"
);
// Skip generic toast if field_errors are present (handled by the component)
if (!error.response?.data?.field_errors) {
Toastr.error(
error.response?.data?.errors ||
error.response?.data?.error ||
error.response?.data?.notice ||
error.message ||
error.notice ||
"Something went wrong!"
);
}

if (error.response?.status === 423) {
setTimeout(() => (window.location.href = "/"), 500);
}
Expand Down
Loading
Loading