diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 894ab6a5..1738df2f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,6 +40,15 @@ jobs: run: make install - name: Run tests run: bin/test.sh + - name: Run retry + env: + JBI_API_KEY: key # pragma: allowlist secret + JIRA_API_KEY: key # pragma: allowlist secret + JIRA_USERNAME: foo@bar + BUGZILLA_API_KEY: key # pragma: allowlist secret + DL_QUEUE_CONSTANT_RETRY: false + DL_QUEUE_DSN: "file:///tmp/dlqueue" + run: .venv/bin/python -m jbi.retry review-dependabot-pr: permissions: contents: write diff --git a/jbi/app.py b/jbi/app.py index 8e777236..372e3665 100644 --- a/jbi/app.py +++ b/jbi/app.py @@ -32,7 +32,7 @@ APP_DIR = Path(__file__).parents[1] settings = get_settings() -version_info = get_version(APP_DIR) +version_info: dict[str, str] = get_version(APP_DIR) VERSION: str = version_info["version"] logging.config.dictConfig(CONFIG) diff --git a/jbi/queue.py b/jbi/queue.py index 35049108..a13913ac 100644 --- a/jbi/queue.py +++ b/jbi/queue.py @@ -28,7 +28,7 @@ import traceback from abc import ABC, abstractmethod from datetime import datetime -from functools import lru_cache +from functools import cached_property, lru_cache from json import JSONDecodeError from pathlib import Path from typing import AsyncIterator, Optional @@ -37,7 +37,7 @@ import dockerflow.checks from pydantic import BaseModel, FileUrl, ValidationError, computed_field -from jbi import app, bugzilla +from jbi import bugzilla from jbi.environment import get_settings logger = logging.getLogger(__name__) @@ -90,9 +90,11 @@ class QueueItem(BaseModel, frozen=True): rid: Optional[str] = None @computed_field # type: ignore - @property + @cached_property def version(self) -> str: # Prevents circular imports. + from jbi import app + return app.VERSION @property