ecoportal-api 0.10.16 → 0.10.18

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: f6998cdda6bc8a40de4a368ab81d522cd9828cd8dbbb559a59948976e3f57dcb
4
- data.tar.gz: ba86db2250fad20b429d1f5afa26a08b064e0eeb14ea90f096dceaf4973d362e
3
+ metadata.gz: 6b3c598464285e2aa0a6b7758451fa2770a58c6c46c5dfdf6666f63e091a2572
4
+ data.tar.gz: 369895aab3cce451742e49db3baa99c791027aa9ff37b18db11ffab9135650d2
5
5
  SHA512:
6
- metadata.gz: fb91f3d928853691c913efbd17f0db1bda9343c44b1449275864fc16e053ef0d3cd1f14fd64e90625fc3ea991a81494c2a7315d318666184c14dd3acd51344f4
7
- data.tar.gz: 57f8fc55f1d55f1733fe98720477739d72b063bae1f4a16665132e20a5560192275b5815e25d99097400fd2f5de4c7914a35823a8e5168ea34187e4e5d9ae98c
6
+ metadata.gz: bb2d8b203f5d0639d8c66a064f04e93a9d7c70795948dd24bec986db85f3f4a5c63632025a037d7bae03a0bf997fa0353d14f9d0b001083b09b1024c3e50831d
7
+ data.tar.gz: 80c3c78b5feb49cd9b90bc18d847a0bf2b529de586671a1bf04e37c8fafd006c4c2fff6722dbcfa1406ab10cc837f3a324a1de4b57ff0d042f657c5445ed14cb
data/CHANGELOG.md CHANGED
@@ -2,7 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [0.10.17] - 2026-06-xx
5
+ ## [0.10.18] - 2026-08-13
6
+
7
+ ### Fixed
8
+
9
+ - Packaging-only republish with the allowlisted gemspec. `0.10.17` shipped internal repository
10
+ content (`.ai-assistance/`, `docs/self-docs/`, `docs/worklog.md`, `CLAUDE.md`,
11
+ `.claude/settings.json`) to rubygems.org via the old denylist `spec.files`. `0.10.18` is the
12
+ identical `lib/` code packaged clean; `0.10.17` will be yanked.
13
+
14
+ ## [0.10.17] - 2026-08-08
6
15
 
7
16
  ### Added
8
17
 
@@ -10,11 +19,14 @@ All notable changes to this project will be documented in this file.
10
19
 
11
20
  ### Fixed
12
21
 
13
- ## [0.10.16] - 2026-06-05
22
+ - `WithRetry` never retried timeouts: `HTTP::TimeoutError` (and so `HTTP::ConnectTimeoutError`)
23
+ is a sibling of `HTTP::ConnectionError` in the `http` gem hierarchy, not a subclass — a
24
+ transient connect/read/write timeout propagated immediately and killed whole batches mid-loop
25
+ (live-confirmed on the Farmers native card, 2026-07-30). Added `HTTP::TimeoutError` to
26
+ `HANDLED_CONNECTION_ERRORS`; applies to all downstream gems that inherit this retry layer
27
+ (`ecoportal-api-v2`, `ecoportal-api-graphql`, `eco-helpers`).
14
28
 
15
- ### Added
16
-
17
- ### Changed
29
+ ## [0.10.16] - 2026-06-05
18
30
 
19
31
  ### Fixed
20
32
 
@@ -5,8 +5,14 @@ module Ecoportal
5
5
  module WithRetry
6
6
  DELAY_REQUEST_RETRY = 5
7
7
  RETRY_ATTEMPTS = 5
8
+ # HTTP::TimeoutError is a SIBLING of HTTP::ConnectionError in the http gem's
9
+ # hierarchy (ConnectTimeoutError < TimeoutError < Error), so it must be listed
10
+ # explicitly: without it a transient connect/read/write timeout is never retried
11
+ # and kills a whole batch mid-loop (live-confirmed on the Farmers native card,
12
+ # 2026-07-30 — see multi_org_api FARMERS_NATIVE_MIGRATION.md).
8
13
  HANDLED_CONNECTION_ERRORS = [
9
14
  HTTP::ConnectionError,
15
+ HTTP::TimeoutError,
10
16
  IOError
11
17
  ].freeze
