• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uc-cdis / indexd / 25189645180

30 Apr 2026 09:13PM UTC coverage: 87.432% (+0.08%) from 87.353%
25189645180

Pull #441

github

web-flow
Merge 73bd004c0 into f8372f13b
Pull Request #441: Feat/drs 1.5

3075 of 3517 relevant lines covered (87.43%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
indexd/default_settings.py
1
from .index.drivers.alchemy import SQLAlchemyIndexDriver
1✔
2
from .alias.drivers.alchemy import SQLAlchemyAliasDriver
1✔
3
from .auth.drivers.alchemy import SQLAlchemyAuthDriver
1✔
4
from .index.drivers.single_table_alchemy import SingleTableSQLAlchemyIndexDriver
1✔
5
from os import environ
1✔
6
import json
1✔
7

8

9
CONFIG = {}
1✔
10

11
CONFIG["JSONIFY_PRETTYPRINT_REGULAR"] = False
1✔
12
AUTO_MIGRATE = True
1✔
13
# Key to lock the database during migrations
14
CONFIG["DB_MIGRATION_POSTGRES_LOCK_KEY"] = 100
1✔
15

16
USE_SINGLE_TABLE = False
1✔
17

18
# - DEFAULT_PREFIX: prefix to be prepended.
19
# - PREPEND_PREFIX: the prefix is preprended to the generated GUID when a
20
#   new record is created WITHOUT a provided GUID.
21
# - ADD_PREFIX_ALIAS: aliases are created for new records - "<PREFIX><GUID>".
22
# Do NOT set both ADD_PREFIX_ALIAS and PREPEND_PREFIX to True, or aliases
23
# will be created as "<PREFIX><PREFIX><GUID>".
24
if USE_SINGLE_TABLE is True:
1✔
25
    CONFIG["INDEX"] = {
×
26
        "driver": SingleTableSQLAlchemyIndexDriver(
27
            "postgresql://postgres:postgres@localhost:5432/indexd_tests",  # pragma: allowlist secret
28
            echo=True,
29
            index_config={
30
                "DEFAULT_PREFIX": "testprefix/",
31
                "PREPEND_PREFIX": True,
32
                "ADD_PREFIX_ALIAS": False,
33
            },
34
        )
35
    }
36
else:
37
    CONFIG["INDEX"] = {
1✔
38
        "driver": SQLAlchemyIndexDriver(
39
            "postgresql://postgres:postgres@localhost:5432/indexd_tests",  # pragma: allowlist secret
40
            echo=True,
41
            index_config={
42
                "DEFAULT_PREFIX": "testprefix/",
43
                "PREPEND_PREFIX": True,
44
                "ADD_PREFIX_ALIAS": False,
45
            },
46
        )
47
    }
48

49
CONFIG["ALIAS"] = {
1✔
50
    "driver": SQLAlchemyAliasDriver(
51
        "postgresql://postgres:postgres@localhost:5432/indexd_tests",  # pragma: allowlist secret
52
        echo=True,
53
    )
54
}
55

56

57
CONFIG["DIST"] = [
1✔
58
    {
59
        "name": "Other IndexD",
60
        "host": "https://indexd.example.io/index/",
61
        "hints": [".*ROCKS.*"],
62
        "type": "indexd",
63
    },
64
    {"name": "DX DOI", "host": "https://doi.org/", "hints": ["10\..*"], "type": "doi"},
65
    {
66
        "name": "DOS System",
67
        "host": "https://example.com/api/ga4gh/dos/v1/",
68
        "hints": [],
69
        "type": "dos",
70
    },
71
]
72

73
# Maximum number of objects in a single bulk DRS request.
74
# Used in GET /service-info response and enforced by bulk endpoints.
75
CONFIG["MAX_BULK_REQUEST_LENGTH"] = 100
1✔
76

77
CONFIG["DRS_SERVICE_INFO"] = {
1✔
78
    "name": "DRS System",
79
    "type": {
80
        "group": "org.ga4gh",
81
        "artifact": "drs",
82
        "version": "1.5.0",
83
    },
84
    "version": "1.5.0",
85
    "id": "com.example",
86
    "organization": {
87
        "name": "CTDS",
88
        "url": "http://example.com/",
89
    },
90
}
91

92
cloud_provider_map = environ.get("CLOUD_PROVIDER_MAP", None)
1✔
93
if cloud_provider_map:
1✔
94
    CONFIG["CLOUD_PROVIDER_MAP"] = json.loads(cloud_provider_map)
×
95
else:
96
    CONFIG["CLOUD_PROVIDER_MAP"] = {
1✔
97
        "s3": "aws",
98
        "gs": "gcp",
99
        "az": "azure",
100
    }
101

102
AUTH = SQLAlchemyAuthDriver(
1✔
103
    "postgresql://postgres:postgres@localhost:5432/indexd_tests"  # pragma: allowlist secret
104
)
105

106
settings = {"config": CONFIG, "auth": AUTH, "use_single_table": USE_SINGLE_TABLE}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc