charisma-cli 0.6.3__tar.gz → 0.6.4__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.6.3 → charisma_cli-0.6.4}/PKG-INFO +1 -1
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/pyproject.toml +1 -1
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/__init__.py +1 -1
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/config.py +9 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/uploader.py +7 -1
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_uploader.py +13 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/.gitignore +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/README.md +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/launch_url.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/main.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/models.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/parser.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/read_client.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/read_models.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/retry.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/subprocess_mgr.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/src/charisma_cli/watcher.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/__init__.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/conftest.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_bamboo_labels.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_cli.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_config.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_integration.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_launch_url.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_models.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_open_launch_payload.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_parser.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_read_client.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_read_client_attachments.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_read_client_integration.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_read_client_launches.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_read_client_pagination.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_read_client_results.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_read_client_single_result.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_retry.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_silent_mode.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_subprocess_mgr.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_testplan_cmd.py +0 -0
- {charisma_cli-0.6.3 → charisma_cli-0.6.4}/tests/test_watcher.py +0 -0
|
@@ -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.6.
|
|
7
|
+
__version__ = "0.6.4"
|
|
@@ -50,6 +50,8 @@ class Config:
|
|
|
50
50
|
name: str | None = None
|
|
51
51
|
tags: list[str] | None = None
|
|
52
52
|
run_key: str | None = None
|
|
53
|
+
# Charisma rerun job run this build reports for (sent on close).
|
|
54
|
+
job_run_id: str | None = None
|
|
53
55
|
|
|
54
56
|
@classmethod
|
|
55
57
|
def from_env(
|
|
@@ -117,6 +119,12 @@ class Config:
|
|
|
117
119
|
resolved_project = (project or os.getenv("CHARISMA_PROJECT_ID", "")).strip()
|
|
118
120
|
resolved_results = results or os.getenv("CHARISMA_RESULTS", "allure-results")
|
|
119
121
|
resolved_run_key = (run_key or os.getenv("CHARISMA_RUN_KEY", "")).strip() or None
|
|
122
|
+
# A Charisma-triggered rerun passes charisma_job_run_id as a Bamboo build
|
|
123
|
+
# variable, which Bamboo exposes to every task as bamboo_charisma_job_run_id,
|
|
124
|
+
# so no plan change is needed to report the close into that job run.
|
|
125
|
+
resolved_job_run_id = (
|
|
126
|
+
os.getenv("CHARISMA_JOB_RUN_ID") or os.getenv("bamboo_charisma_job_run_id") or ""
|
|
127
|
+
).strip() or None
|
|
120
128
|
resolved_component = (component or _resolve_env("COMPONENT") or "").strip() or None
|
|
121
129
|
resolved_source_url = (source_url or _resolve_env("SOURCE_URL") or "").strip() or None
|
|
122
130
|
resolved_build_plan_key = (build_plan_key or _resolve_env("BUILD_PLAN_KEY") or "").strip() or None
|
|
@@ -185,4 +193,5 @@ class Config:
|
|
|
185
193
|
name=resolved_name,
|
|
186
194
|
tags=resolved_tags,
|
|
187
195
|
run_key=resolved_run_key,
|
|
196
|
+
job_run_id=resolved_job_run_id,
|
|
188
197
|
)
|
|
@@ -460,7 +460,13 @@ class Uploader:
|
|
|
460
460
|
if self._launch_id is None:
|
|
461
461
|
return
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
payload: dict[str, object] = {}
|
|
464
|
+
if variables:
|
|
465
|
+
payload["variables"] = variables
|
|
466
|
+
if self._config.job_run_id:
|
|
467
|
+
# A rerun reports into its job run, so Charisma keeps the launch's own variables.
|
|
468
|
+
payload["jobRunId"] = self._config.job_run_id
|
|
469
|
+
body = payload or None
|
|
464
470
|
|
|
465
471
|
for attempt in range(MAX_RETRIES + 1):
|
|
466
472
|
try:
|
|
@@ -2339,3 +2339,16 @@ class TestAttachmentUploadPreservation:
|
|
|
2339
2339
|
uploader._upload_attachment(path, "rid-1")
|
|
2340
2340
|
|
|
2341
2341
|
assert calls[0][1]["display_name"] == filename
|
|
2342
|
+
|
|
2343
|
+
|
|
2344
|
+
@respx.mock
|
|
2345
|
+
def test_close_reports_the_bamboo_job_run_id(monkeypatch) -> None:
|
|
2346
|
+
"""Regression: a rerun's close carried no job-run id, so Charisma treated it as a new producer."""
|
|
2347
|
+
for k, v in {"CHARISMA_ENDPOINT": "https://charisma.test", "CHARISMA_TOKEN": "t",
|
|
2348
|
+
"CHARISMA_PROJECT_ID": "p", "bamboo_charisma_job_run_id": "jr-1"}.items():
|
|
2349
|
+
monkeypatch.setenv(k, v)
|
|
2350
|
+
route = respx.post("https://charisma.test/api/v1/launches/l-1/close").mock(return_value=httpx.Response(200))
|
|
2351
|
+
uploader = Uploader(Config.from_env(), PriorityQueue())
|
|
2352
|
+
uploader._launch_id = "l-1"
|
|
2353
|
+
uploader.close_launch(variables={"a": "b"})
|
|
2354
|
+
assert json.loads(route.calls[0].request.content) == {"variables": {"a": "b"}, "jobRunId": "jr-1"}
|
|
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
|
|
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
|