Skip to content

Commit b98172c

Browse files
authored
Merge pull request #732 from wmde/release/2023-11-01
Release Mismatch Finder to Production
2 parents 12a5d32 + 6a75fb0 commit b98172c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1250
-632
lines changed

.github/workflows/deploy-app-staging.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@ name: Build and Deploy to staging on Toolforge
33
on:
44
push:
55
branches:
6-
- main
6+
- development
77
- staging/**
88
- gh-actions/**
99

10+
concurrency:
11+
group: '${{ github.workflow }}'
12+
cancel-in-progress: true
13+
1014
jobs:
1115
build-deploy:
1216
name: Ship and Deploy
1317
runs-on: ubuntu-latest
1418
steps:
15-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1620
- name: Set up node
1721
uses: actions/setup-node@v3.8.1
1822
with:

.github/workflows/deploy-app.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ on:
44
push:
55
branches:
66
- main
7-
- gh-actions/**
7+
8+
concurrency:
9+
group: '${{ github.workflow }}'
10+
cancel-in-progress: true
811

912
jobs:
1013
build-deploy:
1114
name: Ship and Deploy
1215
runs-on: ubuntu-latest
1316
steps:
14-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1518
- name: Set up node
1619
uses: actions/setup-node@v3.8.1
1720
with:

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
phpcs-lint:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
9+
- uses: actions/checkout@v4
1010

1111
- name: Setup PHP
1212
uses: shivammathur/setup-php@v2
@@ -22,7 +22,7 @@ jobs:
2222
js-lint:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626

2727
- name: Setup Node.js
2828
uses: actions/setup-node@v3.8.1
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Creates a PR from development to main every 2 weeks
2+
name: Release request from development to main
3+
4+
on:
5+
schedule:
6+
- cron: '0 0 1,15 * *'
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
ref: development
17+
- name: Branch out Release
18+
run: |
19+
git config --global user.name "GitHub Actions"
20+
git config --global user.email "<>"
21+
git branch release/$(date +'%Y-%m-%d')
22+
git push -u origin release/$(date +'%Y-%m-%d')
23+
- name: Create PR
24+
run: |
25+
gh pr create -B main -H release/$(date +'%Y-%m-%d') \
26+
--title "Release Mismatch Finder to Production" \
27+
--body "Review and release the latest changes."
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
feature-test:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
9+
- uses: actions/checkout@v4
1010

1111
- name: Setup PHP
1212
uses: shivammathur/setup-php@v2
@@ -28,7 +28,7 @@ jobs:
2828
js-test:
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3232

3333
- name: Setup Node.js
3434
uses: actions/setup-node@v3.8.1
@@ -47,7 +47,7 @@ jobs:
4747
timeout-minutes: 30
4848

4949
steps:
50-
- uses: actions/checkout@v3
50+
- uses: actions/checkout@v4
5151
with:
5252
fetch-depth: 1
5353

.github/workflows/update-toc.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Update Table of Contents (ToC)
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- docs/**
7+
8+
jobs:
9+
generateTOC:
10+
name: TOC Generator
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: technote-space/toc-generator@v4
14+
with:
15+
TARGET_PATHS: ./docs/*.md
16+
CREATE_PR: true
17+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ A tool to review mismatches between Wikidata and External Databases.
1616
* Follow [these instructions](docs/README.md#quickstart) to setup your local environment.
1717
* Start the application server with `sail up`
1818
* Stop the application server with `sail down`
19-
* Make sure to setup a local testing oauth consumer by following [these instructions](docs/README.md#oauth)
19+
* Make sure to setup a local testing oauth consumer by following [these instructions](docs/README.md#working-with-oauth)
2020
* If you encounter any issues, see the [troubleshooting section](docs/README.md#troubleshooting).

app/Jobs/ImportCSV.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public function handle(CSVImportReader $reader)
4949
DB::transaction(function () use ($reader, $filepath) {
5050
$reader->lines($filepath)->each(function ($mismatchLine) {
5151
$mismatch = Mismatch::make($mismatchLine);
52+
if ($mismatch->type == null) {
53+
$mismatch->type = 'statement';
54+
}
5255
$mismatch->importMeta()->associate($this->meta);
5356
$mismatch->save();
5457
});

app/Jobs/ValidateCSV.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ private function checkFieldErrors($mismatch): ?string
136136
'prohibited_if:wikidata_value,',
137137
'max:' . $rules['meta_wikidata_value']['max_length'],
138138
'regex:' . $rules['meta_wikidata_value']['format']
139+
],
140+
'type' => [
141+
'string',
142+
'in:' . implode(',', $rules['type']['accepted_values']),
139143
]
140144
]);
141145

app/Models/Mismatch.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class Mismatch extends Model
2222
'meta_wikidata_value',
2323
'external_value',
2424
'external_url',
25-
'review_status'
25+
'review_status',
26+
'type'
2627
];
2728

2829
/**
@@ -31,7 +32,8 @@ class Mismatch extends Model
3132
* @var array
3233
*/
3334
protected $attributes = [
34-
'review_status' => 'pending'
35+
'review_status' => 'pending',
36+
'type' => 'statement'
3537
];
3638

3739
public function importMeta()

0 commit comments

Comments
 (0)