Skip to content

Commit

Permalink
Merge branch 'main' into group-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
teolemon authored Aug 1, 2024
2 parents ec98165 + b41d012 commit 385cd28
Show file tree
Hide file tree
Showing 45 changed files with 869 additions and 521 deletions.
136 changes: 68 additions & 68 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,91 @@
# for reference, see https://github.com/actions/labeler

github:
- changed-files:
- any-glob-to-any-file: '.github/**/*'
- changed-files:
- any-glob-to-any-file: ".github/**/*"

documentation:
- changed-files:
- any-glob-to-any-file: 'CONTRIBUTING.md'
- any-glob-to-any-file: 'LICENSE'
- any-glob-to-any-file: 'README.md'
- any-glob-to-any-file: 'backend/README.md'
- any-glob-to-any-file: 'doc/how-to-guides/develop-with-neo4j.md'
- any-glob-to-any-file: 'doc/how-to-guides/docker-compose-setup.md'
- any-glob-to-any-file: 'doc/introduction/setup-dev.md'
- any-glob-to-any-file: 'doc/references/taxonomy-parser.md'
- any-glob-to-any-file: 'doc/assets/.empty'
- any-glob-to-any-file: 'doc/**/*'
- changed-files:
- any-glob-to-any-file: "CONTRIBUTING.md"
- any-glob-to-any-file: "LICENSE"
- any-glob-to-any-file: "README.md"
- any-glob-to-any-file: "backend/README.md"
- any-glob-to-any-file: "doc/how-to-guides/develop-with-neo4j.md"
- any-glob-to-any-file: "doc/how-to-guides/docker-compose-setup.md"
- any-glob-to-any-file: "doc/introduction/setup-dev.md"
- any-glob-to-any-file: "doc/references/taxonomy-parser.md"
- any-glob-to-any-file: "doc/assets/.empty"
- any-glob-to-any-file: "doc/**/*"

docker:
- changed-files:
- any-glob-to-any-file: 'backend/Dockerfile'
- any-glob-to-any-file: 'taxonomy-editor-frontend/Dockerfile'
- any-glob-to-any-file: 'docker-compose.yml'
- any-glob-to-any-file: 'docker/dev.yml'
- changed-files:
- any-glob-to-any-file: "backend/Dockerfile"
- any-glob-to-any-file: "taxonomy-editor-frontend/Dockerfile"
- any-glob-to-any-file: "docker-compose.yml"
- any-glob-to-any-file: "docker/dev.yml"

backend:
- changed-files:
- any-glob-to-any-file: 'backend/editor/__init__.py'
- any-glob-to-any-file: 'backend/editor/api.py'
- any-glob-to-any-file: 'backend/editor/entries.py'
- any-glob-to-any-file: 'backend/editor/exceptions.py'
- any-glob-to-any-file: 'backend/editor/graph_db.py'
- any-glob-to-any-file: 'backend/editor/models.py'
- any-glob-to-any-file: 'backend/editor/normalizer.py'
- any-glob-to-any-file: 'backend/editor/settings.py'
- any-glob-to-any-file: 'backend/pyproject.toml'
- any-glob-to-any-file: 'backend/poetry.lock'
- any-glob-to-any-file: 'backend/sample/load.py'
- any-glob-to-any-file: 'backend/sample/schema.json'
- any-glob-to-any-file: 'backend/sample/test-neo4j.json'
- any-glob-to-any-file: 'backend/sample/test.json'
- any-glob-to-any-file: 'backend/sample/test.txt'
- any-glob-to-any-file: 'backend/**/*'
- changed-files:
- any-glob-to-any-file: "backend/editor/__init__.py"
- any-glob-to-any-file: "backend/editor/api.py"
- any-glob-to-any-file: "backend/editor/entries.py"
- any-glob-to-any-file: "backend/editor/exceptions.py"
- any-glob-to-any-file: "backend/editor/graph_db.py"
- any-glob-to-any-file: "backend/editor/models.py"
- any-glob-to-any-file: "backend/editor/normalizer.py"
- any-glob-to-any-file: "backend/editor/settings.py"
- any-glob-to-any-file: "backend/pyproject.toml"
- any-glob-to-any-file: "backend/poetry.lock"
- any-glob-to-any-file: "backend/sample/load.py"
- any-glob-to-any-file: "backend/sample/schema.json"
- any-glob-to-any-file: "backend/sample/test-neo4j.json"
- any-glob-to-any-file: "backend/sample/test.json"
- any-glob-to-any-file: "backend/sample/test.txt"
- any-glob-to-any-file: "backend/**/*"

