-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.9.x Alignment - qld-gov-au to upstream + okfn to ckan containers #109
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
870b36e
update Solr container name, ckan-solr-dev is obsolete
ThrawnCA 11fbc9c
Merge pull request #100 from qld-gov-au/github-99-docker-container
duttonw 9ea3b7a
Merge branch 'develop' of https://github.com/ckan/ckanext-validation …
duttonw 7715778
fix: only one flag per upload
duttonw 037512f
fix: only one flag per upload
duttonw 8ec2043
chore: alignment, move logic into logic folder and split auth and act…
duttonw 8550942
chore: Correct flask blueprint and cleanup imports by using get_comma…
duttonw 8755a78
chore: move commands to common and cross referfence in cli also
duttonw 22692ed
chore: controller uses common function
duttonw f001c86
chore: update model
duttonw 0808555
chore: move functions out of plugin into utils
duttonw b9c04fd
chore: cleanup
duttonw 47476bd
chore: rename helpers._get_helpers() to get_helpers()
duttonw a142055
Merge pull request #106 from ckan/alignment-action_split
duttonw 45234e6
Merge branch 'master' of https://github.com/ckan/ckanext-validation i…
duttonw eb9b42f
Merge branch 'develop' of https://github.com/ckan/ckanext-validation …
duttonw 5894dce
aligntment: convert badges to css, use webassets only, user iUploader…
duttonw 9b47aa6
Merge pull request #108 from ckan/alignment-qld-gov-au
duttonw be4f002
chore: move from okfn container to ckan container which users 'Pytest 5'
duttonw c3b975d
fix: sync to image that has not been updated in last day for 2.9
duttonw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,26 +23,30 @@ jobs: | |
include: #ckan-image see https://github.com/ckan/ckan-docker-base, ckan-version controls other image tags | ||
# - ckan-version: "2.11" | ||
# ckan-image: "2.11-py3.10" | ||
# ckan-solr: "2.11-solr9" | ||
# experimental: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we un-comment these as |
||
# - ckan-version: "2.10" | ||
# ckan-image: "2.10-py3.10" | ||
# ckan-solr: "2.10-solr9" | ||
# experimental: false | ||
- ckan-version: "2.9" | ||
ckan-image: "2.9-py3.9" | ||
ckan-solr: "2.9-solr8" | ||
experimental: false | ||
# - ckan-version: "master" | ||
# ckan-image: "master" | ||
# ckan-solr: "master-solr9" | ||
# experimental: true # master is unstable, good to know if we are compatible or not | ||
fail-fast: false | ||
|
||
name: CKAN ${{ matrix.ckan-version }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: openknowledge/ckan-dev:${{ matrix.ckan-version }} | ||
image: ckan/ckan-dev:${{ matrix.ckan-image }} | ||
options: --user root | ||
services: | ||
solr: | ||
image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr9 | ||
image: ckan/ckan-solr:${{ matrix.ckan-solr }} | ||
postgres: | ||
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }} | ||
env: | ||
|
@@ -79,6 +83,11 @@ jobs: | |
# Replace default path to CKAN core config file with the one on the container | ||
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini | ||
|
||
- name: Pin jinja2 for ckan 2.9 only (last jinja version that had escape class) | ||
if: ${{ matrix.ckan-version == 2.9 }} | ||
run: pip install "jinja2<3.1" | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
- name: Setup extension | ||
continue-on-error: ${{ matrix.experimental }} | ||
run: | | ||
|
@@ -95,7 +104,7 @@ jobs: | |
paths: "/tmp/artifacts/junit/*.xml" | ||
if: always() | ||
|
||
- name: Upload coverage report to codecov | ||
- name: "Upload coverage report to codecov flag: ${{ matrix.ckan-version }}" | ||
uses: codecov/codecov-action@v5 | ||
continue-on-error: ${{ matrix.experimental }} | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,3 +99,4 @@ ENV/ | |
|
||
# mypy | ||
.mypy_cache/ | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
include README.rst | ||
include README.md | ||
include LICENSE | ||
include requirements.txt | ||
recursive-include ckanext/validation *.html *.json *.js *.less *.css *.mo | ||
recursive-include ckanext/validation *.html *.json *.js *.less *.css *.mo *.config *.yml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,94 @@ | ||
import sys | ||
# encoding: utf-8 | ||
|
||
import click | ||
|
||
from ckanext.validation.model import create_tables, tables_exist | ||
from ckanext.validation import common | ||
|
||
|
||
def get_commands(): | ||
return [validation] | ||
|
||
|
||
@click.group() | ||
def validation(): | ||
"""Harvests remotely mastered metadata.""" | ||
"""Validation management commands. | ||
""" | ||
pass | ||
|
||
|
||
@validation.command() | ||
@validation.command(name='init-db') | ||
def init_db(): | ||
"""Creates the necessary tables in the database.""" | ||
if tables_exist(): | ||
print(u"Validation tables already exist") | ||
sys.exit(0) | ||
""" Initialize database tables. | ||
""" | ||
common.init_db() | ||
|
||
|
||
@validation.command(name='run') | ||
@click.option(u'-y', u'--yes', | ||
help=u'Automatic yes to prompts. Assume "yes" as answer ' | ||
u'to all prompts and run non-interactively', | ||
default=False) | ||
@click.option('-r', '--resource', | ||
multiple=True, | ||
help=u'Run data validation on a particular resource (if the format is suitable).' | ||
u'It can be defined multiple times. Not to be used with -d or -s') | ||
@click.option('-d', '--dataset', | ||
multiple=True, | ||
help=u'Run data validation on all resources for a particular dataset (if the format is suitable).' | ||
u' You can use the dataset id or name, and it can be defined multiple times. ' | ||
u'Not to be used with -r or -s') | ||
@click.option('-s', '--search', | ||
default=False, | ||
help=u'Extra search parameters that will be used for getting the datasets to run ' | ||
u'validation on. It must be a JSON object like the one used by the `package_search` API call.' | ||
u' Supported fields are `q`, `fq` and `fq_list`. Check the documentation for examples. ' | ||
u'Note that when using this you will have to specify the resource formats to target yourself.' | ||
u' Not to be used with -r or -d.') | ||
def run_validation(yes, resource, dataset, search): | ||
'''Start asynchronous data validation on the site resources. If no | ||
options are provided it will run validation on all resources of | ||
the supported formats (`ckanext.validation.formats`). You can | ||
specify particular datasets to run the validation on their | ||
resources. You can also pass arbitrary search parameters to filter | ||
the selected datasets. | ||
''' | ||
common.run_validation(yes, resource, dataset, search) | ||
|
||
|
||
@validation.command() | ||
@click.option(u'-o', u'--output', | ||
help=u'Location of the CSV validation report file on the relevant commands.', | ||
default=u'validation_errors_report.csv') | ||
def report(output): | ||
'''Generate a report with all current data validation reports. This | ||
will print an overview of the total number of tabular resources | ||
and a breakdown of how many have a validation status of success, | ||
failure or error. Additionally it will create a CSV report with all | ||
failing resources, including the following fields: | ||
* Dataset name | ||
* Resource id | ||
* Resource URL | ||
* Status | ||
* Validation report URL | ||
''' | ||
common.report(output) | ||
|
||
|
||
@validation.command(name='report-full') | ||
@click.option(u'-o', u'--output', | ||
help=u'Location of the CSV validation report file on the relevant commands.', | ||
default=u'validation_errors_report.csv') | ||
def report_full(output): | ||
'''Generate a detailed report. This is similar to 'report' | ||
but on the CSV report it will add a row for each error found on the | ||
validation report (limited to ten occurrences of the same error | ||
type per file). So the fields in the generated CSV report will be: | ||
|
||
create_tables() | ||
print(u"Validation tables created") | ||
* Dataset name | ||
* Resource id | ||
* Resource URL | ||
* Status | ||
* Error code | ||
* Error message | ||
''' | ||
common.report(output, full=True) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