diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index 1a5fca02..efd19e6c 100644 --- a/.github/workflows/build_and_push.yaml +++ b/.github/workflows/build_and_push.yaml @@ -15,7 +15,7 @@ jobs: build: name: "Build and Push Application Container Images" - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: matrix: include: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a56008e7..f1c9c41d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: ./.github/workflows/rebase_checker.yaml lint: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest needs: - rebase-checker steps: @@ -36,7 +36,7 @@ jobs: uses: pre-commit/action@v3.0.1 mypy: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: matrix: python-version: ["3.11"] @@ -60,7 +60,7 @@ jobs: run: uv run make typing test: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: matrix: python-version: ["3.11"] diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5f429dcf..6efbf8ec 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ env: jobs: release: - runs-on: ubuntu-24.04-arm + runs-on: ubuntu-latest timeout-minutes: 10 if: >- github.event_name == 'pull_request' diff --git a/src/lsst/cmservice/common/butler.py b/src/lsst/cmservice/common/butler.py index a359a12c..5ebdab8b 100644 --- a/src/lsst/cmservice/common/butler.py +++ b/src/lsst/cmservice/common/butler.py @@ -8,6 +8,7 @@ from lsst.daf.butler import Butler, ButlerConfig, ButlerRepoIndex from lsst.daf.butler._exceptions import MissingCollectionError +from lsst.resources import ResourcePathExpression from lsst.utils.db_auth import DbAuth from ..config import config @@ -30,7 +31,7 @@ async def get_butler_config(repo: str, *, without_datastore: bool = False) -> Bu """ try: - repo_uri = BUTLER_REPO_INDEX.get_repo_uri(label=repo) + repo_uri: ResourcePathExpression = BUTLER_REPO_INDEX.get_repo_uri(label=repo) except KeyError: # No such repo known to the service logger.warning("Butler repo %s not known to environment.", repo) diff --git a/src/lsst/cmservice/config.py b/src/lsst/cmservice/config.py index 1b416ccd..c7048af7 100644 --- a/src/lsst/cmservice/config.py +++ b/src/lsst/cmservice/config.py @@ -76,11 +76,6 @@ class ButlerConfiguration(BaseModel): default="rubin", ) - access_token: str | None = Field( - description=("Gafaelfawr access token used to authenticate to a Butler server."), - default=None, - ) - mock: bool = Field( description="Whether to mock out Butler calls.", default=False, diff --git a/tests/common/test_butler.py b/tests/common/test_butler.py index 402a0e2c..2294d5ee 100644 --- a/tests/common/test_butler.py +++ b/tests/common/test_butler.py @@ -1,8 +1,9 @@ +import json from typing import Any import pytest -from lsst.cmservice.common.butler import get_butler_config, parse_butler_repos_from_environment +from lsst.cmservice.common.butler import get_butler_config from lsst.cmservice.config import config from lsst.daf.butler.registry import RegistryConfig @@ -31,13 +32,12 @@ def mock_butler_environment(tmp_path: Any, monkeypatch: Any) -> None: """ repo_mockgres_butler_yaml.write_text(repo_yaml) - monkeypatch.setenv("BUTLER__REPO__0__NAME", "/repo/mock") - monkeypatch.setenv("BUTLER__REPO__0__URI", f"{repo_mock_path}") - monkeypatch.setenv("BUTLER__REPO__1__NAME", "/repo/mockgres") - monkeypatch.setenv("BUTLER__REPO__1__URI", f"{repo_mockgres_butler_yaml}") - monkeypatch.setenv("BUTLER__REPO__2__NAME", "mockbargo") - monkeypatch.setenv("BUTLER__REPO__2__URI", "s3://bucket/prefix/object.yaml") - monkeypatch.setenv("BUTLER__REPO__3__NAME", "nosuchrepo") + daf_butler_repositories = { + "/repo/mock": f"{repo_mock_path}", + "/repo/mockgres": f"{repo_mockgres_butler_yaml}", + "mockbargo": "s3://bucket/prefix/object.yaml", + } + monkeypatch.setenv("DAF_BUTLER_REPOSITORIES", json.dumps(daf_butler_repositories)) @pytest.fixture @@ -52,11 +52,6 @@ def mock_db_auth_file(tmp_path: Any, monkeypatch: Any) -> None: monkeypatch.setattr(config.butler, "authentication_file", str(mock_auth_path)) -def test_parse_butler_config_from_environment(mock_butler_environment: Any) -> None: - repos = parse_butler_repos_from_environment() - assert len(repos.keys()) == 3 - - @pytest.mark.asyncio async def test_butler_creation_without_db_auth_file(mock_butler_environment: Any) -> None: bc = await get_butler_config("/repo/mock", without_datastore=True)