plan_my_stuff 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/plan_my_stuff/pipeline.rb +6 -4
- data/lib/plan_my_stuff/test_helpers.rb +4 -2
- data/lib/plan_my_stuff/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6c0f0590ab0ae66923b771acd03e238d78ed2b535a24efc1ad8047774874914
|
|
4
|
+
data.tar.gz: 991920b03d4f7b2417ed51c213c0b3a9368772dbc552d5d1f17d80a512207b94
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 712c0847e85926474c0331211de128e1732e99672f79cf4cc56f6ec3313ab814b0bef15cfa3c51d360d78abac5f99825c20ec29be9aa274265a37ea271648293
|
|
7
|
+
data.tar.gz: 153ecbe20c5bcc2c9d5b25cf85ded6fbe27ca6ea6b881e9b1e62bf04e3c538e5baf50e604f97092ec9f741bfc9cc0cbb29ea72bc86f42fb879ac0d91fb7e5180
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.23.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `PlanMyStuff::Pipeline.take!` and `PlanMyStuff::Pipeline.request_testing!` now accept a `user:` kwarg
|
|
8
|
+
that is forwarded onto the `pipeline_started.plan_my_stuff` / `pipeline_testing.plan_my_stuff`
|
|
9
|
+
`ActiveSupport::Notifications` payload. Defaults to `nil`, falling back to
|
|
10
|
+
`config.current_user` via `PlanMyStuff::Notifications.resolve_current_user`.
|
|
11
|
+
|
|
3
12
|
## 0.22.0
|
|
4
13
|
|
|
5
14
|
### Added
|
|
@@ -153,15 +153,16 @@ module PlanMyStuff
|
|
|
153
153
|
# Moves a project item to "Started".
|
|
154
154
|
#
|
|
155
155
|
# @param project_item [PlanMyStuff::ProjectItem]
|
|
156
|
+
# @param user [Object, nil] actor forwarded to the +pipeline_started.plan_my_stuff+ payload
|
|
156
157
|
#
|
|
157
158
|
# @return [Hash] mutation result
|
|
158
159
|
#
|
|
159
|
-
def take!(project_item)
|
|
160
|
+
def take!(project_item, user: nil)
|
|
160
161
|
guard_approvals!(project_item&.issue)
|
|
161
162
|
status = resolve_status_name(PlanMyStuff::Pipeline::Status::STARTED)
|
|
162
163
|
result = project_item.move_to!(status)
|
|
163
164
|
|
|
164
|
-
instrument(PlanMyStuff::Pipeline::Status::STARTED, project_item)
|
|
165
|
+
instrument(PlanMyStuff::Pipeline::Status::STARTED, project_item, user: user)
|
|
165
166
|
result
|
|
166
167
|
end
|
|
167
168
|
|
|
@@ -184,16 +185,17 @@ module PlanMyStuff
|
|
|
184
185
|
# NOT change the item's +Status+ -- testing runs orthogonally to +In Review+.
|
|
185
186
|
#
|
|
186
187
|
# @param project_item [PlanMyStuff::ProjectItem]
|
|
188
|
+
# @param user [Object, nil] actor forwarded to the +pipeline_testing.plan_my_stuff+ payload
|
|
187
189
|
#
|
|
188
190
|
# @return [Hash] mutation result
|
|
189
191
|
#
|
|
190
|
-
def request_testing!(project_item)
|
|
192
|
+
def request_testing!(project_item, user: nil)
|
|
191
193
|
guard_approvals!(project_item&.issue)
|
|
192
194
|
field_name = PlanMyStuff.configuration.pipeline_testing_field_name
|
|
193
195
|
value = PlanMyStuff.configuration.pipeline_testing_values.fetch(:active)
|
|
194
196
|
result = project_item.update_single_select_field!(field_name, value)
|
|
195
197
|
|
|
196
|
-
instrument('testing', project_item, field_name: field_name, value: value)
|
|
198
|
+
instrument('testing', project_item, field_name: field_name, value: value, user: user)
|
|
197
199
|
|
|
198
200
|
result
|
|
199
201
|
end
|
|
@@ -618,12 +618,13 @@ module PlanMyStuff
|
|
|
618
618
|
take! mark_in_review! request_testing! mark_ready_for_release! start_deployment! complete_deployment!
|
|
619
619
|
].each { |m| save_original(pipeline_mod, m) }
|
|
620
620
|
|
|
621
|
-
pipeline_mod.define_singleton_method(:take!) do |project_item|
|
|
621
|
+
pipeline_mod.define_singleton_method(:take!) do |project_item, user: nil|
|
|
622
622
|
PlanMyStuff::TestHelpers.recorded_actions << {
|
|
623
623
|
type: :pipeline_started,
|
|
624
624
|
params: {
|
|
625
625
|
item_id: project_item.respond_to?(:id) ? project_item.id : nil,
|
|
626
626
|
issue_number: project_item.respond_to?(:number) ? project_item.number : nil,
|
|
627
|
+
user: user,
|
|
627
628
|
},
|
|
628
629
|
}
|
|
629
630
|
|
|
@@ -642,7 +643,7 @@ module PlanMyStuff
|
|
|
642
643
|
nil
|
|
643
644
|
end
|
|
644
645
|
|
|
645
|
-
pipeline_mod.define_singleton_method(:request_testing!) do |project_item|
|
|
646
|
+
pipeline_mod.define_singleton_method(:request_testing!) do |project_item, user: nil|
|
|
646
647
|
field_name = PlanMyStuff.configuration.pipeline_testing_field_name
|
|
647
648
|
value = PlanMyStuff.configuration.pipeline_testing_values.fetch(:active)
|
|
648
649
|
|
|
@@ -653,6 +654,7 @@ module PlanMyStuff
|
|
|
653
654
|
issue_number: project_item.respond_to?(:number) ? project_item.number : nil,
|
|
654
655
|
field_name: field_name,
|
|
655
656
|
value: value,
|
|
657
|
+
user: user,
|
|
656
658
|
},
|
|
657
659
|
}
|
|
658
660
|
|