frontend:
- changed-files:
- any-glob-to-any-file: 'taxonomy-editor-frontend/**/*'
- changed-files:
- any-glob-to-any-file: "taxonomy-editor-frontend/**/*"

dependencies:
- changed-files:
- any-glob-to-any-file: 'backend/pyproject.toml'
- any-glob-to-any-file: 'backend/poetry.lock'
- any-glob-to-any-file: 'parser/pyproject.toml'
- any-glob-to-any-file: 'parser/poetry.lock'
- any-glob-to-any-file: 'taxonomy-editor-frontend/package.json'
- changed-files:
- any-glob-to-any-file: "backend/pyproject.toml"
- any-glob-to-any-file: "backend/poetry.lock"
- any-glob-to-any-file: "parser/pyproject.toml"
- any-glob-to-any-file: "parser/poetry.lock"
- any-glob-to-any-file: "taxonomy-editor-frontend/package.json"

api:
- changed-files:
- any-glob-to-any-file: 'backend/editor/api.py'
- changed-files:
- any-glob-to-any-file: "backend/editor/api.py"

nginx:
- changed-files:
- any-glob-to-any-file: 'conf/nginx.conf'
- changed-files:
- any-glob-to-any-file: "conf/nginx.conf"

neo4j:
- changed-files:
- any-glob-to-any-file: 'neo4j/**/*'
- changed-files:
- any-glob-to-any-file: "neo4j/**/*"

parser:
- changed-files:
- any-glob-to-any-file: 'parser/Makefile'
- any-glob-to-any-file: 'parser/openfoodfacts_taxonomy_parser/__init__.py'
- any-glob-to-any-file: 'parser/openfoodfacts_taxonomy_parser/exception.py'
- any-glob-to-any-file: 'parser/openfoodfacts_taxonomy_parser/parser.py'
- any-glob-to-any-file: 'parser/openfoodfacts_taxonomy_parser/unparser.py'
- any-glob-to-any-file: 'parser/pyproject.toml'
- any-glob-to-any-file: 'parser/poetry.lock'
- any-glob-to-any-file: 'parser/setup.cfg'
- any-glob-to-any-file: 'parser/tests/__init__.py'
- any-glob-to-any-file: 'parser/tests/conftest.py'
- any-glob-to-any-file: 'parser/tests/data/test.txt'
- any-glob-to-any-file: 'parser/tests/integration/__init__.py'
- any-glob-to-any-file: 'parser/**/*'
- changed-files:
- any-glob-to-any-file: "parser/Makefile"
- any-glob-to-any-file: "parser/openfoodfacts_taxonomy_parser/__init__.py"
- any-glob-to-any-file: "parser/openfoodfacts_taxonomy_parser/exception.py"
- any-glob-to-any-file: "parser/openfoodfacts_taxonomy_parser/parser.py"
- any-glob-to-any-file: "parser/openfoodfacts_taxonomy_parser/unparser.py"
- any-glob-to-any-file: "parser/pyproject.toml"
- any-glob-to-any-file: "parser/poetry.lock"
- any-glob-to-any-file: "parser/setup.cfg"
- any-glob-to-any-file: "parser/tests/__init__.py"
- any-glob-to-any-file: "parser/tests/conftest.py"
- any-glob-to-any-file: "parser/tests/data/test.txt"
- any-glob-to-any-file: "parser/tests/integration/__init__.py"
- any-glob-to-any-file: "parser/**/*"

