govuk_content_item_loader 0.1.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 +7 -0
- data/.github/dependabot.yml +10 -0
- data/.github/pull_request_template.md +1 -0
- data/.github/workflows/actionlint.yml +12 -0
- data/.github/workflows/autorelease.yml +12 -0
- data/.github/workflows/ci.yml +63 -0
- data/.github/workflows/gem-bump-checker.yml +9 -0
- data/.gitignore +10 -0
- data/.govuk_dependabot_merger.yml +4 -0
- data/.rspec +1 -0
- data/.rubocop.yml +4 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +3 -0
- data/LICENCE +21 -0
- data/README.md +7 -0
- data/Rakefile +11 -0
- data/govuk_content_item_loader.gemspec +29 -0
- data/lib/govuk_content_item_loader/version.rb +3 -0
- data/lib/govuk_content_item_loader.rb +1 -0
- metadata +143 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 365987707cc39e8b636dfa88723bf0dd4c94a927b10188e72d2cc1a6db083abf
|
|
4
|
+
data.tar.gz: 32de377938b8a4c3f7c5ed0ef369f4d18e67a807defb745ef1bf2d348db08266
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: '068e7bdf5420dac1daaebb68ceef011475c4ddd94b2204793c0e650909d4ae11c6606c8118d31980241e4fffcfdb2002a607cb3cb88ec8fcbced97ad580d8eb8'
|
|
7
|
+
data.tar.gz: 695b64ce8e808861f42d95fa0e1516b326257dc0518dba887677e6619283d01a9dcdfcb0d59093b21b99a22613a6ac7b5a12c60c37c0ebbb4a8a52972d7cee96
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This application is owned by the Publishing Platform team. Please let us know in [#govuk-publishing-platform](https://gds.slack.com/archives/C03D792LYJG) when you raise any PRs.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: Lint GitHub Actions
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
paths: ['.github/**']
|
|
5
|
+
jobs:
|
|
6
|
+
actionlint:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
10
|
+
with:
|
|
11
|
+
show-progress: false
|
|
12
|
+
- uses: alphagov/govuk-infrastructure/.github/actions/actionlint@main
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
on:
|
|
2
|
+
workflow_dispatch: {}
|
|
3
|
+
schedule:
|
|
4
|
+
- cron: '15 9 * * 1-5' # 9:15am UTC, Mon-Fri.
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
autorelease:
|
|
8
|
+
uses: alphagov/govuk-infrastructure/.github/workflows/autorelease-rubygem.yml@main
|
|
9
|
+
with:
|
|
10
|
+
gem_name: content_block_tools
|
|
11
|
+
secrets:
|
|
12
|
+
GH_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
inputs:
|
|
10
|
+
ref:
|
|
11
|
+
description: 'The branch, tag or SHA to checkout'
|
|
12
|
+
default: main
|
|
13
|
+
type: string
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: ${{ github.workflow }}-${{ github.repository }}-${{ github.ref_name }}
|
|
17
|
+
cancel-in-progress: false
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
codeql-sast:
|
|
21
|
+
name: CodeQL SAST scan
|
|
22
|
+
uses: alphagov/govuk-infrastructure/.github/workflows/codeql-analysis.yml@main
|
|
23
|
+
permissions:
|
|
24
|
+
security-events: write
|
|
25
|
+
|
|
26
|
+
dependency-review:
|
|
27
|
+
name: Dependency Review scan
|
|
28
|
+
uses: alphagov/govuk-infrastructure/.github/workflows/dependency-review.yml@main
|
|
29
|
+
|
|
30
|
+
# Run the test suite against multiple Ruby and Rails versions
|
|
31
|
+
test_matrix:
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
ruby: [3.2, 3.3, 3.4]
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
39
|
+
with:
|
|
40
|
+
ref: ${{ inputs.ref || github.ref }}
|
|
41
|
+
- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
|
|
42
|
+
with:
|
|
43
|
+
ruby-version: ${{ matrix.ruby }}
|
|
44
|
+
bundler-cache: true
|
|
45
|
+
- run: bundle exec rake
|
|
46
|
+
|
|
47
|
+
# Branch protection rules cannot directly depend on status checks from matrix jobs.
|
|
48
|
+
# So instead we define `test` as a dummy job which only runs after the preceding `test_matrix` checks have passed.
|
|
49
|
+
# Solution inspired by: https://github.community/t/status-check-for-a-matrix-jobs/127354/3
|
|
50
|
+
test:
|
|
51
|
+
needs: test_matrix
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
steps:
|
|
54
|
+
- run: echo "All matrix tests have passed 🚀"
|
|
55
|
+
|
|
56
|
+
publish:
|
|
57
|
+
needs: test
|
|
58
|
+
if: ${{ github.ref == 'refs/heads/main' }}
|
|
59
|
+
permissions:
|
|
60
|
+
contents: write
|
|
61
|
+
uses: alphagov/govuk-infrastructure/.github/workflows/publish-rubygem.yml@main
|
|
62
|
+
secrets:
|
|
63
|
+
GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }}
|
data/.gitignore
ADDED
data/.rspec
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
ADDED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.2.9
|
data/Gemfile
ADDED
data/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Crown Copyright (Government Digital Service)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# GOV.UK Content Item Loader
|
|
2
|
+
|
|
3
|
+
Ruby gem that standardises how GOV.UK frontend apps load content items. It provides configurable GraphQL traffic rates per content schema and a request-level loader that routes requests to the Publishing API via GraphQL or falls back to the Content Store ensuring consistent traffic management across applications.
|
|
4
|
+
|
|
5
|
+
## Licence
|
|
6
|
+
|
|
7
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
+
require "govuk_content_item_loader/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "govuk_content_item_loader"
|
|
7
|
+
spec.version = GovukContentItemLoader::VERSION
|
|
8
|
+
spec.authors = ["GOV.UK Dev"]
|
|
9
|
+
spec.email = ["govuk-dev@digital.cabinet-office.gov.uk"]
|
|
10
|
+
|
|
11
|
+
spec.summary = "Provides a standardised content item loader for GOV.UK frontend apps with configurable GraphQL traffic routing and automatic fallback to the Content Store"
|
|
12
|
+
spec.homepage = "https://github.com/alphagov/govuk_content_item_loader"
|
|
13
|
+
spec.license = "MIT"
|
|
14
|
+
|
|
15
|
+
spec.required_ruby_version = ">= 3.2"
|
|
16
|
+
|
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
18
|
+
spec.bindir = "exe"
|
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
20
|
+
spec.require_paths = %w[lib]
|
|
21
|
+
|
|
22
|
+
spec.add_dependency "gds-api-adapters", ">= 99.3"
|
|
23
|
+
|
|
24
|
+
spec.add_development_dependency "rails", ">= 7.2"
|
|
25
|
+
spec.add_development_dependency "rake", ">= 10.0"
|
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
27
|
+
spec.add_development_dependency "rubocop-govuk", "~> 5.2"
|
|
28
|
+
spec.add_development_dependency "simplecov"
|
|
29
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "govuk_content_item_loader/version"
|
metadata
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: govuk_content_item_loader
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- GOV.UK Dev
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: gds-api-adapters
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '99.3'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '99.3'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rails
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '7.2'
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '7.2'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: rake
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '10.0'
|
|
47
|
+
type: :development
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '10.0'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: rspec
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '3.0'
|
|
61
|
+
type: :development
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '3.0'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: rubocop-govuk
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - "~>"
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '5.2'
|
|
75
|
+
type: :development
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - "~>"
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '5.2'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: simplecov
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '0'
|
|
89
|
+
type: :development
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0'
|
|
96
|
+
email:
|
|
97
|
+
- govuk-dev@digital.cabinet-office.gov.uk
|
|
98
|
+
executables: []
|
|
99
|
+
extensions: []
|
|
100
|
+
extra_rdoc_files: []
|
|
101
|
+
files:
|
|
102
|
+
- ".github/dependabot.yml"
|
|
103
|
+
- ".github/pull_request_template.md"
|
|
104
|
+
- ".github/workflows/actionlint.yml"
|
|
105
|
+
- ".github/workflows/autorelease.yml"
|
|
106
|
+
- ".github/workflows/ci.yml"
|
|
107
|
+
- ".github/workflows/gem-bump-checker.yml"
|
|
108
|
+
- ".gitignore"
|
|
109
|
+
- ".govuk_dependabot_merger.yml"
|
|
110
|
+
- ".rspec"
|
|
111
|
+
- ".rubocop.yml"
|
|
112
|
+
- ".ruby-version"
|
|
113
|
+
- CHANGELOG.md
|
|
114
|
+
- Gemfile
|
|
115
|
+
- LICENCE
|
|
116
|
+
- README.md
|
|
117
|
+
- Rakefile
|
|
118
|
+
- govuk_content_item_loader.gemspec
|
|
119
|
+
- lib/govuk_content_item_loader.rb
|
|
120
|
+
- lib/govuk_content_item_loader/version.rb
|
|
121
|
+
homepage: https://github.com/alphagov/govuk_content_item_loader
|
|
122
|
+
licenses:
|
|
123
|
+
- MIT
|
|
124
|
+
metadata: {}
|
|
125
|
+
rdoc_options: []
|
|
126
|
+
require_paths:
|
|
127
|
+
- lib
|
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
|
+
requirements:
|
|
130
|
+
- - ">="
|
|
131
|
+
- !ruby/object:Gem::Version
|
|
132
|
+
version: '3.2'
|
|
133
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - ">="
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: '0'
|
|
138
|
+
requirements: []
|
|
139
|
+
rubygems_version: 4.0.6
|
|
140
|
+
specification_version: 4
|
|
141
|
+
summary: Provides a standardised content item loader for GOV.UK frontend apps with
|
|
142
|
+
configurable GraphQL traffic routing and automatic fallback to the Content Store
|
|
143
|
+
test_files: []
|