Skip to content

Commit

Permalink
Release version 0.5.0 (#48)
Browse files Browse the repository at this point in the history
* fix: add missing namespace

* refactor: improve name and arguments for setup_election

* chore: release version 0.5.0

* fix: add missing argument

* style: fix lint issue

* test: fix broken test

* chore: bump dependencies

* style: fix lint issue
  • Loading branch information
leio10 authored Dec 19, 2020
1 parent 7cbb97f commit 0872fbb
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 22 deletions.
6 changes: 3 additions & 3 deletions decidim-bulletin_board-app/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ GEM
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.4.4)
docile (1.3.2)
docile (1.3.3)
equalizer (0.0.11)
erubi (1.10.0)
execjs (2.7.0)
Expand All @@ -101,7 +101,7 @@ GEM
ruby2_keywords
faraday_middleware (1.0.0)
faraday (~> 1.0)
ffi (1.13.1)
ffi (1.14.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
graphiql-rails (1.7.0)
Expand Down Expand Up @@ -192,7 +192,7 @@ GEM
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
rake (13.0.2)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand Down
4 changes: 3 additions & 1 deletion decidim-bulletin_board-app/db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
api_key: "89Ht70GZNcicu8WEyagz_rRae6brbqZAGuBEICYBCii-PTV3MAstAtx1aRVe5H5YfODi-JgYPvyf9ZMH7tOeZ15e3mf9B2Ymgw7eknvBFMRP213YFGo1SPn_C4uLK90G"
)

dev_trustees_private_keys = PrivateKeys.dev_trustees_private_keys_json.map { |trustee_private_key_json| JwkUtils.import_private_key(trustee_private_key_json) }
dev_trustees_private_keys = PrivateKeys.dev_trustees_private_keys_json.map do |trustee_private_key_json|
Decidim::BulletinBoard::JwkUtils.import_private_key(trustee_private_key_json)
end

dev_trustees = dev_trustees_private_keys.each_with_index.map do |trustee_private_key, index|
trustee_public_key = trustee_private_key.export
Expand Down
24 changes: 23 additions & 1 deletion decidim-bulletin_board-ruby/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.5.0] - 2020-12-19

### Changed

- Renamed `setup_election` to `create_election` and moved `election_id` from the `election_data` to a separate argument.

### Fixed

- Include the missing `open_ballot_box` and `close_ballot_box` methods from the previous release.
- Added missing namespace on the seed task

## [0.4.0] - 2020-12-18

### Added

- `content_hash` field for the `LogEntry` records with the hash of the `content` field, if included in the message.
- `Command` base class for all the classes representing GraphQL queries or mutations sent to the Bulletin Board.
- `open_ballot_box` and `close_ballot_box` methods to the `Decidim::BulletinBoard::Client`.

### Changed

- New format for the messages: `iat`, `message_id` and Bulletin Board fields in the root message, and `content` for the Voting Scheme messages.
- Improved consistency between methods included by `Decidim::BulletinBoard::Client`.

## [0.3.1] - 2020-12-10

Expand Down
18 changes: 10 additions & 8 deletions decidim-bulletin_board-ruby/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
PATH
remote: .
specs:
decidim-bulletin_board (0.3.1)
activemodel (>= 5.0.0.1)
activesupport (>= 5.0.0.1)
decidim-bulletin_board (0.5.0)
activemodel (>= 5.0.0)
activesupport (>= 5.0.0)
byebug (~> 11.0)
graphlient (~> 0.4.0)
jwt
jwt (~> 2.2.2)
wisper (~> 2.0.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (5.2.4.4)
activesupport (= 5.2.4.4)
activesupport (5.2.4.4)
activemodel (6.0.3.4)
activesupport (= 6.0.3.4)
activesupport (6.0.3.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.1)
Expand Down Expand Up @@ -88,7 +89,7 @@ GEM
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
thread_safe (0.3.6)
tzinfo (1.2.8)
tzinfo (1.2.9)
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
webmock (3.10.0)
Expand All @@ -97,6 +98,7 @@ GEM
hashdiff (>= 0.4.0, < 2.0.0)
wisper (2.0.1)
wisper-rspec (1.1.0)
zeitwerk (2.4.2)

PLATFORMS
ruby
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ module BulletinBoard
module Authority
# This class handles the creation of an election.
class CreateElection < Decidim::BulletinBoard::Command
def initialize(election_data)
def initialize(election_id, election_data)
@election_id = election_id
@election_data = election_data
end

def call
message_id = message_id(election_data[:unique_id], "create_election")
message_id = message_id(unique_election_id(election_id), "create_election")
signed_data = sign_message(message_id, election_data)

begin
Expand All @@ -35,7 +36,7 @@ def call

private

attr_reader :election_data
attr_reader :election_data, :election_id
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def configured?
private_key && server && api_key
end

def setup_election(election_data)
create_election = Decidim::BulletinBoard::Authority::CreateElection.new(election_data)
def create_election(election_id, election_data)
create_election = Decidim::BulletinBoard::Authority::CreateElection.new(election_id, election_data)
create_election.on(:ok) { |election| return election }
create_election.on(:error) { |error_message| raise StandardError, error_message }
create_election.call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Decidim
module BulletinBoard
VERSION = "0.4.0"
VERSION = "0.5.0"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ module Decidim
module BulletinBoard
module Authority
describe CreateElection do
subject { described_class.new(election_data) }
subject { described_class.new(election_id, election_data) }

include_context "with a configured bulletin board"

let(:election_id) { 1 }
let(:election_data) do
{
election_id: "test_authority.1",
type: "create_election",
scheme: "dummy"
}
end
Expand Down

0 comments on commit 0872fbb

Please sign in to comment.