tests:
- any-glob-to-any-file: 'parser/tests/__init__.py'
- any-glob-to-any-file: 'parser/tests/conftest.py'
- any-glob-to-any-file: 'parser/tests/data/test.txt'
- any-glob-to-any-file: 'parser/tests/integration/__init__.py'
- any-glob-to-any-file: 'parser/tests/**/*'
- any-glob-to-any-file: "parser/tests/__init__.py"
- any-glob-to-any-file: "parser/tests/conftest.py"
- any-glob-to-any-file: "parser/tests/data/test.txt"
- any-glob-to-any-file: "parser/tests/integration/__init__.py"
- any-glob-to-any-file: "parser/tests/**/*"
27 changes: 27 additions & 0 deletions .github/workflows/top-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Top issues action.
#on:
# schedule:
# - cron: '0 0 */1 * *'
on:
issues:
types: [opened, transferred]

jobs:
ShowAndLabelTopIssues:
name: Display and label top issues.
runs-on: ubuntu-latest
steps:
- name: Run top issues action
uses: rickstaa/top-issues-action@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
label: true
dashboard: true
dashboard_title: 👍 Top Issues Dashboard
dashboard_show_total_reactions: true
top_issues: true
top_bugs: true
top_features: true
top_pull_requests: true
top_list_size: 20
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## [1.1.0](https://github.com/openfoodfacts/taxonomy-editor/compare/v1.0.2...v1.1.0) (2024-07-26)


### Features

