plan_my_stuff 1.0.1 → 1.0.3

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: fb9b79b7a7ef0890f6cfe2d4be9f5886afaaeec2a032e11fc44b0948a41c680b
4
- data.tar.gz: 6582b1c90d2a78dd0c07e7789efba2d1938f6ce62c0a986778d0001e1c073ea5
3
+ metadata.gz: 8d22beb4e744332fb2af5dc20c00480c1818d78a68d594322dfbe58585f003ff
4
+ data.tar.gz: 0b8cc3be8d88f4b4ed26bfa31daa5fe4863c7239cab0c6c59ed6e873d6b7341f
5
5
  SHA512:
6
- metadata.gz: 9e2c0221e7396240f4b5452b000caae6c5a180b474250c2dedebb8e4a899e5c7c6eccad178a242858f1e5a2f04a37c778c23b4a7f973198db59e4c8d8aa04ea6
7
- data.tar.gz: c91d0a3aec30798acff56582232baa332c1e556a98e78844ea7c05ff82abde81e65e953c56a6ac3c248be33c789030963b7918fe1fc5a1286ab5d40fe5196837
6
+ metadata.gz: 3c7b565d97c5664b92163d282cd0809ca98e176633e4f015e17d03c2178b27909c029b4f5819efd842928ba26478eba86cade55e1c5f6dcc3a97c388185d46e1
7
+ data.tar.gz: d74dcf1c7a4756d3b88a339c8ff325fe114a96152f27e03f03f431008bb4affdc6d78c5ce6a5a3dbb7d9e31553b24bd06cc5593c9d85e6abc7f080143ed44c2b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Fixed
6
+
7
+ - `plan_my_stuff:webhooks:create_org` and `plan_my_stuff:webhooks:create_repo` now use `import_client` (the
8
+ `import_access_token`) instead of the regular `access_token`, since creating org and repo webhooks requires an admin
9
+ token
10
+
11
+ ## 1.0.2
12
+
13
+ ### Fixed
14
+
15
+ - `Issue.new` now accepts `issue_fields:` without erroring, staging the values for the next `save!`
16
+ - `Issue#issue_fields` no longer crashes on unpersisted records; it returns the pending values passed to `.new` so a
17
+ failed `new` form can be re-rendered without losing the user's Issue Field selections
18
+
3
19
  ## 1.0.1
4
20
 
5
21
  ### Fixed
@@ -808,6 +808,7 @@ module PlanMyStuff
808
808
 
809
809
  def initialize(**attrs)
810
810
  @body_dirty = false
811
+ @pending_issue_fields = attrs.delete(:issue_fields) if attrs.key?(:issue_fields)
811
812
  super
812
813
  end
813
814
 
@@ -1049,7 +1050,9 @@ module PlanMyStuff
1049
1050
 
1050
1051
  # Returns a hash-like view of GitHub Issue Field values currently set on this issue. Reads on first access and
1051
1052
  # memoizes; +set_issue_fields!+ invalidates the cache. Returns an empty set without making a request when
1052
- # +config.issue_fields_enabled+ is +false+.
1053
+ # +config.issue_fields_enabled+ is +false+. For unpersisted records, returns the pending values passed to +.new+
1054
+ # (the raw consumer-supplied hash) without making a request, so a failed +new+ form can be re-rendered without
1055
+ # losing the user's input.
1053
1056
  #
1054
1057
  # @return [PlanMyStuff::IssueFieldValueSet]
1055
1058
  #
@@ -1376,6 +1379,10 @@ module PlanMyStuff
1376
1379
  def load_issue_fields!
1377
1380
  return PlanMyStuff::IssueFieldValueSet.new({}) unless PlanMyStuff.configuration.issue_fields_enabled
1378
1381
 
1382
+ # Unpersisted records have no values on GitHub yet. Surface the pending values passed to +.new+ / +update!+
1383
+ # so a consuming app can re-render a failed "new" form without losing the user's Issue Field selections.
1384
+ return PlanMyStuff::IssueFieldValueSet.new((@pending_issue_fields || {}).transform_keys(&:to_s)) if new_record?
1385
+
1379
1386
  data = PlanMyStuff.client.graphql(
1380
1387
  PlanMyStuff::GraphQL::Queries::READ_ISSUE_FIELD_VALUES,
1381
1388
  variables: { owner: repo.organization, name: repo.name, number: number },
@@ -4,7 +4,7 @@ module PlanMyStuff
4
4
  module VERSION
5
5
  MAJOR = 1
6
6
  MINOR = 0
7
- TINY = 1
7
+ TINY = 3
8
8
 
9
9
  # Set PRE to nil unless it's a pre-release (beta, rc, etc.)
10
10
  PRE = nil
@@ -29,7 +29,7 @@ namespace :plan_my_stuff do
29
29
  raise(PlanMyStuff::ConfigurationError, 'PlanMyStuff.configuration.webhook_secret is blank')
30
30
  end
31
31
 
32
- hook = PlanMyStuff.client.rest(
32
+ hook = PlanMyStuff.import_client.rest(
33
33
  :create_org_hook,
34
34
  config.organization,
35
35
  { url: url, content_type: 'json', secret: config.webhook_secret, insecure_ssl: '0' },
@@ -56,7 +56,7 @@ namespace :plan_my_stuff do
56
56
  raise(PlanMyStuff::ConfigurationError, 'PlanMyStuff.configuration.webhook_secret is blank')
57
57
  end
58
58
 
59
- hook = PlanMyStuff.client.rest(
59
+ hook = PlanMyStuff.import_client.rest(
60
60
  :create_hook,
61
61
  repo,
62
62
  'web',
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: 1.0.1
4
+ version: 1.0.3
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-06-01 00:00:00.000000000 Z
11
+ date: 2026-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails