-
Notifications
You must be signed in to change notification settings - Fork 15
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
Migrate unfeasibility explanation #1853
Migrate unfeasibility explanation #1853
Conversation
spec/lib/migrations/spending_proposals/budget_investments_spec.rb
Outdated
Show resolved
Hide resolved
require "rails_helper" | ||
require "migrations/spending_proposal/budget_investments" | ||
|
||
describe Migrations::SpendingProposal::BudgetInvestments do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSpec/FilePath: Spec path should end with migrations/spending_proposal/budget_investments*_spec.rb. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Hound 😌 We'll fix this in a separate PR 👌
require "rails_helper" | ||
require "migrations/spending_proposal/budget_investment" | ||
|
||
describe Migrations::SpendingProposal::BudgetInvestment do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSpec/FilePath: Spec path should end with migrations/spending_proposal/budget_investment*_spec.rb. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Hound 😌 We'll fix this in a separate PR 👌
We already have budget investment for every corresponding spending proposal. However this attribute was not migrated correctly, creating a validation error when trying to update these budget investments. With this commit all budget investmetns should be valid and we can continue working on migration supports and ballots.
ab60c4d
to
12b8ffd
Compare
Mainly for development
There are some spending proposals that use either the price_explanation or the internal_comments to explain why a spending proposal is unfeasible. We must use these attributes to fill in the unfeasible_explanation of a budget investment, otherwise they would still have a validation error.
migration.update | ||
|
||
budget_investment.reload | ||
expect(budget_investment.unfeasibility_explanation).to eq("price explanation saying it is too expensive") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [111/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
We now have a dependency on this spec, added in a previous PR[1]. This is due the spec indirectly creating a Comment object[1] that requires the spending proposal to have an administrator. We could separate the rake task to deal with the initial PR requirements and this PR's requirements. But we should put it all in a single rake task when everything is ready. So just fixing the spec for now. [1] #1853
We now have a dependency on this spec, added in a previous PR[1]. This is due the spec indirectly creating a Comment object[1] that requires the spending proposal to have an administrator. We could separate the rake task to deal with the initial PR requirements and this PR's requirements. But we should put it all in a single rake task when everything is ready. So just fixing the spec for now. [1] #1853
Context
We already have budget investment for every corresponding spending proposal.
However the
unfeasibility_explanation
attribute was not migrated correctly. This raises a validation error when trying to update any other attribute in these budget investments.Objectives
Migrate this attribute for all relevant budget investments to make them valid so that we can continue working on migrating supports and ballots.
Does this PR need a Backport to CONSUL?
Yes, this will be important for the final migration
Notes
Adding some debug information in a method, to prevent the rake task from stopping early. If something is printed the ssh connection stays open.