Skip to content

Commit 662fcf4

Browse files
authored
Merge pull request #247 from dblock/migrate-danger-pr-comment
Migrate to danger-pr-comment workflow
2 parents d9d6639 + 5bd9b34 commit 662fcf4

7 files changed

Lines changed: 155 additions & 57 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Danger Comment
2+
3+
on:
4+
workflow_run:
5+
workflows: [Danger]
6+
types: [completed]
7+
8+
jobs:
9+
comment:
10+
uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.1.0
11+
secrets: inherit

.github/workflows/danger.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
name: Danger
2-
on: [pull_request]
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited, synchronize]
6+
37
jobs:
48
danger:
5-
runs-on: ubuntu-latest
6-
steps:
7-
- uses: actions/checkout@v3
8-
with:
9-
fetch-depth: 0
10-
- uses: ruby/setup-ruby@v1
11-
with:
12-
ruby-version: 2.7
13-
bundler-cache: true
14-
- run: |
15-
# Personal access token for dangerpr-bot - public, but base64 encoded to avoid tripping up GitHub
16-
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
17-
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
9+
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0
10+
secrets: inherit
11+
with:
12+
ruby-version: '3.4'
13+
bundler-cache: true

CHANGELOG.md

Lines changed: 126 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,185 @@
11
### 4.3.0 (Next)
2+
3+
* [#247](https://github.com/mongoid/mongoid-rspec/pull/247): Migrate to danger-pr-comment workflow - [@dblock](https://github.com/dblock).
24
* Your contribution here.
35

4-
### 4.2.0 (06/04/2024)
6+
### 4.2.0 (2024/06/04)
57

6-
* [#239](https://github.com/mongoid/mongoid-rspec/pull/239): Add support for if/unless validator options - [@knovoselic](https://github.com/knovoselic).
8+
* [#239](https://github.com/mongoid/mongoid-rspec/pull/239): Add support for `:if`/`:unless` validator options - [@knovoselic](https://github.com/knovoselic).
79
* [#244](https://github.com/mongoid/mongoid-rspec/pull/244): Migration from TravisCI to GitHub Actions - [@skalibog](https://github.com/skalibog).
810
* [#245](https://github.com/mongoid/mongoid-rspec/pull/245): Add support for Mongoid 9 - [@saisrinivasan](https://github.com/SairamSrinivasan).
911
* [#246](https://github.com/mongoid/mongoid-rspec/pull/246): Add support for touch options - [@saisrinivasan](https://github.com/SairamSrinivasan).
1012

11-
### 4.1.0 (6/12/2020)
13+
### 4.1.0 (2020/06/12)
1214

1315
* [#221](https://github.com/mongoid/mongoid-rspec/pull/221): Support `ordered_by` for Mongoid 5 and earlier - [@stim371](https://github.com/stim371).
1416
* [#222](https://github.com/mongoid/mongoid-rspec/pull/222): Do not depend on `rspec` meta gem - [@lucasmazza](https://github.com/lucasmazza).
1517
* [#231](https://github.com/mongoid/mongoid-rspec/pull/231): Fix transform_values deprecation in rails 6 - [@yads](https://github.com/yads).
1618
* [#223](https://github.com/mongoid/mongoid-rspec/pull/223): Add support for `optional` in relations matchers - [@javierav](https://github.com/javierav).
1719
* [#226](https://github.com/mongoid/mongoid-rspec/pull/226): Fix #217. Use Appraisal to test the gem - [@javierav](https://github.com/javierav).
1820

19-
### 4.0.1 (6/15/2018)
21+
### 4.0.1 (2018/06/15)
2022

2123
* [#212](https://github.com/mongoid/mongoid-rspec/pull/212): Mongoid 7 support - [@madAle](https://github.com/madAle).
2224
* [#211](https://github.com/mongoid/mongoid-rspec/pull/211): Added `validate_absence_of` matcher - [@pedroadame](https://github.com/pedroadame).
2325

24-
### 4.0.0 (1/29/2018)
26+
### 4.0.0 (2018/01/29)
2527

2628
* [#197](https://github.com/mongoid/mongoid-rspec/pull/197): Mongoid 6 support - [@saumyamehta17](https://github.com/saumyamehta17), [@zeitnot](https://github.com/zeitnot).
2729
* [#205](https://github.com/mongoid/mongoid-rspec/pull/205): Added Danger, PR linter - [@dblock](https://github.com/dblock).
2830
* [#205](https://github.com/mongoid/mongoid-rspec/pull/205): Added RuboCop, ruby-style linter - [@dblock](https://github.com/dblock).
2931

30-
### 3.0.0 (9/16/2015)
32+
### 3.0.0 (2015/09/16)
33+
34+
* Support for released Mongoid 5.0.0 - [@rodrigopinto](https://github.com/rodrigopinto).
35+
36+
### 2.2.0 (2015/03/10)
37+
38+
* Support `with_message` option for `validate_confirmation_of` matcher - [@nitinstp23](https://github.com/nitinstp23).
39+
* Updated RSpec dependency - [@rodrigopinto](https://github.com/rodrigopinto).
40+
41+
### 2.1.0 (2015/02/01)
42+
43+
* Added `be_dynamic_document` matcher - [@karmi](https://github.com/karmi).
44+
* Added `with_counter_cache` relation matcher option - [@karmi](https://github.com/karmi).
45+
* Fixed camelcased index options bug - [@karmi](https://github.com/karmi).
46+
* Removed code related to Mongoid 3 - [@karmi](https://github.com/karmi).
47+
48+
### 2.0.0 (2015/01/05)
49+
50+
* Mongoid 4 support - [@rodrigopinto](https://github.com/rodrigopinto).
51+
* Updated gem dependencies - [@rodrigopinto](https://github.com/rodrigopinto).
52+
* Travis CI now only tests against Mongoid 4.0.X - [@rodrigopinto](https://github.com/rodrigopinto).
53+
54+
### 1.13.0 (2015/01/05)
55+
56+
### 1.11.0 (2014/02/15)
57+
58+
### 1.10.0 (2013/12/07)
59+
60+
### 1.9.0 (2013/08/11)
61+
62+
* Added Association.cyclic and .stored_as matchers - [@johnnyshields](https://github.com/johnnyshields).
63+
64+
### 1.8.2 (2013/05/24)
65+
66+
* Support for detailed ordered_by matcher on associations - [@taiki45](https://github.com/taiki45).
67+
* Modified HaveValidationMatcher to detect correct validator when more than one `:on` option is used - [@taiki45](https://github.com/taiki45).
68+
69+
### 1.8.1 (2013/05/03)
70+
71+
* Added ability to check custom message for length of validation - [@asynchrony](https://github.com/asynchrony).
72+
* Extracted `with_message` logic to common module - [@asynchrony](https://github.com/asynchrony).
73+
74+
### 1.8.0 (2013/04/21)
75+
76+
* Added support for `:order` on associations - [@nanocity](https://github.com/nanocity).
77+
78+
### 1.7.0 (2013/02/27)
79+
80+
* Added `autobuild` matcher for `has_one` and `embeds_one` associations - [@bernardeli](https://github.com/bernardeli).
81+
* Removed test options of matcher `accepts_nested_attributes_for` - [@rodrigopinto](https://github.com/rodrigopinto).
82+
83+
### 1.6.0 (2013/01/27)
84+
85+
* Added `accept_nested_attributes_of` matcher - [@rodrigopinto](https://github.com/rodrigopinto).
86+
* Added macro to check if field is localized - [@ph](https://github.com/ph).
87+
* Fixed `with_default_value` to work when `:default` is not set on a field - [@kareemk](https://github.com/kareemk).
88+
* Symbolize keys for Index Matcher - [@jtescher](https://github.com/jtescher).
89+
90+
### 1.5.6 (2013/01/13)
91+
92+
* Ensuring that specs fail if a particular option is not present while indexing - [@anshulm](https://github.com/anshulm).
93+
94+
### 1.5.5 (2012/11/28)
3195

32-
### 2.2.0 (3/10/2015)
96+
* Added Travis CI build image - [@rodrigopinto](https://github.com/rodrigopinto).
3397

34-
### 2.1.0 (2/01/2015)
98+
### 1.5.4 (2012/08/20)
3599

36-
### 2.0.0 (1/05/2015)
100+
* Added support for matching document field aliases - [@dwbutler](https://github.com/dwbutler).
101+
* Bug fix for inclusion matcher - [@dwbutler](https://github.com/dwbutler).
37102

38-
### 2.0.0.rc1 (9/24/2014)
103+
### 1.5.3 (2012/08/20)
39104

40-
### 1.13.0 (1/05/2015)
105+
### 1.5.1 (2012/07/27)
41106

42-
### 1.11.0 (2/15/2014)
107+
* Support for `Proc` in inclusion matcher - [@c0va23](https://github.com/c0va23).
108+
* Allow more specific timestamp specs - [@zenzike](https://github.com/zenzike).
109+
* Allow validations to pass if `:on` is not specified but spec specifies `:create`, `:update`, or both - [@zenzike](https://github.com/zenzike).
43110

44-
### 1.10.0 (12/07/2013)
111+
### 1.5.0 (2012/07/27)
45112

46-
### 1.9.0 (8/11/2013)
113+
* Mongoid 3.0 support - [@rodrigopinto](https://github.com/rodrigopinto).
114+
* Added `allow_mass_assignment_of` matcher - [@rodrigopinto](https://github.com/rodrigopinto).
115+
* Added matcher for custom validation - [@rodrigopinto](https://github.com/rodrigopinto).
116+
* Added matcher for `validate_acceptance_of` - [@nanocity](https://github.com/nanocity).
117+
* Added exclusion matcher - [@rodrigopinto](https://github.com/rodrigopinto).
118+
* Support for RSpec > 2.9 - [@rodrigopinto](https://github.com/rodrigopinto).
47119

48-
### 1.8.2 (5/24/2013)
120+
### 1.4.6 (2012/06/13)
49121

50-
### 1.8.1 (5/03/2013)
122+
* Fixed copy-paste typo in `uniqueness_of` - [@nessche](https://github.com/nessche).
123+
* Fixed collection matcher to support Mongoid 3.0.0 - [@rodrigopinto](https://github.com/rodrigopinto).
124+
* Changed index syntax to support Mongoid 3.0.0.rc - [@rodrigopinto](https://github.com/rodrigopinto).
51125

52-
### 1.8.0 (4/21/2013)
126+
### 1.4.5 (2012/05/23)
53127

54-
### 1.7.0 (2/27/2013)
128+
### 1.4.4 (2011/06/02)
55129

56-
### 1.6.0 (1/27/2013)
130+
* Fixed HaveFieldMatcher for `Boolean` fields with default values - [@evansagge](https://github.com/evansagge).
131+
* Fixed document extension matchers for RSpec 2.6 - [@evansagge](https://github.com/evansagge).
57132

58-
### 1.5.6 (1/13/2013)
133+
### 1.4.3 (2011/06/02)
59134

60-
### 1.5.5 (11/28/2012)
135+
* Updated gem dependencies - [@evansagge](https://github.com/evansagge).
136+
* Fixed matcher descriptions for `be_mongoid_document`, `be_versioned_document`, `be_timestamped_document`, `be_paranoid_document` - [@evansagge](https://github.com/evansagge).
61137

62-
### 1.5.4 (8/20/2012)
138+
### 1.4.2 (2011/04/22)
63139

64-
### 1.5.3 (8/20/2012)
140+
* Changed mongoid version requirement to ~> 2.0 - [@evansagge](https://github.com/evansagge).
141+
* Added `with_autosave` option to association matcher - [@MattVonVielen](https://github.com/MattVonVielen).
142+
* Added `many` relations support the `inverse_of` option - [@nickhoffman](https://github.com/nickhoffman).
65143

66-
### 1.5.1 (7/27/2012)
144+
### 1.4.1 (2011/03/02)
67145

68-
### 1.5.0 (7/27/2012)
146+
* Added `be_stored_in` matcher to verify if a document has `store_in` `:collection_name` set - [@rodrigues](https://github.com/rodrigues).
147+
* Added `less_than` verification to `validates_numericality_of` matcher - [@rodrigues](https://github.com/rodrigues).
148+
* Added ability to test `dependent` option - [@sarcilav](https://github.com/sarcilav).
149+
* Allows `embedded_in` argument to map to a name rather than a class for better decoupling - [@candlewaster](https://github.com/candlewaster).
150+
* Handled `validate_numericality_of` options `:equal_to`, `:greater_than`, `:greater_than_or_equal_to`, `:less_than`, `:less_than_or_equal_to`, `:even`, `:odd`, `:only_integer`, `:allow_nil` - [@candlewaster](https://github.com/candlewaster).
69151

70-
### 1.4.6 (6/13/2012)
152+
### 1.3.2 (2010/11/10)
71153

72-
### 1.4.5 (5/23/2012)
154+
* Added within range check for `validate_length_of` matcher - [@pranas](https://github.com/pranas).
155+
* Added `greater_than` check for `validate_numericality_of` matcher - [@pranas](https://github.com/pranas).
156+
* Added `validates_confirmation_of` matcher - [@jnshashank](https://github.com/jnshashank).
73157

74-
### 1.4.4 (6/02/2011)
158+
### 1.2.1 (2010/08/24)
75159

76-
### 1.4.3 (6/02/2011)
160+
* Added support for association `ReferencesManyAsArray` - [@rodrigopinto](https://github.com/rodrigopinto).
77161

78-
### 1.4.2 (4/22/2011)
162+
### 1.2.0 (2010/08/02)
79163

80-
### 1.4.1 (3/02/2011)
164+
* Fixing compatibility issues with Mongoid v2.0.0.beta.15 and up - [@evansagge](https://github.com/evansagge).
165+
* Removed dependency on Rails - [@evansagge](https://github.com/evansagge).
81166

82-
### 1.3.2 (11/10/2010)
167+
### 1.1.2 (2010/06/07)
83168

84-
### 1.2.1 (8/24/2010)
169+
* Added requires for mongoid/associations - [@durran](https://github.com/durran).
85170

86-
### 1.2.0 (8/02/2010)
171+
### 1.1.1 (2010/06/01)
87172

88-
### 1.1.2 (6/07/2010)
173+
* Fixed association matchers - [@durran](https://github.com/durran).
89174

90-
### 1.1.1 (6/01/2010)
175+
### 1.1.0 (2010/06/01)
91176

92-
### 1.1.0 (6/01/2010)
177+
* Updated to be compatible with `ReferencesMany`, `ReferencesOne`, and `ReferenceIn` - [@durran](https://github.com/durran).
93178

94-
### 1.0.4 (5/23/2010)
179+
### 1.0.4 (2010/05/23)
95180

96-
### 1.0.3 (5/08/2010)
181+
* Updated gemspecs to be compatible with newer versions of Mongoid - [@durran](https://github.com/durran).
97182

98-
### 1.0.3 (5/8/2010)
183+
### 1.0.3 (2010/05/08)
99184

100-
* Intial public release - [@evansagge](https://github.com/evansagge).
185+
* Initial public release - [@evansagge](https://github.com/evansagge).

Dangerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
danger.import_dangerfile(gem: 'mongoid-danger')
1+
danger.import_dangerfile(gem: 'danger-pr-comment')
2+
3+
changelog.check!

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
source 'https://rubygems.org'
44

55
gemspec
6+
7+
gem 'danger'
8+
gem 'danger-changelog'
9+
gem 'danger-pr-comment'

mongoid-rspec.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
2222
s.metadata['rubygems_mfa_required'] = 'true'
2323

2424
s.add_development_dependency 'appraisal', '~> 2.0'
25-
s.add_development_dependency 'mongoid-danger', '~> 0.2'
2625
s.add_development_dependency 'pry'
2726
s.add_development_dependency 'rails'
2827
s.add_development_dependency 'rspec'

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
require 'bundler'
1010
Bundler.setup
1111

12+
require 'logger'
1213
require 'mongoid'
1314
require 'rspec/core'
1415
require 'rspec/expectations'

0 commit comments

Comments
 (0)