plan_my_stuff 0.21.0 → 0.22.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 +24 -0
- data/CONFIGURATION.md +27 -0
- data/lib/generators/plan_my_stuff/install/templates/initializer.rb +19 -0
- data/lib/plan_my_stuff/configuration.rb +10 -0
- data/lib/plan_my_stuff/engine.rb +16 -0
- data/lib/plan_my_stuff/issue.rb +29 -0
- data/lib/plan_my_stuff/issue_metadata.rb +4 -3
- data/lib/plan_my_stuff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d44fbaa2722319a0d586bf8f947222aa76f74462b5516f516f34b87b89ff6211
|
|
4
|
+
data.tar.gz: 05eaab50eaca5856a19cd68f796b1b4170cb750a6bb8c78566c003a576707122
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: afbbeca592468025940d1b98eae3c93da09ca79a5406afe5d500f93e8d1803c59d8ced137c81b1e05297678de17920681756983cd0b2a4c253900897f4d5d9b5
|
|
7
|
+
data.tar.gz: 95ca844953334f3d514c1b530cac5837307b3b735975c18256ab09ad408e1e4aea1f964de8d43ffe4c6b74bdf17284f93d8f114f7e47c4ecb37484023278b28e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.22.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `Issue#add_to_priority_list!(priority:)` and `Issue#remove_from_priority_list!` - first-class setters that
|
|
8
|
+
mirror the `#priority_list?` / `#priority_list_priority` readers. Each writes both `Priority List` and
|
|
9
|
+
`Priority List Priority` in a single mutation so the two fields cannot drift apart (closes #80).
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- `IssueMetadata#priority_list` / `#priority_list_priority` deprecation message now points callers at the new
|
|
14
|
+
`Issue#add_to_priority_list!` / `#remove_from_priority_list!` pair instead of raw `set_issue_fields!`.
|
|
15
|
+
|
|
16
|
+
## 0.21.1
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `config.eager_load_controllers_on_boot` (default `false`). When `true`, the engine eager-loads
|
|
21
|
+
`app/controllers/` in `after_initialize` so consuming apps with `eager_load = false` (dev mode) see
|
|
22
|
+
`PlanMyStuff::*Controller` constants without having to reference them first. Opt in if the host app
|
|
23
|
+
probes engine controllers via `defined?`, e.g. `defined?(PlanMyStuff::Issues::TakesController)` would
|
|
24
|
+
otherwise return `nil` until something triggered Zeitwerk autoload. Falls back to `Kernel#require` on
|
|
25
|
+
Zeitwerk < 2.6.2 (which lacks `eager_load_dir`).
|
|
26
|
+
|
|
3
27
|
## 0.21.0
|
|
4
28
|
|
|
5
29
|
### Breaking
|
data/CONFIGURATION.md
CHANGED
|
@@ -49,6 +49,19 @@ config.repo_nicknames = { safety: 'Compliance' } # :element -> "Element", :under
|
|
|
49
49
|
`Issue#to_param` then returns `"Element-1234"` / `"Compliance-567"`, encoding both repo and number in a single
|
|
50
50
|
URL segment so `youtrack_issue_path(@issue)` works without a `repo:` query param.
|
|
51
51
|
|
|
52
|
+
## Attachments
|
|
53
|
+
|
|
54
|
+
| Option | Type | Default | Description |
|
|
55
|
+
|---|---|---|---|
|
|
56
|
+
| `attachment_repo` | `String` | `'pms-attachments'` | Bare repo (under `organization`) for uploaded attachments. |
|
|
57
|
+
|
|
58
|
+
The repo must already exist; the uploader does not create it. Attachments commit onto
|
|
59
|
+
`config.main_branch` under `<repo_key_or_name>/issue-<number>/<uuid>.<ext>`.
|
|
60
|
+
|
|
61
|
+
```ruby
|
|
62
|
+
config.attachment_repo = 'pms-attachments'
|
|
63
|
+
```
|
|
64
|
+
|
|
52
65
|
## Projects
|
|
53
66
|
|
|
54
67
|
| Option | Type | Default | Description |
|
|
@@ -337,6 +350,20 @@ config.cache_version = Rails.configuration.x.image_tag
|
|
|
337
350
|
config.mount_groups = { webhooks: true, issues: true, projects: true }
|
|
338
351
|
```
|
|
339
352
|
|
|
353
|
+
## Boot behavior
|
|
354
|
+
|
|
355
|
+
| Option | Type | Default | Description |
|
|
356
|
+
|---|---|---|---|
|
|
357
|
+
| `eager_load_controllers_on_boot` | `Boolean` | `false` | Eager-load engine controllers in `after_initialize`. |
|
|
358
|
+
|
|
359
|
+
Opt in if the host app probes engine controllers via `defined?` in dev mode. When `true`, the
|
|
360
|
+
engine walks `app/controllers` once on boot so `defined?(PlanMyStuff::SomeController)` resolves
|
|
361
|
+
without first referencing the constant.
|
|
362
|
+
|
|
363
|
+
```ruby
|
|
364
|
+
config.eager_load_controllers_on_boot = true
|
|
365
|
+
```
|
|
366
|
+
|
|
340
367
|
## Controller overrides
|
|
341
368
|
|
|
342
369
|
| Option | Type | Default | Description |
|
|
@@ -30,6 +30,15 @@ PlanMyStuff.configure do |config|
|
|
|
30
30
|
# need an entry.
|
|
31
31
|
# config.repo_nicknames = { safety: 'Compliance' }
|
|
32
32
|
|
|
33
|
+
# --------------------------------------------------------------------------
|
|
34
|
+
# Attachments
|
|
35
|
+
# --------------------------------------------------------------------------
|
|
36
|
+
# Bare repo name (under `organization`) that stores uploaded attachment
|
|
37
|
+
# binaries. The repo must already exist; the uploader does not create it.
|
|
38
|
+
# Attachments commit onto `config.main_branch` under
|
|
39
|
+
# `<repo_key_or_name>/issue-<number>/<uuid>.<ext>`.
|
|
40
|
+
# config.attachment_repo = 'pms-attachments'
|
|
41
|
+
|
|
33
42
|
# --------------------------------------------------------------------------
|
|
34
43
|
# Projects
|
|
35
44
|
# --------------------------------------------------------------------------
|
|
@@ -184,6 +193,16 @@ PlanMyStuff.configure do |config|
|
|
|
184
193
|
#
|
|
185
194
|
# config.issue_fields_enabled = false
|
|
186
195
|
|
|
196
|
+
# --------------------------------------------------------------------------
|
|
197
|
+
# Boot behavior
|
|
198
|
+
# --------------------------------------------------------------------------
|
|
199
|
+
# Eager-load the engine's controllers in after_initialize so that
|
|
200
|
+
# `defined?(PlanMyStuff::SomeController)` resolves without first referencing
|
|
201
|
+
# the constant. Opt in if the host app probes engine controllers via
|
|
202
|
+
# `defined?` in dev mode.
|
|
203
|
+
#
|
|
204
|
+
# config.eager_load_controllers_on_boot = true
|
|
205
|
+
|
|
187
206
|
# --------------------------------------------------------------------------
|
|
188
207
|
# Release pipeline
|
|
189
208
|
# --------------------------------------------------------------------------
|
|
@@ -373,6 +373,15 @@ module PlanMyStuff
|
|
|
373
373
|
#
|
|
374
374
|
attr_accessor :issue_fields_enabled
|
|
375
375
|
|
|
376
|
+
# Whether to eager-load the engine's controllers on host boot. Defaults to +false+ (opt-in). When +true+, the engine
|
|
377
|
+
# walks +app/controllers+ during +after_initialize+ so +defined?(PlanMyStuff::SomeController)+ resolves without
|
|
378
|
+
# first referencing the constant. Enable in host apps that rely on +defined?+ probes against engine controllers in
|
|
379
|
+
# dev mode.
|
|
380
|
+
#
|
|
381
|
+
# @return [Boolean]
|
|
382
|
+
#
|
|
383
|
+
attr_accessor :eager_load_controllers_on_boot
|
|
384
|
+
|
|
376
385
|
# @return [Configuration]
|
|
377
386
|
def initialize
|
|
378
387
|
@repos = {}
|
|
@@ -413,6 +422,7 @@ module PlanMyStuff
|
|
|
413
422
|
@pipeline_completion_purge_enabled = true
|
|
414
423
|
@pipeline_completion_ttl_hours = 24
|
|
415
424
|
@issue_fields_enabled = true
|
|
425
|
+
@eager_load_controllers_on_boot = false
|
|
416
426
|
@process_aws_webhooks = Rails.env.production?
|
|
417
427
|
@sns_verifier_class = ::Aws::SNS::MessageVerifier if defined?(::Aws::SNS::MessageVerifier)
|
|
418
428
|
@sns_verifier_error =
|
data/lib/plan_my_stuff/engine.rb
CHANGED
|
@@ -3,5 +3,21 @@
|
|
|
3
3
|
module PlanMyStuff
|
|
4
4
|
class Engine < ::Rails::Engine
|
|
5
5
|
isolate_namespace PlanMyStuff
|
|
6
|
+
|
|
7
|
+
# Opt-in (via +config.eager_load_controllers_on_boot+): eager-load the engine's controllers regardless of the host
|
|
8
|
+
# app's eager_load setting. Without this, `defined?(PlanMyStuff::SomeController)` returns nil in host-app dev mode
|
|
9
|
+
# until something explicitly references the constant, since `defined?` does not trigger Zeitwerk autoload.
|
|
10
|
+
config.after_initialize do
|
|
11
|
+
next unless PlanMyStuff.configuration.eager_load_controllers_on_boot
|
|
12
|
+
|
|
13
|
+
controllers_dir = File.expand_path('../../app/controllers', __dir__)
|
|
14
|
+
loader = Rails.autoloaders.main
|
|
15
|
+
|
|
16
|
+
if loader.respond_to?(:eager_load_dir)
|
|
17
|
+
loader.eager_load_dir(controllers_dir)
|
|
18
|
+
else
|
|
19
|
+
Dir.glob(File.join(controllers_dir, '**/*.rb')).sort.each { |path| require path }
|
|
20
|
+
end
|
|
21
|
+
end
|
|
6
22
|
end
|
|
7
23
|
end
|
data/lib/plan_my_stuff/issue.rb
CHANGED
|
@@ -842,6 +842,35 @@ module PlanMyStuff
|
|
|
842
842
|
issue_fields['Priority List Priority']
|
|
843
843
|
end
|
|
844
844
|
|
|
845
|
+
# Adds this issue to the Priority List at the given priority (or re-prioritizes if already listed). Sets
|
|
846
|
+
# +Priority List+ and +Priority List Priority+ together in a single +setIssueFieldValue+ mutation so the two
|
|
847
|
+
# fields never drift out of sync.
|
|
848
|
+
#
|
|
849
|
+
# @raise [PlanMyStuff::IssueFieldsNotEnabledError] when +config.issue_fields_enabled+ is +false+
|
|
850
|
+
#
|
|
851
|
+
# @param priority [Integer]
|
|
852
|
+
#
|
|
853
|
+
# @return [self]
|
|
854
|
+
#
|
|
855
|
+
def add_to_priority_list!(priority:)
|
|
856
|
+
raise(ArgumentError, 'Priority must be an integer') unless priority.is_a?(Integer)
|
|
857
|
+
|
|
858
|
+
set_issue_fields!('Priority List' => 'Yes', 'Priority List Priority' => priority)
|
|
859
|
+
end
|
|
860
|
+
|
|
861
|
+
alias update_priority_list_priority! add_to_priority_list!
|
|
862
|
+
|
|
863
|
+
# Removes this issue from the Priority List. Clears both +Priority List+ and +Priority List Priority+ in a single
|
|
864
|
+
# +setIssueFieldValue+ mutation so the two fields never drift out of sync.
|
|
865
|
+
#
|
|
866
|
+
# @raise [PlanMyStuff::IssueFieldsNotEnabledError] when +config.issue_fields_enabled+ is +false+
|
|
867
|
+
#
|
|
868
|
+
# @return [self]
|
|
869
|
+
#
|
|
870
|
+
def remove_from_priority_list!
|
|
871
|
+
set_issue_fields!('Priority List' => nil, 'Priority List Priority' => nil)
|
|
872
|
+
end
|
|
873
|
+
|
|
845
874
|
# Bulk-updates GitHub Issue Field values in a single +setIssueFieldValue+ mutation. Each key is the field display
|
|
846
875
|
# name; values are coerced to the right input fragment based on the field's type. Passing +nil+ as a value clears
|
|
847
876
|
# that field.
|
|
@@ -5,7 +5,8 @@ module PlanMyStuff
|
|
|
5
5
|
PRIORITY_LIST_METADATA_DEPRECATION =
|
|
6
6
|
'PlanMyStuff: IssueMetadata#priority_list / #priority_list_priority are deprecated. priority_list moved to ' \
|
|
7
7
|
"GitHub Issue Fields ('Priority List' single_select, 'Priority List Priority' number) in 0.20.0. Reads " \
|
|
8
|
-
'now come from
|
|
8
|
+
'now come from Issue#priority_list? / #priority_list_priority; for writes, use ' \
|
|
9
|
+
'Issue#add_to_priority_list!(priority: N) and Issue#remove_from_priority_list!. The metadata accessors ' \
|
|
9
10
|
'will be removed in 1.0.0.'
|
|
10
11
|
|
|
11
12
|
# @return [Time, nil] first support action timestamp, nil until set
|
|
@@ -201,7 +202,7 @@ module PlanMyStuff
|
|
|
201
202
|
@priority_list
|
|
202
203
|
end
|
|
203
204
|
|
|
204
|
-
# @deprecated Use +Issue#
|
|
205
|
+
# @deprecated Use +Issue#add_to_priority_list!(priority: N)+ / +Issue#remove_from_priority_list!+. Removed in 1.0.0.
|
|
205
206
|
#
|
|
206
207
|
# @param value [Object]
|
|
207
208
|
#
|
|
@@ -231,7 +232,7 @@ module PlanMyStuff
|
|
|
231
232
|
@priority_list_priority
|
|
232
233
|
end
|
|
233
234
|
|
|
234
|
-
# @deprecated Use +Issue#
|
|
235
|
+
# @deprecated Use +Issue#add_to_priority_list!(priority: N)+ / +Issue#remove_from_priority_list!+. Removed in 1.0.0.
|
|
235
236
|
#
|
|
236
237
|
# @param value [Object]
|
|
237
238
|
#
|
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.
|
|
4
|
+
version: 0.22.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-
|
|
11
|
+
date: 2026-05-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|