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

Remove results and add accountability to decidim #1926

Merged
merged 44 commits into from
Oct 16, 2017
Merged

Conversation

beagleknight
Copy link
Contributor

@beagleknight beagleknight commented Sep 25, 2017

🎩 What? Why?

Remove decidim-results from the decidim gem and includes decidim-assemblies and decidim-accountability.

📌 Related Issues

📋 Subtasks

  • Remove decidim-results (https://github.com/decidim/decidim-results)
  • Add decidim-assemblies
  • Add decidim-accountability
  • Migrate TemplateTexts to global settings
  • Fix seeds
  • Add partials to extend some views
  • Linked resources revision
  • Migration results
  • Check progresses
  • Linked results review

📷 Screenshots (optional)

N/A

👻 GIF

Nope.

@beagleknight beagleknight self-assigned this Sep 25, 2017
@codecov
Copy link

codecov bot commented Sep 25, 2017

Codecov Report

Merging #1926 into master will decrease coverage by 0.01%.
The diff coverage is 98.38%.

@@            Coverage Diff             @@
##           master    #1926      +/-   ##
==========================================
- Coverage   98.56%   98.55%   -0.02%     
==========================================
  Files        1149     1167      +18     
  Lines       25941    26499     +558     
==========================================
+ Hits        25570    26117     +547     
- Misses        371      382      +11

@ghost ghost added the in-progress label Sep 26, 2017
@josepjaume
Copy link
Contributor

@beagleknight what deprecation strategy will we use? I'd warn the users and provide a script (pure SQL?) to migrate from plain results to accountability results. Maybe even just a migration?

@beagleknight
Copy link
Contributor Author

@josepjaume I think it's better to provide some kind of documentation like we did with the followable resources. I agree using plain SQL to migrate those results. We can use this as a starting point:
https://github.com/AjuntamentdeBarcelona/decidim-barcelona/blob/master/lib/tasks/migrate_results_to_accountability.rake

@josepjaume
Copy link
Contributor

Oh, nice @beagleknight !

@@ -9,8 +9,7 @@ class ResultsController < Decidim::Accountability::ApplicationController

helper_method :results, :result, :stats_calculator, :first_class_categories, :category, :progress_calculator, :count_calculator, :current_scope, :template_texts

def home
end
def home; end
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed.

@@ -19,7 +19,7 @@ def display_count(count)
end

def active_class_if_current(scope)
%Q{class=active} if scope.to_s == current_scope.to_s
%(class=active) if scope.to_s == current_scope.to_s
Copy link
Contributor

Choose a reason for hiding this comment

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

use normal string?

@@ -26,7 +26,7 @@ def call

transaction do
update_result
result.touch if form_proposal_ids != current_proposal_ids
result.save! if form_proposal_ids != current_proposal_ids
Copy link
Contributor

Choose a reason for hiding this comment

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

unneeded? (update_result is already saving the result)

mrcasals
mrcasals previously approved these changes Sep 29, 2017
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
Copy link
Contributor

Choose a reason for hiding this comment

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

Or this...

# frozen_string_literal: true

shared_examples "manage results" do
RSpec.shared_examples "manage results" do
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't use RSpec.shared_examples but just shared_examples.

@@ -91,7 +93,7 @@
end

within "table" do
expect(page).to have_no_content(translated(result2.title))
expect(page).not_to have_content(translated(result2.title))
Copy link
Contributor

Choose a reason for hiding this comment

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

Better the previous way since it waits for the content to disappear.

@@ -0,0 +1,89 @@
# -*- coding: utf-8 -*-
Copy link
Contributor

Choose a reason for hiding this comment

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

RuboCop.... 🤔

@@ -57,5 +57,4 @@ Gem::Specification.new do |s|
s.add_development_dependency "decidim-participatory_processes", Decidim.version
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add decidim-assemblies and/or decidim-accountability here?

Copy link
Contributor

Choose a reason for hiding this comment

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

To be honest, decidim-core shouldn't depend on neither of them, and we should probably remove all the other dependencies as well, except for decidim-dev.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems sensible.

Copy link
Contributor

Choose a reason for hiding this comment

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

In reality, decidim-core might not work by itself. But it's a first step to detect unnecessary coupling.

@@ -5,4 +5,4 @@
require "decidim/participatory_processes/test/factories"
require "decidim/proposals/test/factories"
require "decidim/meetings/test/factories"
require "decidim/results/test/factories"
# require "decidim/results/test/factories"
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this, I guess.

@@ -4,7 +4,7 @@
require "decidim/participatory_processes/test/factories"
require "decidim/assemblies/test/factories"
require "decidim/proposals/test/factories"
require "decidim/results/test/factories"
# require "decidim/results/test/factories"
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this I guess.

@@ -5,7 +5,7 @@
require "decidim/assemblies/test/factories"
require "decidim/comments/test/factories"
require "decidim/meetings/test/factories"
require "decidim/results/test/factories"
# require "decidim/results/test/factories"
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this I guess.

@@ -157,6 +157,7 @@ en:
filters:
linked_classes:
all: All
dummyresource: Dummy resources
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this key correctly not including a hyphen? Nice decoupling of the decidim-results dependency for tests, by the way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it is!

@deivid-rodriguez
Copy link
Contributor

@beagleknight Awesome and tough work! 💪

I did a bit of CI-style reviewing, quite a lot of comments but easy to fix!

Copy link
Contributor

@mrcasals mrcasals left a comment

Choose a reason for hiding this comment

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

Can we address the isssues found by @deivid-rodriguez please?

@josepjaume josepjaume changed the title Remove results and add assemblies and accountability to decidim Remove results and add accountability to decidim Oct 4, 2017
@ghost ghost assigned josepjaume Oct 6, 2017
@josepjaume
Copy link
Contributor

@mrcasals @deivid-rodriguez can I ask for a re-review?

Copy link
Contributor

@mrcasals mrcasals left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@josepjaume josepjaume merged commit 6564fa6 into master Oct 16, 2017
@josepjaume josepjaume deleted the decidim-gem-changes branch October 16, 2017 12:19
@ghost ghost removed the in-review label Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants