Skip to content

Commit 02a0194

Browse files
committed
Release #1292
2 parents ab64090 + 77db9ff commit 02a0194

File tree

10 files changed

+2606
-2511
lines changed

10 files changed

+2606
-2511
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ executors:
44
rails_executor:
55
working_directory: ~/web-monitoring-db
66
docker:
7-
- image: cimg/ruby:3.4.5-node
7+
- image: cimg/ruby:3.4.6-node
88
environment:
99
RAILS_ENV: test
1010
RACK_ENV: test

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.4.5
1+
3.4.6

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://docs.docker.com/engine/userguide/eng-image/multistage-build
33

44
### BASE ENVIRONMENT STAGE ###
5-
FROM ruby:3.4.5-slim AS base
5+
FROM ruby:3.4.6-slim AS base
66
LABEL maintainer="[email protected]"
77

88
# Install apt based dependencies required to run Rails as
@@ -24,7 +24,7 @@ WORKDIR /app
2424
# the RubyGems. This is a separate step so the dependencies
2525
# will be cached unless changes to one of those two files
2626
# are made.
27-
COPY Gemfile Gemfile.lock ./
27+
COPY Gemfile Gemfile.lock .ruby-version ./
2828
RUN gem install bundler && bundle install --jobs 20 --retry 5
2929

3030
# Copy the main application.

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ git_source(:github) do |repo_name|
55
"https://github.com/#{repo_name}.git"
66
end
77

8-
ruby '3.4.5'
8+
ruby file: ".ruby-version"
99

1010
gem 'aws-sdk-s3', '~> 1.198'
1111
gem 'concurrent-ruby', '~> 1.3'

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ DEPENDENCIES
481481
webmock (~> 3.25)
482482

483483
RUBY VERSION
484-
ruby 3.4.5p51
484+
ruby 3.4.6p54
485485

486486
BUNDLED WITH
487487
2.5.9

app/assets/data/swagger.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ paths:
11871187
default: true
11881188
required: false
11891189
description: >-
1190-
If set to false, the importer will not create new page records. If the POSTed data contains a version with a `page_url` field that doesn’t match an known page, the version will be skipped and not imported at all.
1190+
If set to false, the importer will not create new page records. If the POSTed data contains a version with a `url` field that doesn’t match an known page, the version will be skipped and not imported at all.
11911191
- name: skip_unchanged_versions
11921192
in: query
11931193
description: >-
@@ -2147,7 +2147,7 @@ definitions:
21472147
ImportableVersion:
21482148
type: object
21492149
properties:
2150-
page_url:
2150+
url:
21512151
type: string
21522152
format: uri
21532153
description: The original URL the version was captured from.

db/seed_import.json

Lines changed: 2452 additions & 2452 deletions
Large diffs are not rendered by default.

docs/generating-new-seed-data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ for index, page in enumerate(sampled_pages):
4949

5050
for version in versions:
5151
records.append({
52+
"url": version['url'],
5253
"capture_time": version['capture_time'].isoformat().replace('+00:00', 'Z'),
5354
"body_url": version['body_url'],
5455
"body_hash": version['body_hash'],
5556
"source_type": version['source_type'],
5657
"source_metadata": version['source_metadata'],
57-
"page_url": version['url'],
58-
"page_title": version['title'],
58+
"title": version['title'],
5959
"page_maintainers": [maintainer['name'] for maintainer in page['maintainers']],
6060
"page_tags": [tag['name'] for tag in page['tags']],
6161
"uuid": version['uuid']

test/controllers/api/v0/imports_controller_test.rb

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def diff(_change, _options = nil)
3838
test 'authorizations' do
3939
import_data = [
4040
{
41-
page_url: 'http://testsite.com/',
41+
url: 'http://testsite.com/',
4242
title: 'Example Page',
4343
page_maintainers: ['The Federal Example Agency'],
4444
page_tags: ['Example Site'],
@@ -49,7 +49,7 @@ def diff(_change, _options = nil)
4949
source_metadata: { test_meta: 'data' }
5050
},
5151
{
52-
page_url: 'http://testsite.com/',
52+
url: 'http://testsite.com/',
5353
title: 'Example Page',
5454
page_maintainers: ['The Federal Example Agency'],
5555
page_tags: ['Test', 'Home Page'],
@@ -83,7 +83,7 @@ def diff(_change, _options = nil)
8383
test 'can import data' do
8484
import_data = [
8585
{
86-
page_url: 'http://testsite.com/',
86+
url: 'http://testsite.com/',
8787
title: 'Example Page',
8888
page_maintainers: ['The Federal Example Agency'],
8989
page_tags: ['Example Site'],
@@ -94,7 +94,7 @@ def diff(_change, _options = nil)
9494
source_metadata: { test_meta: 'data' }
9595
},
9696
{
97-
page_url: 'http://testsite.com/',
97+
url: 'http://testsite.com/',
9898
title: 'Example Page',
9999
page_maintainers: ['The Federal Example Agency'],
100100
page_tags: ['Test', 'Home Page'],
@@ -145,14 +145,14 @@ def diff(_change, _options = nil)
145145

146146
versions = pages[0].versions
147147
assert_equal(2, versions.length)
148-
assert_equal(import_data[0][:page_url], versions[1].url)
149-
assert_equal(import_data[1][:page_url], versions[0].url)
148+
assert_equal(import_data[0][:url], versions[1].url)
149+
assert_equal(import_data[1][:url], versions[0].url)
150150
end
151151

152152
test 'cannot import in read-only mode' do
153153
import_data = [
154154
{
155-
page_url: 'http://testsite.com/',
155+
url: 'http://testsite.com/',
156156
title: 'Example Page',
157157
page_maintainers: ['The Federal Example Agency'],
158158
page_tags: ['Example Site'],
@@ -163,7 +163,7 @@ def diff(_change, _options = nil)
163163
source_metadata: { test_meta: 'data' }
164164
},
165165
{
166-
page_url: 'http://testsite.com/',
166+
url: 'http://testsite.com/',
167167
title: 'Example Page',
168168
page_maintainers: ['The Federal Example Agency'],
169169
page_tags: ['Test', 'Home Page'],
@@ -197,8 +197,8 @@ def diff(_change, _options = nil)
197197
original_data = versions(:page1_v1).as_json
198198
import_data = [
199199
{
200-
page_url: pages(:home_page).url,
201-
page_title: pages(:home_page).title,
200+
url: pages(:home_page).url,
201+
title: pages(:home_page).title,
202202
page_maintainers: ['The Federal Example Agency'],
203203
page_tags: pages(:home_page).tag_names,
204204
capture_time: versions(:page1_v1).capture_time,
@@ -230,8 +230,8 @@ def diff(_change, _options = nil)
230230
page_versions_count = pages(:home_page).versions.count
231231
import_data = [
232232
{
233-
page_url: pages(:home_page).url,
234-
page_title: pages(:home_page).title,
233+
url: pages(:home_page).url,
234+
title: pages(:home_page).title,
235235
page_maintainers: ['The Federal Example Agency'],
236236
page_tags: pages(:home_page).tag_names,
237237
capture_time: versions(:page1_v1).capture_time,
@@ -263,8 +263,8 @@ def diff(_change, _options = nil)
263263
original_data = versions(:page1_v1).as_json
264264
import_data = [
265265
{
266-
page_url: pages(:home_page).url,
267-
page_title: pages(:home_page).title,
266+
url: pages(:home_page).url,
267+
title: pages(:home_page).title,
268268
page_maintainers: ['The Federal Example Agency'],
269269
page_tags: pages(:home_page).tag_names,
270270
capture_time: versions(:page1_v1).capture_time,
@@ -295,7 +295,7 @@ def diff(_change, _options = nil)
295295
test 'surfaces page validation errors' do
296296
import_data = [
297297
{
298-
page_url: 'testsite',
298+
url: 'testsite',
299299
title: 'Example Page',
300300
page_maintainers: ['The Federal Example Agency'],
301301
page_tags: ['site:Example Site'],
@@ -338,7 +338,7 @@ def diff(_change, _options = nil)
338338

339339
import_data = [
340340
{
341-
page_url: 'http://testsite.com/',
341+
url: 'http://testsite.com/',
342342
title: 'Example Page',
343343
page_maintainers: ['The Federal Example Agency'],
344344
page_tags: ['site:Example Site'],
@@ -378,8 +378,8 @@ def diff(_change, _options = nil)
378378
test 'can import `null` page_maintainers' do
379379
import_data = [
380380
{
381-
page_url: 'http://testsite.com/',
382-
page_title: 'Test Page',
381+
url: 'http://testsite.com/',
382+
title: 'Test Page',
383383
page_maintainers: nil,
384384
capture_time: versions(:page1_v1).capture_time,
385385
body_url: 'https://test-bucket.s3.amazonaws.com/example-v1',
@@ -412,8 +412,8 @@ def diff(_change, _options = nil)
412412
test 'cannot import non-array page_maintainers' do
413413
import_data = [
414414
{
415-
page_url: 'http://testsite.com/',
416-
page_title: 'Test Page',
415+
url: 'http://testsite.com/',
416+
title: 'Test Page',
417417
page_maintainers: 5,
418418
capture_time: versions(:page1_v1).capture_time,
419419
body_url: 'https://test-bucket.s3.amazonaws.com/example-v1',
@@ -446,7 +446,7 @@ def diff(_change, _options = nil)
446446
test 'matches pages by url_key if no exact url match' do
447447
import_data = [
448448
{
449-
page_url: 'http://testSITE.com/whatever',
449+
url: 'http://testSITE.com/whatever',
450450
title: 'Example Page',
451451
page_maintainers: ['The Federal Example Agency'],
452452
page_tags: ['Example Site'],
@@ -457,7 +457,7 @@ def diff(_change, _options = nil)
457457
source_metadata: { test_meta: 'data' }
458458
},
459459
{
460-
page_url: 'http://testsite.com/whatever/',
460+
url: 'http://testsite.com/whatever/',
461461
title: 'Example Page',
462462
page_maintainers: ['The Federal Example Agency'],
463463
page_tags: ['Test', 'Home Page'],
@@ -485,8 +485,8 @@ def diff(_change, _options = nil)
485485
test 'can import `null` page_tags' do
486486
import_data = [
487487
{
488-
page_url: 'http://testsite.com/',
489-
page_title: 'Test Page',
488+
url: 'http://testsite.com/',
489+
title: 'Test Page',
490490
page_tags: nil,
491491
capture_time: versions(:page1_v1).capture_time,
492492
body_url: 'https://test-bucket.s3.amazonaws.com/example-v1',
@@ -519,8 +519,8 @@ def diff(_change, _options = nil)
519519
test 'cannot import non-array page_tags' do
520520
import_data = [
521521
{
522-
page_url: 'http://testsite.com/',
523-
page_title: 'Test Page',
522+
url: 'http://testsite.com/',
523+
title: 'Test Page',
524524
page_tags: 5,
525525
capture_time: versions(:page1_v1).capture_time,
526526
body_url: 'https://test-bucket.s3.amazonaws.com/example-v1',
@@ -555,7 +555,7 @@ def diff(_change, _options = nil)
555555

556556
import_data = [
557557
{
558-
page_url: 'http://whoa-there-betcha-this.com/is/not/in/the/database',
558+
url: 'http://whoa-there-betcha-this.com/is/not/in/the/database',
559559
title: 'Heyooooo!',
560560
capture_time: '2017-05-01T12:33:01Z',
561561
body_url: 'https://test-bucket.s3.amazonaws.com/unknown-v1',
@@ -564,7 +564,7 @@ def diff(_change, _options = nil)
564564
source_metadata: { test_meta: 'data' }
565565
},
566566
{
567-
page_url: pages(:home_page).url,
567+
url: pages(:home_page).url,
568568
title: 'Example Page',
569569
capture_time: '2017-05-02T12:33:01Z',
570570
body_url: 'https://test-bucket.s3.amazonaws.com/example-v2',
@@ -609,7 +609,7 @@ def diff(_change, _options = nil)
609609
# The first two here should get skipped
610610
import_data = [
611611
{
612-
page_url: page.url,
612+
url: page.url,
613613
title: 'Heyooooo!',
614614
capture_time: (now - 3.days).iso8601,
615615
body_url: 'https://test-bucket.s3.amazonaws.com/unknown-v1',
@@ -618,7 +618,7 @@ def diff(_change, _options = nil)
618618
source_metadata: { test_meta: 'data' }
619619
},
620620
{
621-
page_url: page.url,
621+
url: page.url,
622622
title: 'Heyooooo!',
623623
capture_time: (now - 2.9.days).iso8601,
624624
body_url: 'https://test-bucket.s3.amazonaws.com/unknown-v1',
@@ -627,7 +627,7 @@ def diff(_change, _options = nil)
627627
source_metadata: { test_meta: 'data' }
628628
},
629629
{
630-
page_url: page.url,
630+
url: page.url,
631631
title: 'Heyooooo!',
632632
capture_time: (now - 2.5.days).iso8601,
633633
body_url: 'https://test-bucket.s3.amazonaws.com/unknown-v1',
@@ -636,7 +636,7 @@ def diff(_change, _options = nil)
636636
source_metadata: { test_meta: 'data' }
637637
},
638638
{
639-
page_url: page.url,
639+
url: page.url,
640640
title: 'Heyooooo!',
641641
capture_time: (now - 2.days).iso8601,
642642
body_url: 'https://test-bucket.s3.amazonaws.com/unknown-v1',

0 commit comments

Comments
 (0)