-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
35 lines (26 loc) · 983 Bytes
/
config.py
File metadata and controls
35 lines (26 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
from functools import lru_cache
import yaml
@lru_cache(maxsize=1)
def load_config(path="config.yml"):
"""Load configuration data from ``path`` and cache the result."""
with open(path, "r") as f:
return yaml.safe_load(f)
def get_platforms():
"""Return platform configuration from the cached config."""
config = load_config()
return config.get("platforms", [])
def get_linear_team_key():
"""Return the Linear team key used for issue/project queries."""
config = load_config()
return config.get("linear_team_key") or os.getenv("LINEAR_TEAM_KEY") or "APO"
def get_github_orgs():
"""Return the GitHub orgs to include when aggregating PR activity."""
config = load_config()
orgs = config.get("github_orgs")
if orgs:
return orgs
env_orgs = os.getenv("GITHUB_ORGS")
if env_orgs:
return [org.strip() for org in env_orgs.split(",") if org.strip()]
return ["apollosproject", "differential"]