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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: ParticipatoryText workflow creates multiple versions #5399

Merged

Conversation

@aitorlb
Copy link
Contributor

commented Oct 7, 2019

馃帺 What? Why?

ParticipatoryText workflow is creating multiple versions: when importing proposals from a document, when updating the imported proposals and when publishing the participatory text.

This PR prevents that so after a participatory text is published there's only one version for each proposal in the version control feature.

馃搶 Related Issues

馃搵 Subtasks

  • Add CHANGELOG entry
  • Add tests
@aitorlb aitorlb requested a review from decidim/lot-core as a code owner Oct 7, 2019
def publish_proposal(proposal)
title, body = reset_proposal_title_and_body(proposal)

Decidim.traceability.perform_action!(:create, proposal, form.current_user, visibility: "all") do

This comment has been minimized.

Copy link
@oriolgual

oriolgual Oct 7, 2019

Member

Maybe the action here should be publish instead of create and we could avoid these "hacks"?

This comment has been minimized.

Copy link
@aitorlb

aitorlb Oct 7, 2019

Author Contributor

I'm not sure I follow.

This PR does not affect the way the action_log is being rendered. It keeps the old behaviour, which is that the action will be visible in the admin log and not in the last activty feed:

participatory_text_admin_log

But I agree that the code smells.

The issue is having only one version after a proposal is published and to reflect the state of the model just before publishing... I don't see a better solution right now than:

  • Preventing PaperTrail from creating new versions each step along the way
  • Create a first version in the final step and reset the attributes that will be diffed in the version control feature so they appear in the first version as new

But I'm open to suggestions.

This comment has been minimized.

Copy link
@oriolgual

oriolgual Oct 8, 2019

Member

Sorry, you're right. I just thought that since you're publishing a proposal, not creating it, the action could be different. But it has nothing to do with papertrail issues.

@oriolgual oriolgual merged commit edfa1cf into decidim:master Oct 8, 2019
30 checks passed
30 checks passed
DEP All dependencies are resolved
ci/circleci: accountability Your tests passed on CircleCI!
Details
ci/circleci: admin Your tests passed on CircleCI!
Details
ci/circleci: api Your tests passed on CircleCI!
Details
ci/circleci: assemblies Your tests passed on CircleCI!
Details
ci/circleci: blogs Your tests passed on CircleCI!
Details
ci/circleci: budgets Your tests passed on CircleCI!
Details
ci/circleci: build_design_app Your tests passed on CircleCI!
Details
ci/circleci: build_test_app Your tests passed on CircleCI!
Details
ci/circleci: comments Your tests passed on CircleCI!
Details
ci/circleci: conferences Your tests passed on CircleCI!
Details
ci/circleci: consultations Your tests passed on CircleCI!
Details
ci/circleci: core Your tests passed on CircleCI!
Details
ci/circleci: debates Your tests passed on CircleCI!
Details
ci/circleci: forms Your tests passed on CircleCI!
Details
ci/circleci: generators Your tests passed on CircleCI!
Details
ci/circleci: initiatives Your tests passed on CircleCI!
Details
ci/circleci: main Your tests passed on CircleCI!
Details
ci/circleci: meetings Your tests passed on CircleCI!
Details
ci/circleci: pages Your tests passed on CircleCI!
Details
ci/circleci: participatory_processes Your tests passed on CircleCI!
Details
ci/circleci: proposals Your tests passed on CircleCI!
Details
ci/circleci: sortitions Your tests passed on CircleCI!
Details
ci/circleci: surveys Your tests passed on CircleCI!
Details
ci/circleci: system Your tests passed on CircleCI!
Details
ci/circleci: upload-coverage Your tests passed on CircleCI!
Details
ci/circleci: verifications Your tests passed on CircleCI!
Details
codeclimate All good!
Details
codeclimate/diff-coverage 95% (80% threshold)
Details
codeclimate/total-coverage 98% (0.0% change)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.