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

Proposal index page performance improvements #585

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

DECIDIM_VERSION = { git: "https://github.com/AjuntamentdeBarcelona/decidim", branch: "release/0.28-stable-bcn" }.freeze
DECIDIM_VERSION = { git: "https://github.com/AjuntamentdeBarcelona/decidim", branch: "release/0.28-stable-bcn-proposal-optimization" }.freeze

ruby RUBY_VERSION

Expand Down Expand Up @@ -54,7 +54,6 @@ group :production do
gem "dalli"
gem "lograge"
gem "matrix"
gem "puma_worker_killer" # Used to restart puma workers every 6h and free memory
gem "rack_password"
gem "rack-ssl-enforcer"
gem "rack-timeout" # Let's kill long-running requests after the Heroku router has responded to
Expand Down
10 changes: 2 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/AjuntamentdeBarcelona/decidim
revision: f3b125243e409476b07c75a7438eafc529dd96c8
branch: release/0.28-stable-bcn
revision: efc37d11110560f35edda7655e24888549afe470
branch: release/0.28-stable-bcn-proposal-optimization
specs:
decidim (0.28.4)
decidim-accountability (= 0.28.4)
Expand Down Expand Up @@ -514,8 +514,6 @@ GEM
base64 (>= 0.1.0)
csv (>= 3.0.0)
geom2d (0.4.1)
get_process_mem (0.2.7)
ffi (~> 1.0)
globalid (1.2.1)
activesupport (>= 6.1)
graphql (2.0.31)
Expand Down Expand Up @@ -721,9 +719,6 @@ GEM
public_suffix (6.0.1)
puma (6.4.2)
nio4r (~> 2.0)
puma_worker_killer (0.3.1)
get_process_mem (~> 0.2)
puma (>= 2.7)
racc (1.8.1)
rack (2.2.10)
rack-attack (6.7.0)
Expand Down Expand Up @@ -1022,7 +1017,6 @@ DEPENDENCIES
origami
progressbar
puma
puma_worker_killer
rack-ssl-enforcer
rack-timeout
rack_password
Expand Down
44 changes: 0 additions & 44 deletions app/views/decidim/proposals/index.html.erb

This file was deleted.

4 changes: 0 additions & 4 deletions config/initializers/decidim_overrides.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# frozen_string_literal: true

Rails.application.config.to_prepare do
default_options = Decidim::Paginable::OPTIONS
Decidim::Paginable.send(:remove_const, :OPTIONS)
Decidim::Paginable::OPTIONS = (default_options + [10]).uniq.sort.freeze

Decidim::PaginateHelper.include(Decidim::PaginateHelperOverride)
Decidim::Initiatives::Admin::Permissions.prepend(Decidim::Initiatives::Admin::PermissionsOverride)
Decidim::SearchResourceFieldsMapper.prepend(Decidim::Overrides::SearchResourceFieldsMapper)
Expand Down
4 changes: 2 additions & 2 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
environment ENV.fetch("RACK_ENV", nil) || "development"

before_fork do
require "puma_worker_killer"
require "barnes"

PumaWorkerKiller.enable_rolling_restart
Barnes.start
end
5 changes: 2 additions & 3 deletions spec/lib/overrides_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
files: {
"/app/helpers/decidim/paginate_helper.rb" => "6fd69359386319d678c7a17cf64de4d9",
"/app/controllers/decidim/application_controller.rb" => "e86fe37834b061828536f9417fe56cd1", # ephemeral participation overrides
"/app/controllers/concerns/decidim/paginable.rb" => "a42381a0883c92df189ac61cebea3047", # update per_page method in assemblies_controller_override.rb and include 10 in OPTIONS constant
"/app/controllers/concerns/decidim/paginable.rb" => "a42381a0883c92df189ac61cebea3047", # update per_page method in assemblies_controller_override.rb
"/app/helpers/decidim/decidim_form_helper.rb" => "c534a1faa8da83aab5b2190f9d7534c3", # ephemeral participation overrides
"/app/models/decidim/component.rb" => "ec2a03817027336392f1e9e0893309ab", # ephemeral participation overrides
"/app/models/decidim/organization.rb" => "04eaf4467a1e0d891251c5cedf71f5e4", # ephemeral participation overrides
Expand Down Expand Up @@ -115,8 +115,7 @@
package: "decidim-proposals",
files: {
"/app/helpers/decidim/proposals/application_helper.rb" => "c17dd875a166cd0cd3c09b0e596ebef5",
"/app/presenters/decidim/proposals/proposal_presenter.rb" => "bbc7cee02125c1f8cf909219e48af337",
"/app/views/decidim/proposals/proposals/index.html.erb" => "48b62ae409b6ed736375772946ef2aa9" # remove map from index page
"/app/presenters/decidim/proposals/proposal_presenter.rb" => "bbc7cee02125c1f8cf909219e48af337"
}
},
{
Expand Down
1 change: 1 addition & 0 deletions spec/system/assemblies_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

it "lists 25 assemblies per page" do
within "#assemblies-grid" do
expect(page).to have_content("Results per page:\n25")
expect(page).to have_css("[id^=assembly_]", count: 25)
end
end
Expand Down
Loading