From 5bd13f16dc2889aca06185334aa8f6e5cca19308 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Mon, 27 Apr 2026 09:49:33 +0200 Subject: [PATCH 1/3] IVS-849 version bump for syntax --- .github/workflows/ci.yml | 2 +- .github/workflows/ci_cd.yml | 2 +- .github/workflows/playwright.yml | 2 +- backend/Makefile | 6 +++--- backend/apps/ifc_validation/checks/ifc_gherkin_rules | 2 +- docker/backend/Dockerfile | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf35a5de..90928eae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,7 +100,7 @@ jobs: source venv/bin/activate # use version of ifcopenshell with desired schema parsing # TODO: revert to pyPI when schema parsing is published in the future - wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip" + wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip" mkdir -p venv/lib/python3.11/site-packages unzip -d venv/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index de15d043..07a26c5f 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -101,7 +101,7 @@ jobs: source venv/bin/activate # use version of ifcopenshell with desired schema parsing # TODO: revert to pyPI when schema parsing is published in the future - wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip" + wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip" mkdir -p venv/lib/python3.11/site-packages unzip -d venv/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index f6197365..1a3a54f0 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -104,7 +104,7 @@ jobs: - name: Download and install ifcopenshell run: | - wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip" + wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip" mkdir -p .dev/venv/lib/python3.11/site-packages unzip -o -d .dev/venv/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip rm /tmp/ifcopenshell_python.zip diff --git a/backend/Makefile b/backend/Makefile index 8f3d4aa3..67bc60d4 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -14,7 +14,7 @@ venv: install: venv $(PIP) install --upgrade pip find . -name 'requirements.txt' -exec $(PIP) install -r {} \; - wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip" + wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip" mkdir -p $(VIRTUAL_ENV)/lib/python3.11/site-packages unzip -f -d $(VIRTUAL_ENV)/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip rm /tmp/ifcopenshell_python.zip @@ -22,7 +22,7 @@ install: venv install-macos: venv find . -name 'requirements.txt' -exec $(PIP) install -r {} \; $(PIP) install -r requirements.txt - wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-1c5b825-macos64.zip" + wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-macos64.zip" mkdir -p $(VIRTUAL_ENV)/lib/python3.11/site-packages unzip /tmp/ifcopenshell_python.zip -d $(VIRTUAL_ENV)/lib/python3.11/site-packages rm /tmp/ifcopenshell_python.zip @@ -30,7 +30,7 @@ install-macos: venv install-macos-m1: venv find . -name 'requirements.txt' -exec $(PIP) install -r {} \; $(PIP) install -r requirements.txt - wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-7bdc1b6-macosm164.zip" + wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-macosm164.zip" mkdir -p $(VIRTUAL_ENV)/lib/python3.11/site-packages unzip /tmp/ifcopenshell_python.zip -d $(VIRTUAL_ENV)/lib/python3.11/site-packages rm /tmp/ifcopenshell_python.zip diff --git a/backend/apps/ifc_validation/checks/ifc_gherkin_rules b/backend/apps/ifc_validation/checks/ifc_gherkin_rules index 9b7ec04a..e63ab289 160000 --- a/backend/apps/ifc_validation/checks/ifc_gherkin_rules +++ b/backend/apps/ifc_validation/checks/ifc_gherkin_rules @@ -1 +1 @@ -Subproject commit 9b7ec04a6c3151198efd26a4217551e02b2b66f5 +Subproject commit e63ab2893021b8f3a2ebe2fe3ea0ddb29eb8fbb2 diff --git a/docker/backend/Dockerfile b/docker/backend/Dockerfile index 70614997..d56f2062 100644 --- a/docker/backend/Dockerfile +++ b/docker/backend/Dockerfile @@ -37,7 +37,7 @@ RUN --mount=type=cache,target=/root/.cache \ find /app/backend -name 'requirements.txt' -exec pip install --no-cache-dir -r {} \; && \ # use version of ifcopenshell with desired schema parsing # TODO: revert to pyPI when schema parsing is published in the future - wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip" && \ + wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip" && \ mkdir -p /opt/venv/lib/python3.11/site-packages && \ unzip -d /opt/venv/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip && \ # some cleanup From 92cb4f56c0fc093adea4a929c6fc7d5563381e18 Mon Sep 17 00:00:00 2001 From: Ghesselink Date: Mon, 27 Apr 2026 14:52:46 +0000 Subject: [PATCH 2/3] easier overwrite of ifcopenshell version --- backend/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/Makefile b/backend/Makefile index 67bc60d4..a73a4453 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -16,7 +16,7 @@ install: venv find . -name 'requirements.txt' -exec $(PIP) install -r {} \; wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip" mkdir -p $(VIRTUAL_ENV)/lib/python3.11/site-packages - unzip -f -d $(VIRTUAL_ENV)/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip + unzip -o -d $(VIRTUAL_ENV)/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip rm /tmp/ifcopenshell_python.zip install-macos: venv @@ -24,7 +24,7 @@ install-macos: venv $(PIP) install -r requirements.txt wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-macos64.zip" mkdir -p $(VIRTUAL_ENV)/lib/python3.11/site-packages - unzip /tmp/ifcopenshell_python.zip -d $(VIRTUAL_ENV)/lib/python3.11/site-packages + unzip -o -d $(VIRTUAL_ENV)/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip rm /tmp/ifcopenshell_python.zip install-macos-m1: venv @@ -32,7 +32,7 @@ install-macos-m1: venv $(PIP) install -r requirements.txt wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-macosm164.zip" mkdir -p $(VIRTUAL_ENV)/lib/python3.11/site-packages - unzip /tmp/ifcopenshell_python.zip -d $(VIRTUAL_ENV)/lib/python3.11/site-packages + unzip -o -d $(VIRTUAL_ENV)/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip rm /tmp/ifcopenshell_python.zip fetch-modules: From 623faaef35bb24c2114132ac3d6480f467a2df4c Mon Sep 17 00:00:00 2001 From: Ghesselink Date: Mon, 27 Apr 2026 14:53:10 +0000 Subject: [PATCH 3/3] add syntax test --- .../fixtures/invalid_utf8_with_bom.ifc | 10 ++++++++ .../tests/tests_syntax_validation_task.py | 24 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 backend/apps/ifc_validation/fixtures/invalid_utf8_with_bom.ifc diff --git a/backend/apps/ifc_validation/fixtures/invalid_utf8_with_bom.ifc b/backend/apps/ifc_validation/fixtures/invalid_utf8_with_bom.ifc new file mode 100644 index 00000000..c7887d8d --- /dev/null +++ b/backend/apps/ifc_validation/fixtures/invalid_utf8_with_bom.ifc @@ -0,0 +1,10 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1'); +FILE_NAME('','2022-05-04T08:08:30',(''),(''),'IfcOpenShell-0.7.0','IfcOpenShell-0.7.0',''); +FILE_SCHEMA(('IFC4')); +ENDSEC; +DATA; +#1=IFCPERSON($, $,'',$,$,$,$,$); +ENDSEC; +END-ISO-10303-21; diff --git a/backend/apps/ifc_validation/tests/tests_syntax_validation_task.py b/backend/apps/ifc_validation/tests/tests_syntax_validation_task.py index 059a9fc8..68a90b7e 100644 --- a/backend/apps/ifc_validation/tests/tests_syntax_validation_task.py +++ b/backend/apps/ifc_validation/tests/tests_syntax_validation_task.py @@ -56,6 +56,30 @@ def test_syntax_validation_task_creates_error_validation_outcome(self): self.assertEqual(outcomes.first().severity, ValidationOutcome.OutcomeSeverity.ERROR) self.assertEqual(outcomes.first().outcome_code, ValidationOutcome.ValidationOutcomeCode.SYNTAX_ERROR) self.assertTrue('On line 1 column 1' in outcomes.first().observed) + + + def test_syntax_validation_task_creates_error_for_utf8_bom(self): + SyntaxValidationTaskTestCase.set_user_context() + request = ValidationRequest.objects.create( + file_name='invalid_utf8_with_bom.ifc', + file='invalid_utf8_with_bom.ifc', + size=os.path.getsize('apps/ifc_validation/fixtures/invalid_utf8_with_bom.ifc'), + ) + request.mark_as_initiated() + + syntax_validation_subtask( + prev_result={'is_valid': True, 'reason': 'test'}, + id=request.id, + file_name=request.file_name, + ) + + outcomes = ValidationOutcome.objects.filter(validation_task__request_id=request.id) + self.assertEqual(len(outcomes), 1) + self.assertEqual(outcomes.first().severity, ValidationOutcome.OutcomeSeverity.ERROR) + self.assertEqual(outcomes.first().outcome_code, ValidationOutcome.ValidationOutcomeCode.SYNTAX_ERROR) + self.assertIn("On line 1 column 1", outcomes.first().observed) + self.assertIn("character", outcomes.first().observed.lower()) + def test_determine_aggregate_status_for_multiple_outcomes(self):