Remove the description field from the elections component seeds#9448
Remove the description field from the elections component seeds#9448andreslucena merged 2 commits intodecidim:developfrom
Conversation
|
Great! I just saw this in nightly, that as it seeds the DB in a clean state, tonight has broken. |
andreslucena
left a comment
There was a problem hiding this comment.
I'm still seeing the same error:
$ bin/rails db:drop db:create db:migrate && bin/rails db:seed
(...)
Creating seeds for the participatory_processes space...
-- Creating pages component seeds for the participatory space with ID: 1...
-- Creating meetings component seeds for the participatory space with ID: 1...
-- Creating proposals component seeds for the participatory space with ID: 1...
-- Creating budgets component seeds for the participatory space with ID: 1...
-- Creating surveys component seeds for the participatory space with ID: 1...
-- Creating accountability component seeds for the participatory space with ID: 1...
-- Creating debates component seeds for the participatory space with ID: 1...
-- Creating sortitions component seeds for the participatory space with ID: 1...
-- Creating blogs component seeds for the participatory space with ID: 1...
-- Creating elections component seeds for the participatory space with ID: 1...
rails aborted!
ActiveModel::UnknownAttributeError: unknown attribute 'description' for Decidim::Elections::Question.
/home/apereira/Work/decidim/decidim/development_app/db/seeds.rb:9:in `<main>'
/home/apereira/Work/decidim/decidim/development_app/bin/rails:5:in `<top (required)>'
/home/apereira/Work/decidim/decidim/development_app/bin/spring:10:in `block in <top (required)>'
/home/apereira/Work/decidim/decidim/development_app/bin/spring:7:in `<top (required)>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)
There are other Questions in this same file for the different type of Elections.
This is what worked for me:
diff --git a/decidim-elections/lib/decidim/elections/component.rb b/decidim-elections/lib/decidim/elections/component.rb
index 000cb511de..004ec02401 100644
--- a/decidim-elections/lib/decidim/elections/component.rb
+++ b/decidim-elections/lib/decidim/elections/component.rb
@@ -113,9 +113,6 @@ Decidim.register_component(:elections) do |component|
{
election: upcoming_election,
title: Decidim::Faker::Localized.sentence(word_count: 2),
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
- end,
max_selections: Faker::Number.between(from: 1, to: 3),
weight: Faker::Number.number(digits: 1),
random_answers_order: Faker::Boolean.boolean(true_ratio: 0.5),
@@ -213,9 +210,6 @@ Decidim.register_component(:elections) do |component|
{
election: finished_election,
title: Decidim::Faker::Localized.sentence(word_count: 2),
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
- end,
max_selections: 2,
weight: Faker::Number.number(digits: 1),
random_answers_order: Faker::Boolean.boolean(true_ratio: 0.5),
@@ -336,9 +330,6 @@ Decidim.register_component(:elections) do |component|
{
election: election_with_results,
title: Decidim::Faker::Localized.sentence(word_count: 2),
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
- end,
max_selections: 2,
weight: Faker::Number.number(digits: 1),
random_answers_order: Faker::Boolean.boolean(true_ratio: 0.5),
@@ -456,9 +447,6 @@ Decidim.register_component(:elections) do |component|
{
election: ongoing_election,
title: Decidim::Faker::Localized.sentence(word_count: 2),
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
- end,
max_selections: 2,
weight: Faker::Number.number(digits: 1),
random_answers_order: Faker::Boolean.boolean(true_ratio: 0.5),
I cannot do the comment/suggestion in GH as it's out of the scope of the change. Can you check it please? Thanks
Ah sorry, I just removed the first occurrence as I thought it's the only one. Removed the rest as well. |
andreslucena
left a comment
There was a problem hiding this comment.
LGTM, it works as expected locally, thanks!
|
Looks like we have a failing unrelated spec from decidim-elections, that isn't being fixed by retrying: Let's wait for this last attempt, but I think we should merge it even if it fails again, as its unrelated to this fix, and the seeds bug is messing up with CI in other PRs (and |
Yes I noticed.
Yep, I just wanted to get the build fixed before merging any other PRs. I'm currently investigating the problem and it is failing on this line: Which is called e.g. here: This message is not visible if the public key is blank for the trustee, so I think there is some other spec that is interfering with this process. Because when I locally run this particular test ONLY, I cannot make it fail. I'll see if I can figure out what is causing it. |
|
All green @andreslucena, it's a flaky one. |
Oh, now that you say that, I think this could be the same problem that we had with #8796. My theory there was that decidim-elections (and the bulletin-board) doesn't play nice with The solution that I found was disabling that for "[CI] Elections (system public)". Maybe we need to disable it on "[CI] Elections (system admin)"? |
* Remove the description field from the elections component seeds * Remove the rest of the question descriptions from the seeds
This is also one option I was thinking actually. I wasn't locally running them in parallel. I was only targeting this one spec.
I'll try to debug a bit further but I'll try that if I don't figure out anything else. |
* Remove the description field from the elections component seeds * Remove the rest of the question descriptions from the seeds
* Remove the description field from the elections component seeds * Remove the rest of the question descriptions from the seeds
…dim#9448) * Remove the description field from the elections component seeds * Remove the rest of the question descriptions from the seeds

🎩 What? Why?
After #9401 was merged, some specs started failing because the description field was still in the elections component's seeds.
This wasn't spotted at #9401 because it only ran the elections specs.
📌 Related Issues
Testing
See that CI is green.
📋 Checklist
docs/.