Skip to content

Commit

Permalink
merge with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Aug 29, 2024
2 parents 1583804 + 66f7b31 commit 4ef2cb4
Show file tree
Hide file tree
Showing 55 changed files with 40,960 additions and 1,427 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- name: 🔗 Install wget for Windows
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -57,13 +58,16 @@ jobs:
run: bash ./package_antares_web.sh
working-directory: scripts

- name: 📜 Install changelog requirements
run: npm install -g auto-changelog
- name: Add installer to package
shell: bash
run: |
pip install hatch
./package_antares_installer.sh
working-directory: scripts

- name: 📜️ Generate changelog file
- name: 📜️ Copy changelog file
run: |
auto-changelog -l false --hide-empty-releases
mv CHANGELOG.md dist/package/CHANGELOG.md
cp docs/CHANGELOG.md dist/package/CHANGELOG.md
- name: 📦 Archive Antares Desktop for Windows
if: matrix.os == 'windows-latest'
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "installer"]
path = installer
url = https://github.com/AntaresSimulatorTeam/antares-web-installer.git
19 changes: 19 additions & 0 deletions antarest/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,20 @@ def __str__(self) -> str:
return self.detail


class OutputSubFolderNotFound(HTTPException):
"""
Exception raised when an output sub folders do not exist
"""

def __init__(self, output_id: str, mc_root: str) -> None:
message = f"The output '{output_id}' sub-folder '{mc_root}' does not exist"
super().__init__(HTTPStatus.NOT_FOUND, message)

def __str__(self) -> str:
"""Return a string representation of the exception."""
return self.detail


class BadZipBinary(HTTPException):
def __init__(self, message: str) -> None:
super().__init__(HTTPStatus.UNSUPPORTED_MEDIA_TYPE, message)
Expand Down Expand Up @@ -446,6 +460,11 @@ def __init__(self, message: str) -> None:
super().__init__(HTTPStatus.UNPROCESSABLE_ENTITY, message)


class MCRootNotHandled(HTTPException):
def __init__(self, message: str) -> None:
super().__init__(HTTPStatus.UNPROCESSABLE_ENTITY, message)


class MatrixWidthMismatchError(HTTPException):
def __init__(self, message: str) -> None:
super().__init__(HTTPStatus.UNPROCESSABLE_ENTITY, message)
Expand Down
8 changes: 2 additions & 6 deletions antarest/launcher/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import os
import shutil
from datetime import datetime, timedelta
from datetime import datetime
from http import HTTPStatus
from pathlib import Path
from typing import Dict, List, Optional, cast
Expand Down Expand Up @@ -59,7 +59,6 @@ def __init__(self, engine: str):
)


ORPHAN_JOBS_VISIBILITY_THRESHOLD = 10 # days
LAUNCHER_PARAM_NAME_SUFFIX = "output_suffix"
EXECUTION_INFO_FILE = "execution_info.ini"

Expand Down Expand Up @@ -305,7 +304,6 @@ def _filter_from_user_permission(self, job_results: List[JobResult], user: Optio
if not user:
return []

orphan_visibility_threshold = datetime.utcnow() - timedelta(days=ORPHAN_JOBS_VISIBILITY_THRESHOLD)
allowed_job_results = []

study_ids = [job_result.study_id for job_result in job_results]
Expand All @@ -330,9 +328,7 @@ def _filter_from_user_permission(self, job_results: List[JobResult], user: Optio
raising=False,
):
allowed_job_results.append(job_result)
elif (
user and (user.is_site_admin() or user.is_admin_token())
) or job_result.creation_date >= orphan_visibility_threshold:
elif user and (user.is_site_admin() or user.is_admin_token()):
allowed_job_results.append(job_result)
return allowed_job_results

Expand Down
Loading

0 comments on commit 4ef2cb4

Please sign in to comment.