plan_my_stuff 0.28.0 → 0.29.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9aac5ec777cf9b53a459843e9bdbf1177178fe1623457a60d266e993db3d2d93
4
- data.tar.gz: 1b7089b760fa0552e3b861732472e43cab09667699e1528703809a2ce753254f
3
+ metadata.gz: 98cbaeb499aa1b3b22018b7145d2d8e0bd86051a237230d1b5cac3e884109e10
4
+ data.tar.gz: a66aa1aec786adca0853eed340e1f35e2639c7aca6aafae88a421b4cc2136b5d
5
5
  SHA512:
6
- metadata.gz: 84f1cc4e7dd87ed3e33f2095d3c0f57c9ad61972ffaa5ed1d9379dfb6bb0e7bc1b07491c76c6c4f4618c39b977d7240689de5552a8c9f60fe1b474c29dde2637
7
- data.tar.gz: 1d355a051c6d6f0903c80558019790ab0e1d84adb8885b28b0c18b57802ed16c338ab7793ca24f535dc01980296fcc33b19eacc3acd204d08586db25d63138d4
6
+ metadata.gz: 8f4e1995d828ae83edfc94a9d2d0805b5787165e28f062bd0100f586de2c19e49fb6f9167ac0ee0ea88be5001012ffab5371315d2dcaee4b081a13e6be53a993
7
+ data.tar.gz: 95474b37f6f2bbd4c6074f3049086b1d643617c7c0a6dbf8562e9e0c29f9ad7bcbcabcedfda29f8e55cfcf12d5f0024a41cd69d0c9527dff91948a83e8dcde46
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.29.0
4
+
5
+ ### Changed
6
+
7
+ - `Pipeline.complete_deployment!` now sets the linked issue's `Issue Status` field to `Fixed` on the auto-complete
8
+ success path (alongside moving the item to `Completed`). Gated on `config.issue_fields_enabled`, so completion still
9
+ succeeds when issue fields are disabled. The auto-complete-off early return is unchanged (closes #96).
10
+
3
11
  ## 0.28.0
4
12
 
5
13
  ### Added
@@ -23,10 +23,11 @@ module PlanMyStuff
23
23
  return
24
24
  end
25
25
 
26
- issue = PlanMyStuff::Issue.find(params[:issue_id])
27
- issue.request_approvals!(user_ids: user_ids, user: pms_current_user)
26
+ find_issue
28
27
 
29
- yield(issue) if block_given?
28
+ @issue.request_approvals!(user_ids: user_ids, user: pms_current_user)
29
+
30
+ yield(@issue) if block_given?
30
31
  return if performed?
31
32
 
32
33
  flash[:success] = 'Approvers were successfully added.'
@@ -47,7 +48,7 @@ module PlanMyStuff
47
48
  return
48
49
  end
49
50
 
50
- issue = PlanMyStuff::Issue.find(params[:issue_id])
51
+ find_issue
51
52
  caller_id = pms_current_user.present? ? PlanMyStuff::UserResolver.user_id(pms_current_user) : nil
52
53
 
53
54
  case status
@@ -56,25 +57,25 @@ module PlanMyStuff
56
57
  redirect_to_unauthorized(show_path)
57
58
  return
58
59
  end
59
- issue.approve!(user: pms_current_user)
60
+ @issue.approve!(user: pms_current_user)
60
61
  flash[:success] = 'Approval recorded.'
61
62
  when 'rejected'
62
63
  unless caller_id == target_id
63
64
  redirect_to_unauthorized(show_path)
64
65
  return
65
66
  end
66
- issue.reject!(user: pms_current_user)
67
+ @issue.reject!(user: pms_current_user)
67
68
  flash[:success] = 'Rejection recorded.'
68
69
  else
69
70
  if caller_id != target_id && !support_user?
70
71
  redirect_to_unauthorized(show_path)
71
72
  return
72
73
  end
73
- issue.revoke_approval!(user: pms_current_user, target_user_id: target_id)
74
+ @issue.revoke_approval!(user: pms_current_user, target_user_id: target_id)
74
75
  flash[:success] = 'Response revoked.'
75
76
  end
76
77
 
77
- yield(issue) if block_given?
78
+ yield(@issue) if block_given?
78
79
  return if performed?
79
80
 
80
81
  redirect_to(show_path)
@@ -91,10 +92,10 @@ module PlanMyStuff
91
92
  return
92
93
  end
93
94
 
94
- issue = PlanMyStuff::Issue.find(params[:issue_id])
95
- issue.remove_approvers!(user_ids: [params[:id].to_i], user: pms_current_user)
95
+ find_issue
96
+ @issue.remove_approvers!(user_ids: [params[:id].to_i], user: pms_current_user)
96
97
 
97
- yield(issue) if block_given?
98
+ yield(@issue) if block_given?
98
99
  return if performed?
99
100
 
100
101
  flash[:success] = 'Approver was successfully removed.'
@@ -112,9 +113,14 @@ module PlanMyStuff
112
113
  params.fetch(:approval, {}).permit(:status, :user_ids)
113
114
  end
114
115
 
116
+ # :nodoc:
117
+ def find_issue
118
+ @issue = PlanMyStuff::Issue.find(params[:issue_id])
119
+ end
120
+
115
121
  # @return [String]
116
122
  def show_path
117
- plan_my_stuff.issue_path(params[:issue_id])
123
+ plan_my_stuff.issue_path(@issue || params[:issue_id])
118
124
  end
119
125
  end
120
126
  end
@@ -16,7 +16,7 @@ module PlanMyStuff
16
16
  if loader.respond_to?(:eager_load_dir)
17
17
  loader.eager_load_dir(controllers_dir)
18
18
  else
19
- Dir.glob(File.join(controllers_dir, '**/*.rb')).sort.each { |path| require path }
19
+ Dir.glob(File.join(controllers_dir, '**/*.rb')).each { |path| require path }
20
20
  end
21
21
  end
22
22
  end
@@ -273,8 +273,10 @@ module PlanMyStuff
273
273
  items
274
274
  end
275
275
 
276
- # Moves a project item to "Completed" if the linked issue has +auto_complete+ enabled. Returns +nil+ when
277
- # auto-complete is off (item stays at "Release in Progress").
276
+ # Moves a project item to "Completed" if the linked issue has +auto_complete+ enabled, and sets the linked issue's
277
+ # "Issue Status" field to "Fixed". Returns +nil+ when auto-complete is off (item stays at "Release in Progress" and
278
+ # no field is touched). The "Issue Status" update is skipped when +config.issue_fields_enabled+ is +false+ so
279
+ # completion still succeeds.
278
280
  #
279
281
  # @param project_item [PlanMyStuff::ProjectItem]
280
282
  # @param deployment_id [String, nil]
@@ -288,6 +290,8 @@ module PlanMyStuff
288
290
  status = resolve_status_name(PlanMyStuff::Pipeline::Status::COMPLETED)
289
291
  result = project_item.move_to!(status)
290
292
 
293
+ issue.set_issue_fields!('Issue Status' => 'Fixed') if PlanMyStuff.configuration.issue_fields_enabled
294
+
291
295
  instrument(PlanMyStuff::Pipeline::Status::COMPLETED, project_item, deployment_id: deployment_id)
292
296
  result
293
297
  end
@@ -3,7 +3,7 @@
3
3
  module PlanMyStuff
4
4
  module VERSION
5
5
  MAJOR = 0
6
- MINOR = 28
6
+ MINOR = 29
7
7
  TINY = 0
8
8
 
9
9
  # Set PRE to nil unless it's a pre-release (beta, rc, etc.)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plan_my_stuff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0
4
+ version: 0.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-05-26 00:00:00.000000000 Z
11
+ date: 2026-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails