govuk_content_item_loader 2.1.3 → 2.2.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/.github/dependabot.yml +26 -5
- data/.github/pull_request_template.md +1 -1
- data/.github/workflows/actionlint.yml +1 -1
- data/.github/workflows/ci.yml +2 -2
- data/CHANGELOG.md +4 -0
- data/lib/govuk_content_item_loader/govuk_conditional_content_item_loader.rb +12 -2
- data/lib/govuk_content_item_loader/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: b3ceca83242496f8f8c801c30b74ff9e1a7e2614f9b596b9df3d793bb54f3f2e
|
|
4
|
+
data.tar.gz: f24ec6c54b15b1eeb5c3c793946c94ad44fe25aa173aceebabeec2b8000842b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab47e97e60c256f5abc8286644de7e1f00a10295519b1effa8c1525afb3c09ff045cf4bd850b1e14c1bf044ce23e5d3901cc2a64733192e2079de2e163a5b8dc
|
|
7
|
+
data.tar.gz: 6e26ba08c76fc6a7cdada9282f8a6e709c44f54afd8465512d0920f9d44b37ce2d813b8168fd0beecee989913d187363bed65d947c91c66669b0286ac10d4bb4
|
data/.github/dependabot.yml
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
version: 2
|
|
2
2
|
updates:
|
|
3
3
|
- package-ecosystem: bundler
|
|
4
|
-
directory:
|
|
4
|
+
directory: /
|
|
5
5
|
schedule:
|
|
6
|
-
interval:
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
interval: weekly
|
|
7
|
+
day: tuesday
|
|
8
|
+
time: "07:00"
|
|
9
|
+
allow:
|
|
10
|
+
- dependency-type: direct
|
|
11
|
+
cooldown:
|
|
12
|
+
default-days: 3
|
|
13
|
+
open-pull-requests-limit: 25
|
|
14
|
+
groups:
|
|
15
|
+
test:
|
|
16
|
+
patterns:
|
|
17
|
+
- "climate_control"
|
|
18
|
+
- "ostruct"
|
|
19
|
+
- "rspec"
|
|
20
|
+
- "simplecov"
|
|
21
|
+
- "webmock"
|
|
22
|
+
|
|
23
|
+
- package-ecosystem: github-actions
|
|
24
|
+
directory: /
|
|
9
25
|
schedule:
|
|
10
|
-
interval:
|
|
26
|
+
interval: weekly
|
|
27
|
+
day: tuesday
|
|
28
|
+
time: "07:00"
|
|
29
|
+
cooldown:
|
|
30
|
+
default-days: 3
|
|
31
|
+
open-pull-requests-limit: 25
|
|
@@ -1 +1 @@
|
|
|
1
|
-
This
|
|
1
|
+
This repo is owned by the Content APIs team. Please let us know in [#govuk-content-apis](https://gds.slack.com/archives/C03D792LYJG) when you raise any PRs.
|
|
@@ -6,7 +6,7 @@ jobs:
|
|
|
6
6
|
actionlint:
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
8
|
steps:
|
|
9
|
-
- uses: actions/checkout@
|
|
9
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
10
10
|
with:
|
|
11
11
|
show-progress: false
|
|
12
12
|
- uses: alphagov/govuk-infrastructure/.github/actions/actionlint@main
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -35,10 +35,10 @@ jobs:
|
|
|
35
35
|
ruby: [3.3, 3.4, 4.0]
|
|
36
36
|
runs-on: ubuntu-latest
|
|
37
37
|
steps:
|
|
38
|
-
- uses: actions/checkout@
|
|
38
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
39
39
|
with:
|
|
40
40
|
ref: ${{ inputs.ref || github.ref }}
|
|
41
|
-
- uses: ruby/setup-ruby@
|
|
41
|
+
- uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
|
|
42
42
|
with:
|
|
43
43
|
ruby-version: ${{ matrix.ruby }}
|
|
44
44
|
bundler-cache: true
|
data/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
class GovukConditionalContentItemLoader
|
|
2
2
|
attr_reader :content_store_client, :publishing_api_client, :request, :base_path
|
|
3
3
|
|
|
4
|
-
def initialize(request:, content_store_client: GdsApi.content_store, publishing_api_client:
|
|
4
|
+
def initialize(request:, content_store_client: GdsApi.content_store, publishing_api_client: nil, base_path: nil)
|
|
5
5
|
@content_store_client = content_store_client
|
|
6
|
-
@publishing_api_client = publishing_api_client
|
|
6
|
+
@publishing_api_client = publishing_api_client || default_publishing_api_client
|
|
7
7
|
@request = request
|
|
8
8
|
@base_path = base_path || request&.path
|
|
9
9
|
end
|
|
@@ -15,6 +15,8 @@ class GovukConditionalContentItemLoader
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def can_load_from_graphql?
|
|
18
|
+
return false unless publishing_api_client
|
|
19
|
+
|
|
18
20
|
return false unless request
|
|
19
21
|
|
|
20
22
|
return false if draft_host?
|
|
@@ -55,6 +57,14 @@ private
|
|
|
55
57
|
request.env["govuk.prometheus_labels"] = prometheus_labels.merge(hash)
|
|
56
58
|
end
|
|
57
59
|
|
|
60
|
+
def publishing_api_service_uri_configured?
|
|
61
|
+
!ENV["PLEK_SERVICE_PUBLISHING_API_URI"].nil?
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def default_publishing_api_client
|
|
65
|
+
publishing_api_service_uri_configured? ? GdsApi.publishing_api : nil
|
|
66
|
+
end
|
|
67
|
+
|
|
58
68
|
def draft_host?
|
|
59
69
|
ENV["PLEK_HOSTNAME_PREFIX"] == "draft-"
|
|
60
70
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_content_item_loader
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GOV.UK Dev
|
|
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
210
210
|
- !ruby/object:Gem::Version
|
|
211
211
|
version: '0'
|
|
212
212
|
requirements: []
|
|
213
|
-
rubygems_version: 4.0.
|
|
213
|
+
rubygems_version: 4.0.14
|
|
214
214
|
specification_version: 4
|
|
215
215
|
summary: Provides a standardised content item loader for GOV.UK frontend apps with
|
|
216
216
|
configurable GraphQL traffic routing and automatic fallback to the Content Store
|