Skip to content

Commit 0872fbb

Browse files
authored
Release version 0.5.0 (#48)
* 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
1 parent 7cbb97f commit 0872fbb

File tree

8 files changed

+48
-22
lines changed

8 files changed

+48
-22
lines changed

decidim-bulletin_board-app/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ GEM
8585
descendants_tracker (0.0.4)
8686
thread_safe (~> 0.3, >= 0.3.1)
8787
diff-lcs (1.4.4)
88-
docile (1.3.2)
88+
docile (1.3.3)
8989
equalizer (0.0.11)
9090
erubi (1.10.0)
9191
execjs (2.7.0)
@@ -101,7 +101,7 @@ GEM
101101
ruby2_keywords
102102
faraday_middleware (1.0.0)
103103
faraday (~> 1.0)
104-
ffi (1.13.1)
104+
ffi (1.14.0)
105105
globalid (0.4.2)
106106
activesupport (>= 4.2.0)
107107
graphiql-rails (1.7.0)
@@ -192,7 +192,7 @@ GEM
192192
rake (>= 0.8.7)
193193
thor (>= 0.20.3, < 2.0)
194194
rainbow (3.0.0)
195-
rake (13.0.1)
195+
rake (13.0.2)
196196
rb-fsevent (0.10.4)
197197
rb-inotify (0.10.1)
198198
ffi (~> 1.0)

decidim-bulletin_board-app/db/seeds.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
api_key: "89Ht70GZNcicu8WEyagz_rRae6brbqZAGuBEICYBCii-PTV3MAstAtx1aRVe5H5YfODi-JgYPvyf9ZMH7tOeZ15e3mf9B2Ymgw7eknvBFMRP213YFGo1SPn_C4uLK90G"
1919
)
2020

21-
dev_trustees_private_keys = PrivateKeys.dev_trustees_private_keys_json.map { |trustee_private_key_json| JwkUtils.import_private_key(trustee_private_key_json) }
21+
dev_trustees_private_keys = PrivateKeys.dev_trustees_private_keys_json.map do |trustee_private_key_json|
22+
Decidim::BulletinBoard::JwkUtils.import_private_key(trustee_private_key_json)
23+
end
2224

2325
dev_trustees = dev_trustees_private_keys.each_with_index.map do |trustee_private_key, index|
2426
trustee_public_key = trustee_private_key.export

decidim-bulletin_board-ruby/CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,29 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [0.5.0] - 2020-12-19
9+
10+
### Changed
11+
12+
- Renamed `setup_election` to `create_election` and moved `election_id` from the `election_data` to a separate argument.
13+
14+
### Fixed
15+
16+
- Include the missing `open_ballot_box` and `close_ballot_box` methods from the previous release.
17+
- Added missing namespace on the seed task
18+
19+
## [0.4.0] - 2020-12-18
20+
21+
### Added
22+
23+
- `content_hash` field for the `LogEntry` records with the hash of the `content` field, if included in the message.
24+
- `Command` base class for all the classes representing GraphQL queries or mutations sent to the Bulletin Board.
25+
- `open_ballot_box` and `close_ballot_box` methods to the `Decidim::BulletinBoard::Client`.
26+
27+
### Changed
28+
29+
- New format for the messages: `iat`, `message_id` and Bulletin Board fields in the root message, and `content` for the Voting Scheme messages.
30+
- Improved consistency between methods included by `Decidim::BulletinBoard::Client`.
931

1032
## [0.3.1] - 2020-12-10
1133

decidim-bulletin_board-ruby/Gemfile.lock

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
PATH
22
remote: .
33
specs:
4-
decidim-bulletin_board (0.3.1)
5-
activemodel (>= 5.0.0.1)
6-
activesupport (>= 5.0.0.1)
4+
decidim-bulletin_board (0.5.0)
5+
activemodel (>= 5.0.0)
6+
activesupport (>= 5.0.0)
77
byebug (~> 11.0)
88
graphlient (~> 0.4.0)
9-
jwt
9+
jwt (~> 2.2.2)
1010
wisper (~> 2.0.0)
1111

1212
GEM
1313
remote: https://rubygems.org/
1414
specs:
15-
activemodel (5.2.4.4)
16-
activesupport (= 5.2.4.4)
17-
activesupport (5.2.4.4)
15+
activemodel (6.0.3.4)
16+
activesupport (= 6.0.3.4)
17+
activesupport (6.0.3.4)
1818
concurrent-ruby (~> 1.0, >= 1.0.2)
1919
i18n (>= 0.7, < 2)
2020
minitest (~> 5.1)
2121
tzinfo (~> 1.1)
22+
zeitwerk (~> 2.2, >= 2.2.2)
2223
addressable (2.7.0)
2324
public_suffix (>= 2.0.2, < 5.0)
2425
ast (2.4.1)
@@ -88,7 +89,7 @@ GEM
8889
ruby-progressbar (1.10.1)
8990
ruby2_keywords (0.0.2)
9091
thread_safe (0.3.6)
91-
tzinfo (1.2.8)
92+
tzinfo (1.2.9)
9293
thread_safe (~> 0.1)
9394
unicode-display_width (1.7.0)
9495
webmock (3.10.0)
@@ -97,6 +98,7 @@ GEM
9798
hashdiff (>= 0.4.0, < 2.0.0)
9899
wisper (2.0.1)
99100
wisper-rspec (1.1.0)
101+
zeitwerk (2.4.2)
100102

101103
PLATFORMS
102104
ruby

decidim-bulletin_board-ruby/lib/decidim/bulletin_board/authority/create_election.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ module BulletinBoard
55
module Authority
66
# This class handles the creation of an election.
77
class CreateElection < Decidim::BulletinBoard::Command
8-
def initialize(election_data)
8+
def initialize(election_id, election_data)
9+
@election_id = election_id
910
@election_data = election_data
1011
end
1112

1213
def call
13-
message_id = message_id(election_data[:unique_id], "create_election")
14+
message_id = message_id(unique_election_id(election_id), "create_election")
1415
signed_data = sign_message(message_id, election_data)
1516

1617
begin
@@ -35,7 +36,7 @@ def call
3536

3637
private
3738

38-
attr_reader :election_data
39+
attr_reader :election_data, :election_id
3940
end
4041
end
4142
end

decidim-bulletin_board-ruby/lib/decidim/bulletin_board/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def configured?
3636
private_key && server && api_key
3737
end
3838

39-
def setup_election(election_data)
40-
create_election = Decidim::BulletinBoard::Authority::CreateElection.new(election_data)
39+
def create_election(election_id, election_data)
40+
create_election = Decidim::BulletinBoard::Authority::CreateElection.new(election_id, election_data)
4141
create_election.on(:ok) { |election| return election }
4242
create_election.on(:error) { |error_message| raise StandardError, error_message }
4343
create_election.call

decidim-bulletin_board-ruby/lib/decidim/bulletin_board/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Decidim
44
module BulletinBoard
5-
VERSION = "0.4.0"
5+
VERSION = "0.5.0"
66
end
77
end

decidim-bulletin_board-ruby/spec/decidim/bulletin_board/authority/create_election_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ module Decidim
66
module BulletinBoard
77
module Authority
88
describe CreateElection do
9-
subject { described_class.new(election_data) }
9+
subject { described_class.new(election_id, election_data) }
1010

1111
include_context "with a configured bulletin board"
1212

13+
let(:election_id) { 1 }
1314
let(:election_data) do
1415
{
15-
election_id: "test_authority.1",
16-
type: "create_election",
1716
scheme: "dummy"
1817
}
1918
end

0 commit comments

Comments
 (0)