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

Document how to work locally with Elections/Votings #10870

Merged
merged 8 commits into from
Jul 3, 2023

Conversation

andreslucena
Copy link
Member

🎩 What? Why?

During the Redesign there's the need to work fully with decidim-elections, without making any changes in the Bulletin Board service. This PR provides a working docker-compose configuration and also documents a Firefox limitation that

Testing

Follow the instructions, create an Election and do the whole process

♥️ Thank you!

@andreslucena andreslucena added team: documentation module: elections type: internal PRs that aren't necessary to add to the CHANGELOG for implementers labels May 17, 2023
@andreslucena andreslucena requested a review from Crashillo May 17, 2023 09:23
@andreslucena
Copy link
Member Author

@Crashillo this is a first approach to what we talked yesterday on how to use decidim-elections locally. Give it an eye and let me know what you think

@andreslucena andreslucena force-pushed the docs/elections-development branch from 2a4385c to 67dd386 Compare May 25, 2023 05:09
@Crashillo
Copy link
Contributor

Hi there, @andreslucena, I'm getting stuck testing this at the key ceremony step. I tell you my dev setup:

  • All my trustees are have their own public key
    imagen

  • The start time is in range to start

  • Actually, all the setup election requirements are green, so I began the key ceremony.

  • I go to /trustee using the firefox multiaccount (3 different users). I see my election, click on perfom action

  • For one user, I've achieved its validation (click start, download the file, upload it once again)
    imagen

  • I keep this site open, alongside the rest of the users, but once I click in perfom action, the start button is always disabled for them
    imagen

I don't know what else I need. There no console errors. Looking at the code, the key-ceremony.js starts some way, the disabled attribute is added at the beggining, but it should be removed once setupElection and bindEvents functions are finished.

What am I missing?

@andreslucena
Copy link
Member Author

What am I missing?

Sometimes I think that I'd needed to refresh the browser and try it again.
Another thing to check is that this process can be slow as there is some cryptography keys generating (2 minutes top).

The screenshots are from #10804? (so I can give it a try locally)

@Crashillo
Copy link
Contributor

Crashillo commented Jun 5, 2023

The screenshots are from #10804? (so I can give it a try locally)

Yes, last week I tried it using that branch but in the following video I'm using feature/redesign branch (0.27-stable and develop right now are quite harmful for us to work with, since the whole development_app doesn't work by a dependencies matter...)

Screencast.from.05-06-23.13.30.13.mp4

As you can notice, in the key ceremony step, it appears the election En ello, perform action... and nothing. You see that my three trustees are connected at the same time.

I understand my browser has already the keys for each user (the jwk file) since I cannot download it again from nowhere. The docker container is running under port 8000 also.

Can you try as well in our branches to discard anything introduced by the redesign? Or, perhaps better, we may do again a call to set it up in my dev-env, is that ok?

@andreslucena
Copy link
Member Author

@Crashillo I think I know what's happening. There's an UX bug, where you need to "Upload your identification keys" before being able to "Perform action" in the elections. This is visible in 0:15 on your video.
IMHO this is not clear and we actually would need to not allow this action if the keys weren't uploaded (I'll comment it on @decidim/product just to be sure, but for me there isn't any reason why this isn't like that).

So, to fix this issue, you should:

  1. On each of the users, go to the "Trustee zone"
  2. Click on "Upload your identification keys"
  3. You'll have a file picker, select the jwk files that correspond to the users. The filename correspond to their name (for instance, "sonja-thompson-private-key.jwk")
  4. After the keys are uploaded, two things should happen:
    5.1. You should not see that button anymore
    5.2. You should be able to "Perform (the) action"

This is explained in the docs:

If you are asked to Upload your identification keys as in the image above, upload the file you downloaded in the previous step.

Let me know if that works, if not then ping me on Telegram so we can have a quick videoconference to review this

@Crashillo
Copy link
Contributor

Hi again, one step forwards, two steps backwards.

I had to recreate all the things once again (since we merged shakapacker every single setup were wiped...) well, the thing now is at the admin site, I click on the button to begin the key-ceremony.. it looks like stuck at that point, no matter you click the close button, the modal window pops up over and over.
imagen

Since the key ceremony hasn't begun, the public site only shows:
imagen

I'm trying with feature/redesign, i.e. no content of feature/redesign-elections at all; even I disabled the redesign.

@andreslucena
Copy link
Member Author

andreslucena commented Jun 26, 2023

I can confirm that is working as expected in the feature/redesign branch, with the bulletin board from the docker-compose of this PR. It's really difficult to follow the process as it isn't designed, but it works as it should.

It's important to follow all the steps in the order that's expected, as if not the ceremony can not work. I'll prepare an screencast so you can see how it should work with the "happy path" in feature/redesign

@andreslucena
Copy link
Member Author

Here you have:

e-voting_feature-redesign-2023-06-26_15.10.15.mp4

I'm not sure that the "Subir claves de elección" (Upload elections keys) needs to be done in this step, probably no as with the "admin" user I didn't need to do it and it let me finish the key ceremony.

A couple caveats on how I've done this:

  • With a fresh database in decidim ( bin/rails db:drop db:setup db:seed)
  • For comfort, I changed the nickname of the users: bin/rails c
Decidim::User.find(1).update(nickname: "admin")
Decidim::User.find(2).update(nickname: "user1")
Decidim::User.find(3).update(nickname: "user2")
  • I started with a clean database of the docker-compose BB image:
docker-compose rm
docker-compose up
  • I used the Firefox Firefox Multi-Account Containers addon as I've already mentioned

And that's pretty much it, I think I'm not missing anything

Copy link
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

@andreslucena can you sync with latest develop, and also fix the linting issues ?

Copy link
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

LGTM. great help while reviewing other tickets 🎉

@alecslupu alecslupu merged commit c95eb41 into develop Jul 3, 2023
@alecslupu alecslupu deleted the docs/elections-development branch July 3, 2023 10:11
entantoencuanto added a commit that referenced this pull request Jul 7, 2023
* feature/redesign:
  Redesign: replace cells with redesigned versions if present and update references (#11123)
  Remove duplicated constant
  Simplify logic
  Enable specs
  Fix leaflet
  fix failing specs
  Fix issues with overriding maps and loading Leaflet (#11105)
  Update decidim-proposals/app/views/decidim/proposals/proposals/new.html.erb
  Update decidim-comments/lib/decidim/comments/comments_helper.rb
  Update decidim-assemblies/spec/system/filter_assemblies_spec.rb
  Update decidim-assemblies/spec/system/filter_assemblies_spec.rb
  Document how to work locally with Elections/Votings (#10870)
  Fix Admin dashboard disappear if you are in Trustee Zone (#11111)
  Fix Shakapacker upgrade does not work for existing instances (#10814)
  Fix for sending welcome emails for new participants (#10991)
  Fix seeded trustees (#10964)
andreslucena added a commit that referenced this pull request Jul 18, 2023
* Document how to work locally with Elections/Votings

* Fix spelling

* Add testing instructions and docker-compose configuration

* Use "there is" instead of "there's"

* Document exception shown if the service is not running

* Remove unecessary details from documented exception

* Fix markdownlint offenses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: elections team: documentation type: internal PRs that aren't necessary to add to the CHANGELOG for implementers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants