charisma-cli 0.3.1__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/.gitignore +13 -1
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/PKG-INFO +1 -1
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/pyproject.toml +1 -1
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/__init__.py +1 -1
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/config.py +14 -0
- charisma_cli-0.4.0/tests/test_bamboo_labels.py +77 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/README.md +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/launch_url.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/main.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/models.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/parser.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/retry.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/subprocess_mgr.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/uploader.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/src/charisma_cli/watcher.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/__init__.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/conftest.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_cli.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_config.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_integration.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_launch_url.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_models.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_open_launch_payload.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_parser.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_retry.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_silent_mode.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_subprocess_mgr.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_uploader.py +0 -0
- {charisma_cli-0.3.1 → charisma_cli-0.4.0}/tests/test_watcher.py +0 -0
|
@@ -65,6 +65,10 @@ venv/
|
|
|
65
65
|
# Hypothesys cache
|
|
66
66
|
.hypothesis/
|
|
67
67
|
|
|
68
|
+
# mypy incremental cache
|
|
69
|
+
.mypy_cache/
|
|
70
|
+
backend/.mypy_cache/
|
|
71
|
+
|
|
68
72
|
# Kiro hooks (auto-generated)
|
|
69
73
|
.kiro/hooks/
|
|
70
74
|
.kiro/settings/*
|
|
@@ -109,6 +113,9 @@ backend/api_integration_test_setup_scripts/
|
|
|
109
113
|
# Local test/debug scripts
|
|
110
114
|
scripts/test-ingestion-token.py
|
|
111
115
|
|
|
116
|
+
# Local-only migration verification test (run manually when migration 044 is applied; not part of the suite)
|
|
117
|
+
backend/tests/integration/test_backfill_variant_history_id_migration_local.py
|
|
118
|
+
|
|
112
119
|
# vs code settings
|
|
113
120
|
.vscode/settings.json
|
|
114
121
|
backend/integration_test_report.xml
|
|
@@ -139,4 +146,9 @@ allure-results-live/
|
|
|
139
146
|
|
|
140
147
|
# Session-specific work-state tracking (see .kiro update-work-state skill)
|
|
141
148
|
.current-task.md
|
|
142
|
-
|
|
149
|
+
|
|
150
|
+
# Local agent verdicts, RCAs, and pipeline state — never tracked in the repo
|
|
151
|
+
.agents/
|
|
152
|
+
|
|
153
|
+
# sql files for locally run DB queries
|
|
154
|
+
/*.sql
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
# is generated from pyproject.toml [project].version, so keeping this literal
|
|
5
5
|
# equal to pyproject guarantees `--version` reports the published version. The
|
|
6
6
|
# prepare-commit step owns the PATCH bump — do not hand-bump here.
|
|
7
|
-
__version__ = "0.
|
|
7
|
+
__version__ = "0.4.0"
|
|
@@ -121,6 +121,20 @@ class Config:
|
|
|
121
121
|
resolved_name = (_resolve_env("LAUNCH_NAME") or "").strip() or None
|
|
122
122
|
resolved_tags = [t.strip() for t in (_resolve_env("TAGS") or "").split(",") if t.strip()] or None
|
|
123
123
|
|
|
124
|
+
# Merge Bamboo agent labels into resolved_tags (zero-config, opportunistic).
|
|
125
|
+
# bamboo_agentLabelString is a space-separated list of CI agent labels set
|
|
126
|
+
# automatically by Bamboo. Tokens are deduplicated against any explicit TAGS.
|
|
127
|
+
bamboo_raw = os.environ.get("bamboo_agentLabelString", "").strip()
|
|
128
|
+
if bamboo_raw:
|
|
129
|
+
base = list(resolved_tags or [])
|
|
130
|
+
seen: set[str] = set(base)
|
|
131
|
+
for label in bamboo_raw.split():
|
|
132
|
+
label = label.strip()
|
|
133
|
+
if label and label not in seen:
|
|
134
|
+
base.append(label)
|
|
135
|
+
seen.add(label)
|
|
136
|
+
resolved_tags = base or None
|
|
137
|
+
|
|
124
138
|
if not resolved_endpoint:
|
|
125
139
|
raise click.UsageError(
|
|
126
140
|
"Missing required configuration: endpoint. Set CHARISMA_ENDPOINT or pass --endpoint."
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Failing tests for Bamboo agent label auto-detection in charisma-cli (T3).
|
|
2
|
+
|
|
3
|
+
RED until B4 (charisma_cli/config.py adds Bamboo detection to Config.from_env()).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import pytest
|
|
9
|
+
|
|
10
|
+
from charisma_cli.config import Config
|
|
11
|
+
|
|
12
|
+
# ---------------------------------------------------------------------------
|
|
13
|
+
# Helpers
|
|
14
|
+
# ---------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _base_env(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
18
|
+
"""Set the minimum required env vars and clear all tag-related ones."""
|
|
19
|
+
monkeypatch.setenv("CHARISMA_ENDPOINT", "https://api.example.com")
|
|
20
|
+
monkeypatch.setenv("CHARISMA_TOKEN", "tok")
|
|
21
|
+
monkeypatch.setenv("CHARISMA_PROJECT_ID", "proj")
|
|
22
|
+
monkeypatch.delenv("TAGS", raising=False)
|
|
23
|
+
monkeypatch.delenv("CHARISMA_TAGS", raising=False)
|
|
24
|
+
monkeypatch.delenv("bamboo_agentLabelString", raising=False)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# ---------------------------------------------------------------------------
|
|
28
|
+
# T3 — Config.from_env() Bamboo detection
|
|
29
|
+
# ---------------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class TestBambooLabels:
|
|
33
|
+
"""Config.from_env() merges bamboo_agentLabelString into tags."""
|
|
34
|
+
|
|
35
|
+
def test_bamboo_labels_set_when_only_bamboo_env_present(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
36
|
+
"""bamboo_agentLabelString tokens become config.tags when no TAGS env is set."""
|
|
37
|
+
_base_env(monkeypatch)
|
|
38
|
+
monkeypatch.setenv("bamboo_agentLabelString", "linux docker aws")
|
|
39
|
+
config = Config.from_env()
|
|
40
|
+
assert config.tags == ["linux", "docker", "aws"]
|
|
41
|
+
|
|
42
|
+
def test_bamboo_labels_merged_with_existing_tags(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
43
|
+
"""Explicit TAGS come first; Bamboo labels are appended after."""
|
|
44
|
+
_base_env(monkeypatch)
|
|
45
|
+
monkeypatch.setenv("TAGS", "nightly")
|
|
46
|
+
monkeypatch.setenv("bamboo_agentLabelString", "linux docker")
|
|
47
|
+
config = Config.from_env()
|
|
48
|
+
assert config.tags == ["nightly", "linux", "docker"]
|
|
49
|
+
|
|
50
|
+
def test_bamboo_labels_deduplicated_against_existing_tags(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
51
|
+
"""A Bamboo label already present in TAGS is NOT appended again."""
|
|
52
|
+
_base_env(monkeypatch)
|
|
53
|
+
monkeypatch.setenv("TAGS", "linux")
|
|
54
|
+
monkeypatch.setenv("bamboo_agentLabelString", "linux docker")
|
|
55
|
+
config = Config.from_env()
|
|
56
|
+
assert config.tags == ["linux", "docker"]
|
|
57
|
+
assert config.tags.count("linux") == 1
|
|
58
|
+
|
|
59
|
+
def test_no_change_when_bamboo_env_absent(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
60
|
+
"""Config.tags stays as resolved from TAGS when bamboo_agentLabelString is absent."""
|
|
61
|
+
_base_env(monkeypatch)
|
|
62
|
+
monkeypatch.setenv("TAGS", "nightly")
|
|
63
|
+
config = Config.from_env()
|
|
64
|
+
assert config.tags == ["nightly"]
|
|
65
|
+
|
|
66
|
+
def test_bamboo_blank_string_yields_no_extra_tags(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
67
|
+
"""Empty bamboo_agentLabelString does not add any tags; config.tags stays None."""
|
|
68
|
+
_base_env(monkeypatch)
|
|
69
|
+
monkeypatch.setenv("bamboo_agentLabelString", "")
|
|
70
|
+
config = Config.from_env()
|
|
71
|
+
assert config.tags is None
|
|
72
|
+
|
|
73
|
+
def test_tags_none_when_both_absent(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
74
|
+
"""No TAGS env and no bamboo_agentLabelString → config.tags is None (existing behaviour)."""
|
|
75
|
+
_base_env(monkeypatch)
|
|
76
|
+
config = Config.from_env()
|
|
77
|
+
assert config.tags is None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|