* make taxonomy more robust ([#524](https://github.com/openfoodfacts/taxonomy-editor/issues/524)) ([49d8e46](https://github.com/openfoodfacts/taxonomy-editor/commit/49d8e46ea30d7c8ca6b6edc73842005603058d1e))

## [1.0.2](https://github.com/openfoodfacts/taxonomy-editor/compare/v1.0.1...v1.0.2) (2024-07-24)


### Bug Fixes

* add a space after line identifier ([#520](https://github.com/openfoodfacts/taxonomy-editor/issues/520)) ([51f7b43](https://github.com/openfoodfacts/taxonomy-editor/commit/51f7b43c73b7a1f8504ce203c98627583cb31097))
* avoid altering original entries at parsing time ([#519](https://github.com/openfoodfacts/taxonomy-editor/issues/519)) ([5fbaba9](https://github.com/openfoodfacts/taxonomy-editor/commit/5fbaba991ad3d37ccd48ce22f19014ac9d418b4f))
* less transformations on comment lines and others ([#523](https://github.com/openfoodfacts/taxonomy-editor/issues/523)) ([d366218](https://github.com/openfoodfacts/taxonomy-editor/commit/d3662181e139243c8c709dffbe48124bb100b7fa))

## [1.0.1](https://github.com/openfoodfacts/taxonomy-editor/compare/v1.0.0...v1.0.1) (2024-07-17)


### Bug Fixes

* avoid confusing language prefixes and property names ([#513](https://github.com/openfoodfacts/taxonomy-editor/issues/513)) ([e0053b6](https://github.com/openfoodfacts/taxonomy-editor/commit/e0053b6213b7f3584fcb860eb7f577baebb34520))
* language order as we dump taxonomies ([#512](https://github.com/openfoodfacts/taxonomy-editor/issues/512)) ([2bc56e6](https://github.com/openfoodfacts/taxonomy-editor/commit/2bc56e621829dd1676660a1a6a4407c5e036eb40))

## 1.0.0 (2024-07-12)


Expand Down
20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,19 @@ generate_sdk: ## Generate client SDK from OpenAPI spec
${DOCKER_COMPOSE} run --rm taxonomy_node npm run generate:api

# lint code
lint: backend_lint frontend_lint config_lint ## Run all linters
lint: parser_lint backend_lint frontend_lint config_lint ## Run all linters

backend_lint: ## Run lint on backend code
@echo "🍜 Linting python code"
${DOCKER_COMPOSE} run --rm taxonomy_api isort .
${DOCKER_COMPOSE} run --rm taxonomy_api black .

parser_lint: ## Run lint on parser code
@echo "🍜 Linting python code"
${DOCKER_COMPOSE} run --rm -w /parser taxonomy_api isort /parser
${DOCKER_COMPOSE} run --rm -w /parser taxonomy_api black /parser


frontend_lint: ## Run lint on frontend code
@echo "🍜 Linting react code"
${DOCKER_COMPOSE} run --rm taxonomy_node npx eslint --fix src/
Expand All @@ -141,14 +147,21 @@ config_lint: ## Run on lint configuration files


# check code quality
quality: backend_quality frontend_quality config_quality ## Run all quality checks
quality: parser_quality backend_quality frontend_quality config_quality ## Run all quality checks

backend_quality: ## Run quality checks on backend code
@echo "🍜 Quality checks python"
${DOCKER_COMPOSE} run --rm taxonomy_api flake8 --exclude=.venv .
${DOCKER_COMPOSE} run --rm taxonomy_api isort --check-only --skip .venv .
${DOCKER_COMPOSE} run --rm taxonomy_api black --check --exclude=.venv .

parser_quality: ## Run quality checks on backend code
@echo "🍜 Quality checks python"
${DOCKER_COMPOSE} run --rm -w /parser taxonomy_api flake8 --exclude=.venv /parser
${DOCKER_COMPOSE} run --rm -w /parser taxonomy_api isort --check-only --skip .venv /parser
${DOCKER_COMPOSE} run --rm -w /parser taxonomy_api black --check --exclude=.venv /parser


frontend_quality: ## Run quality checks on frontend code
@echo "🍜 Quality checks JS"
${DOCKER_COMPOSE} run --rm taxonomy_node npx eslint --no-fix src/
Expand All @@ -167,13 +180,12 @@ tests: backend_tests ## Run all tests
backend_tests: ## Run python tests
@echo "🍜 Running python tests"
${DOCKER_COMPOSE_TEST} up -d neo4j
${DOCKER_COMPOSE_TEST} run --rm taxonomy_api pytest /parser /parser
${DOCKER_COMPOSE_TEST} run --rm taxonomy_api pytest /parser
${DOCKER_COMPOSE_TEST} run --rm taxonomy_api pytest /code/tests
${DOCKER_COMPOSE_TEST} stop neo4j

checks: quality tests ## Run all checks (quality + tests)


#------------#
# production #
#------------#
Expand Down
44 changes: 22 additions & 22 deletions backend/sample/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@

stopwords:fr: aux,au,de,le,du,la,a,et

synonyms:en:passion fruit, passionfruit
synonyms:en: passion fruit, passionfruit

synonyms:fr:fruit de la passion, maracuja, passion
synonyms:fr: fruit de la passion, maracuja, passion

en:yogurts, yoghurts
fr:yaourts, yoghourts, yogourts
en: yogurts, yoghurts
fr: yaourts, yoghourts, yogourts

<en:yogurts
en:banana yogurts
fr:yaourts à la banane
<en: yogurts
en: banana yogurts
fr: yaourts à la banane

<en:yogurts
en:Passion fruit yogurts
fr:yaourts au fruit de la passion
<en: yogurts
en: Passion fruit yogurts
fr: yaourts au fruit de la passion

<fr:yaourts fruit de la passion
fr:yaourts au fruit de la passion allégés
<fr: yaourts fruit de la passion
fr: yaourts au fruit de la passion allégés

# meat

en:meat
vegan:en:no
carbon_footprint_fr_foodges_value:fr:10
en: meat
vegan:en: no
carbon_footprint_fr_foodges_value:fr: 10

<en:meat
en:fake-meat
vegan:en:yes
<en: meat
en: fake-meat
vegan:en: yes

en:fake-stuff
en: fake-stuff

<en:fake-stuff
<en:fake-meat
en:fake-duck-meat
<en: fake-stuff
<en: fake-meat
en: fake-duck-meat
Loading

0 comments on commit 385cd28

Please sign in to comment.