Skip to content

Commit

Permalink
Merge pull request #732 from wmde/release/2023-11-01
Browse files Browse the repository at this point in the history
Release Mismatch Finder to Production
  • Loading branch information
itamargiv authored Nov 2, 2023
2 parents 12a5d32 + 6a75fb0 commit b98172c
Show file tree
Hide file tree
Showing 63 changed files with 1,250 additions and 632 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/deploy-app-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ name: Build and Deploy to staging on Toolforge
on:
push:
branches:
- main
- development
- staging/**
- gh-actions/**

concurrency:
group: '${{ github.workflow }}'
cancel-in-progress: true

jobs:
build-deploy:
name: Ship and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v3.8.1
with:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/deploy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ on:
push:
branches:
- main
- gh-actions/**

concurrency:
group: '${{ github.workflow }}'
cancel-in-progress: true

jobs:
build-deploy:
name: Ship and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v3.8.1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
phpcs-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -22,7 +22,7 @@ jobs:
js-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3.8.1
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/schedule-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Creates a PR from development to main every 2 weeks
name: Release request from development to main

on:
schedule:
- cron: '0 0 1,15 * *'
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: development
- name: Branch out Release
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "<>"
git branch release/$(date +'%Y-%m-%d')
git push -u origin release/$(date +'%Y-%m-%d')
- name: Create PR
run: |
gh pr create -B main -H release/$(date +'%Y-%m-%d') \
--title "Release Mismatch Finder to Production" \
--body "Review and release the latest changes."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
feature-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -28,7 +28,7 @@ jobs:
js-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3.8.1
Expand All @@ -47,7 +47,7 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/update-toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Update Table of Contents (ToC)

on:
pull_request:
paths:
- docs/**

jobs:
generateTOC:
name: TOC Generator
runs-on: ubuntu-latest
steps:
- uses: technote-space/toc-generator@v4
with:
TARGET_PATHS: ./docs/*.md
CREATE_PR: true

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ A tool to review mismatches between Wikidata and External Databases.
* Follow [these instructions](docs/README.md#quickstart) to setup your local environment.
* Start the application server with `sail up`
* Stop the application server with `sail down`
* Make sure to setup a local testing oauth consumer by following [these instructions](docs/README.md#oauth)
* Make sure to setup a local testing oauth consumer by following [these instructions](docs/README.md#working-with-oauth)
* If you encounter any issues, see the [troubleshooting section](docs/README.md#troubleshooting).
3 changes: 3 additions & 0 deletions app/Jobs/ImportCSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function handle(CSVImportReader $reader)
DB::transaction(function () use ($reader, $filepath) {
$reader->lines($filepath)->each(function ($mismatchLine) {
$mismatch = Mismatch::make($mismatchLine);
if ($mismatch->type == null) {
$mismatch->type = 'statement';
}
$mismatch->importMeta()->associate($this->meta);
$mismatch->save();
});
Expand Down
4 changes: 4 additions & 0 deletions app/Jobs/ValidateCSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ private function checkFieldErrors($mismatch): ?string
'prohibited_if:wikidata_value,',
'max:' . $rules['meta_wikidata_value']['max_length'],
'regex:' . $rules['meta_wikidata_value']['format']
],
'type' => [
'string',
'in:' . implode(',', $rules['type']['accepted_values']),
]
]);

Expand Down
6 changes: 4 additions & 2 deletions app/Models/Mismatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class Mismatch extends Model
'meta_wikidata_value',
'external_value',
'external_url',
'review_status'
'review_status',
'type'
];

/**
Expand All @@ -31,7 +32,8 @@ class Mismatch extends Model
* @var array
*/
protected $attributes = [
'review_status' => 'pending'
'review_status' => 'pending',
'type' => 'statement'
];

public function importMeta()
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
"ext-zip": "*",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.2.0",
"guzzlehttp/guzzle": "^7.6.1",
"inertiajs/inertia-laravel": "0.6.9",
"kevinrob/guzzle-cache-middleware": "^4.0.2",
"guzzlehttp/guzzle": "^7.8",
"inertiajs/inertia-laravel": "^0.6.10",
"kevinrob/guzzle-cache-middleware": "^4.1.2",
"laravel/framework": "^8.83.26",
"laravel/sanctum": "^2.15.1",
"laravel/socialite": "^5.5.6",
"laravel/tinker": "^2.7.3",
"laravel/socialite": "^5.9",
"laravel/tinker": "^2.8",
"taavi/laravel-socialite-mediawiki": "^1.4"
},
"require-dev": {
"facade/ignition": "^2.17.7",
"fakerphp/faker": "^1.20.0",
"laravel/dusk": "^6.25.1",
"laravel/sail": "^1.19.0",
"mockery/mockery": "^1.5.0",
"laravel/sail": "^1.19",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^5.11",
"phpunit/phpunit": "^9.6.8",
"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "^3.7.2",
"timacdonald/log-fake": "^1.9"
},
Expand Down
Loading

0 comments on commit b98172c

Please sign in to comment.