12
18
 
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- VERSION = '0.10.16'.freeze
3
+ VERSION = '0.10.18'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecoportal-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.16
4
+ version: 0.10.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tapio Saarinen
@@ -200,21 +200,9 @@ executables: []
200
200
  extensions: []
201
201
  extra_rdoc_files: []
202
202
  files:
203
- - ".gitignore"
204
- - ".markdownlint.json"
205
- - ".rspec"
206
- - ".rubocop.yml"
207
- - ".ruby-version"
208
- - ".yardopts"
209
203
  - CHANGELOG.md
210
- - CLAUDE.md
211
- - Gemfile
212
204
  - LICENSE
213
205
  - README.md
214
- - Rakefile
215
- - bin/console
216
- - bin/setup
217
- - ecoportal-api.gemspec
218
206
  - lib/ecoportal/api.rb
219
207
  - lib/ecoportal/api/common.rb
220
208
  - lib/ecoportal/api/common/base_class.rb
data/.gitignore DELETED
@@ -1,25 +0,0 @@
1
- # it's a gem, ignore the lockfile
2
- Gemfile.lock
3
-
4
- # build artifacts
5
- *.gem
6
- /.bundle/
7
- /vendor/bundle
8
- /spec/reports/
9
- /tmp/
10
- /pkg/
11
-
12
- # docs
13
- /.yardoc
14
- /_yardoc/
15
- /coverage/
16
- /doc/
17
-
18
- # rspec failure tracking
19
- .rspec_status
20
- scratch.rb
21
-
22
- #byebug
23
- .byebug_history
24
-
25
- .solargraph.yml
data/.markdownlint.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "MD013": false,
3
- "MD024": false
4
- }
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,102 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 3.2
3
- Exclude:
4
- - 'config/routes.rb'
5
- NewCops: enable
6
-
7
- Metrics/ClassLength:
8
- Max: 500
9
- Metrics/ModuleLength:
10
- Max: 300
11
- Metrics/MethodLength:
12
- Max: 50
13
- Metrics/AbcSize:
14
- Max: 30
15
- Metrics/ParameterLists:
16
- Max: 5
17
- CountKeywordArgs: false
18
- Metrics/BlockLength:
19
- CountAsOne: ['array', 'heredoc', 'method_call']
20
- Max: 50
21
- Metrics/CyclomaticComplexity:
22
- Max: 30
23
- Metrics/PerceivedComplexity:
24
- Max: 30
25
-
26
- Style/AccessorGrouping:
27
- Enabled: false
28
- Style/ConditionalAssignment:
29
- Enabled: false
30
- Style/BlockDelimiters:
31
- BracesRequiredMethods: ['log']
32
- AllowedPatterns: ['proc', 'new']
33
- Style/HashSyntax:
34
- EnforcedShorthandSyntax: either
35
- EnforcedStyle: no_mixed_keys
36
- Style/ArgumentsForwarding:
37
- UseAnonymousForwarding: false
38
- Style/ClassAndModuleChildren:
39
- Enabled: false
40
- Style/FrozenStringLiteralComment:
41
- Enabled: false
42
- Style/StringLiterals:
43
- Enabled: false
44
- Style/StringLiteralsInInterpolation:
45
- Enabled: false
46
- Style/Documentation:
47
- Enabled: false
48
- Style/CommentedKeyword:
49
- Enabled: false
50
- Style/MultilineBlockChain:
51
- Enabled: false
52
- Style/AndOr:
53
- Enabled: false
54
- Style/Alias:
55
- EnforcedStyle: prefer_alias_method
56
- Style/FetchEnvVar:
57
- Enabled: false
58
- Style/RegexpLiteral:
59
- EnforcedStyle: mixed
60
- AllowInnerSlashes: true
61
-
62
- Layout/HashAlignment:
63
- EnforcedColonStyle: table
64
- EnforcedHashRocketStyle: table
65
- Layout/LeadingCommentSpace:
66
- Enabled: false
67
- AllowGemfileRubyComment: true
68
- Layout/ParameterAlignment:
69
- Enabled: false
70
- Layout/MultilineMethodDefinitionBraceLayout:
71
- EnforcedStyle: symmetrical
72
- Layout/LineLength:
73
- Enabled: true
74
- Layout/SpaceInsideHashLiteralBraces:
75
- Enabled: false
76
- Layout/SpaceInsideBlockBraces:
77
- Enabled: false
78
- Layout/SpaceAroundOperators:
79
- Enabled: false
80
- Layout/ExtraSpacing:
81
- AllowForAlignment: true
82
- AllowBeforeTrailingComments: true
83
- Layout/AccessModifierIndentation:
84
- EnforcedStyle: indent
85
- Layout/DotPosition:
86
- EnforcedStyle: trailing
87
- Layout/MultilineMethodCallIndentation:
88
- EnforcedStyle: indented
89
- Layout/FirstHashElementIndentation:
90
- Enabled: false
91
- Layout/EmptyLineAfterGuardClause:
92
- Enabled: false
93
-
94
- Naming/VariableNumber:
95
- EnforcedStyle: snake_case
96
- CheckSymbols: false
97
- Naming/MethodParameterName:
98
- AllowedNames: ['x', 'y', 'i', 'j', 'id', 'io', 'to']
99
- Naming/RescuedExceptionsVariableName:
100
- Enabled: false
101
- Naming/BlockForwarding:
102
- Enabled: false
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.2.2
data/.yardopts DELETED
@@ -1,10 +0,0 @@
1
- --readme README.md
2
- --charset utf-8
3
- --markup-provider=redcarpet
4
- --markup=markdown
5
- --no-private
6
- --output-dir ./doc
7
- 'lib/**/*.rb'
8
- -
9
- CHANGELOG.md
10
- LICENSE
data/CLAUDE.md DELETED
@@ -1,71 +0,0 @@
1
- # CLAUDE.md — ecoportal-api
2
-
3
- AI agent instructions for this repository.
4
-
5
- **Cross-cutting architecture context lives in `ecoportal-api-graphql` — see its `CLAUDE.md` and `.claude/` folder for the full dependency map, project history, and shared skills.**
6
-
7
- ---
8
-
9
- ## Repository Role
10
-
11
- `ecoportal-api` is the **foundational REST API gem** in the EcoPortal Ruby stack. It provides authentication, HTTP client infrastructure, org context, and the `Ecoportal::API::Common` namespace that all downstream gems build on.
12
-
13
- **Position in chain:**
14
- ```
15
- ecoportal-api ← THIS REPO
16
-
17
- ecoportal-api-v2
18
-
19
- ecoportal-api-graphql
20
-
21
- eco-helpers
22
- ```
23
-
24
- **Remote:** https://gitlab.ecoportal.co.nz/ecoportal/ecoportal-api.git
25
-
26
- ---
27
-
28
- ## Key Folder Layout
29
-
30
- ```
31
- lib/ecoportal/api/
32
- common/ Shared infrastructure (client, logging, response, batch, hash_diff)
33
- client/ HTTP client — rate throttling, retries, timeouts, APM, error handling
34
- errors/ Shared error classes
35
- internal/ Internal API resources (people, permissions, schema, login providers)
36
- v1/ REST API v1 resources (people, schema, jobs)
37
- logger.rb Shared logger
38
- version.rb Gem version
39
- ```
40
-
41
- ---
42
-
43
- ## Namespace
44
-
45
- `Ecoportal::API` — specifically:
46
- - `Ecoportal::API::Common` — shared base classes (consumed by `ecoportal-api-v2` and `ecoportal-api-graphql`)
47
- - `Ecoportal::API::Internal` — internal API endpoints
48
- - `Ecoportal::API::V1` — v1 REST endpoints
49
-
50
- ---
51
-
52
- ## Key Concerns
53
-
54
- - `Common::Client` — base HTTP client with rate throttling, retry logic, timeouts, and APM integration. All downstream clients inherit or wrap this.
55
- - `Common::BaseModel` / `Common::BaseClass` — base model classes. `ecoportal-api-v2` extends these heavily.
56
- - Changes to `Common::` affect **all downstream gems** — treat as a public API.
57
-
58
- ---
59
-
60
- ## Backwards Compatibility
61
-
62
- Changes to `Ecoportal::API::Common::*` propagate to `ecoportal-api-v2`, `ecoportal-api-graphql`, and `eco-helpers`. Any breaking change must be coordinated across the chain.
63
-
64
- ---
65
-
66
- ## Running Tests
67
-
68
- ```bash
69
- bundle install
70
- bundle exec rspec
71
- ```
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in ecoportal-api.gemspec
6
- gemspec
data/Rakefile DELETED
@@ -1,38 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
- require 'rubocop/rake_task'
4
- require 'yard'
5
- require 'redcarpet'
6
-
7
- desc "run the specs"
8
- RSpec::Core::RakeTask.new(:spec)
9
-
10
- desc "run rspec showing backtrace"
11
- RSpec::Core::RakeTask.new(:spec_trace) do |task|
12
- task.rspec_opts = ['--backtrace']
13
- end
14
- task(rspec_trace: :spec_trace)
15
-
16
- desc "run rspec stopping on first fail, and show backtrace"
17
- RSpec::Core::RakeTask.new(:spec_fast) do |task|
18
- task.rspec_opts = ['--fail-fast', '--backtrace']
19
- end
20
- task(rspec_fast: :spec_fast)
21
-
22
- desc "run rubocop diaplying cop names"
23
- RuboCop::RakeTask.new(:rubocop) do |t|
24
- t.options = ['--display-cop-names']
25
- end
26
-
27
- # default task name is yard
28
- desc "Yard: generate all the documentation"
29
- YARD::Rake::YardocTask.new(:doc) do |t|
30
- #t.files = ['lib/**/*.rb']
31
- end
32
-
33
- desc "default task: runs rubocop and rspec"
34
- task :default do
35
- Rake::Task[:rubocop].invoke
36
- ensure
37
- Rake::Task[:spec].invoke
38
- end
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "ecoportal/api"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "pry"
14
- Pry.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,45 +0,0 @@
1
- # rubocop:disable Gemspec/DevelopmentDependencies
2
- lib = File.expand_path('lib', __dir__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
-
5
- require 'ecoportal/api/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "ecoportal-api"
9
- spec.version = Ecoportal::API::VERSION
10
- spec.authors = ['Tapio Saarinen']
11
- spec.email = [
12
- 'tapio@ecoportal.co.nz',
13
- 'oscar@ecoportal.co.nz'
14
- ]
15
-
16
- spec.summary = "A collection of helpers for interacting with the ecoPortal MS's various APIs"
17
- spec.homepage = "https://www.ecoportal.com"
18
- spec.licenses = %w[MIT]
19
-
20
- spec.metadata['rubygems_mfa_required'] = 'true'
21
-
22
- spec.required_ruby_version = '>= 3.2.2'
23
-
24
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
- f.match(%r{^(test|spec|features)/})
26
- end
27
- spec.bindir = 'exe'
28
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
- spec.require_paths = ['lib']
30
-
31
- spec.add_development_dependency 'pry', '~> 0.14'
32
- spec.add_development_dependency 'rake', '>= 13.0.3', '< 14'
33
- spec.add_development_dependency 'redcarpet', '>= 3.6.0', '< 4'
34
- spec.add_development_dependency 'rspec', '>= 3.12.0', '< 4'
35
- spec.add_development_dependency 'rubocop', '~> 1'
36
- spec.add_development_dependency 'rubocop-rake', '~> 0'
37
- spec.add_development_dependency 'yard', '~> 0.9'
38
-
39
- spec.add_dependency 'dotenv', '~> 3'
40
- spec.add_dependency 'elastic-apm', '>= 4.7', "< 5"
41
- spec.add_dependency 'http', '~> 5.1', "< 6"
42
- spec.add_dependency 'rate_throttle_client', '~> 0.1'
43
- end
44
-
45
- # rubocop:enable Gemspec/DevelopmentDependencies