diff --git a/app/projects/controller.py b/app/projects/controller.py index e88fd97..5cb218d 100644 --- a/app/projects/controller.py +++ b/app/projects/controller.py @@ -1,5 +1,3 @@ -import datetime -import json import os from typing import List @@ -11,9 +9,11 @@ from werkzeug.utils import secure_filename import werkzeug +from app import db from app.utils.grew_utils import GrewService from app.user.service import UserService from app.trees.service import TreeValidationService +from app.github.model import GithubCommitStatus from .interface import ProjectExtendedInterface, ProjectInterface, ProjectShownFeaturesAndMetaInterface from .model import Project, ProjectAccess @@ -203,9 +203,17 @@ def put(self, project_name: str): config = [] args = request.get_json() + update_commit = args['updateCommit'] config.append(args['config']) + + if update_commit and project.github_repository: # if project synchronized changing feats and misc in the config will modify data so changes will update the commit status + github_commit_status = GithubCommitStatus.query.filter_by(project_id=project.id).first() + if github_commit_status: + github_commit_status.update({"changes_number": github_commit_status.changes_number + 1}) + db.session.commit() GrewService.update_project_config(project.project_name, config) + return {"status": "success", "message": "New conllu schema was saved"} diff --git a/fetch_validator_data.sh b/fetch_validator_data.sh new file mode 100755 index 0000000..c04b9bd --- /dev/null +++ b/fetch_validator_data.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) + +cd "$parent_path" + +cd "app/utils/ud_validator/" + +curl -L -o "repo.zip" "https://github.com/UniversalDependencies/tools/archive/refs/heads/master.zip" + +unzip -q "repo.zip" -d "temp_unzip_dir" + +rm -rf ./data + +mv "temp_unzip_dir/tools-master/data" . + +rm -rf "temp_unzip_dir" "repo.zip"