Public Access
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27fd99a091 | ||
|
|
e3fa9b7c95 | ||
|
|
ce60356542 |
@@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [0.29.1] - 2026-07-01
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Strip task ID prefix from commit messages in extract_conventional_msg
|
||||||
|
|
||||||
## [0.29.0] - 2026-07-01
|
## [0.29.0] - 2026-07-01
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ quality badges.
|
|||||||
|
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/src/branch/master/LICENSE)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/src/branch/master/LICENSE)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/wiki)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/wiki)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/releases)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/releases)
|
||||||
[](https://www.python.org/downloads/)
|
[](https://www.python.org/downloads/)
|
||||||
|
|
||||||
## Why devx?
|
## Why devx?
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -12,12 +12,12 @@ project to be reusable across all oblachno-oss repositories.
|
|||||||
|
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/src/branch/master/LICENSE)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/src/branch/master/LICENSE)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/wiki)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/wiki)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/releases)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/releases)
|
||||||
[](https://www.python.org/downloads/)
|
[](https://www.python.org/downloads/)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
"""devx — reusable development and CI/CD tools for oblachno-oss projects."""
|
"""devx — reusable development and CI/CD tools for oblachno-oss projects."""
|
||||||
|
|
||||||
__version__ = "0.29.0"
|
__version__ = "0.29.1"
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ from devx.config import (
|
|||||||
from devx.exceptions import APIError
|
from devx.exceptions import APIError
|
||||||
from devx.i18n import _
|
from devx.i18n import _
|
||||||
|
|
||||||
|
# Strip leading task ID prefix (e.g. "DEVX-12: " or "OBL-INFRA-364: ") from commit subjects.
|
||||||
|
_TASK_ID_PREFIX_RE = re.compile(rf"^{TASK_PREFIX}-\d+:\s*")
|
||||||
|
|
||||||
TASKID_FILE = ".taskid" # Deprecated, kept for backward-compat warnings
|
TASKID_FILE = ".taskid" # Deprecated, kept for backward-compat warnings
|
||||||
PR_TITLE_RE = re.compile(rf"^{TASK_PREFIX}-\d+:\s+.+")
|
PR_TITLE_RE = re.compile(rf"^{TASK_PREFIX}-\d+:\s+.+")
|
||||||
|
|
||||||
@@ -168,19 +171,23 @@ def extract_conventional_msg(commits: list[dict[str, Any]]) -> str:
|
|||||||
for commit in reversed(commits):
|
for commit in reversed(commits):
|
||||||
commit_info = commit.get("commit", {})
|
commit_info = commit.get("commit", {})
|
||||||
message = str(commit_info.get("message", "") if isinstance(commit_info, dict) else "").split("\n")[0]
|
message = str(commit_info.get("message", "") if isinstance(commit_info, dict) else "").split("\n")[0]
|
||||||
m = CONVENTIONAL_RE.match(message)
|
# Strip any leading task ID prefix (e.g. "OBL-INFRA-364: fix: ...") so
|
||||||
|
# conventional commit matching works on the remainder.
|
||||||
|
stripped = _TASK_ID_PREFIX_RE.sub("", message)
|
||||||
|
m = CONVENTIONAL_RE.match(stripped)
|
||||||
if m:
|
if m:
|
||||||
prefix = m.group(1).split("(")[0].strip() # e.g. "feat" from "feat(scope)"
|
prefix = m.group(1).split("(")[0].strip() # e.g. "feat" from "feat(scope)"
|
||||||
score = priority.get(prefix, 0)
|
score = priority.get(prefix, 0)
|
||||||
if score > best_score:
|
if score > best_score:
|
||||||
best_score = score
|
best_score = score
|
||||||
best_msg = message
|
best_msg = stripped
|
||||||
if best_msg:
|
if best_msg:
|
||||||
return best_msg
|
return best_msg
|
||||||
# Fallback: use the newest commit's first line
|
# Fallback: use the newest commit's first line (strip task ID prefix if present)
|
||||||
if commits:
|
if commits:
|
||||||
commit_info = commits[-1].get("commit", {})
|
commit_info = commits[-1].get("commit", {})
|
||||||
return str(commit_info.get("message", "") if isinstance(commit_info, dict) else "").split("\n")[0]
|
raw = str(commit_info.get("message", "") if isinstance(commit_info, dict) else "").split("\n")[0]
|
||||||
|
return _TASK_ID_PREFIX_RE.sub("", raw)
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -218,6 +218,20 @@ class TestExtractConventionalMsg:
|
|||||||
]
|
]
|
||||||
assert extract_conventional_msg(commits) == "feat(api): add endpoint"
|
assert extract_conventional_msg(commits) == "feat(api): add endpoint"
|
||||||
|
|
||||||
|
def test_strips_task_id_prefix(self) -> None:
|
||||||
|
"""Commit messages with a task ID prefix should have it stripped."""
|
||||||
|
commits = [
|
||||||
|
{"commit": {"message": "DEVX-12: fix: resolve timeout"}},
|
||||||
|
]
|
||||||
|
assert extract_conventional_msg(commits) == "fix: resolve timeout"
|
||||||
|
|
||||||
|
def test_strips_task_id_prefix_fallback(self) -> None:
|
||||||
|
"""Fallback to newest commit should also strip task ID prefix."""
|
||||||
|
commits = [
|
||||||
|
{"commit": {"message": "DEVX-12: random message"}},
|
||||||
|
]
|
||||||
|
assert extract_conventional_msg(commits) == "random message"
|
||||||
|
|
||||||
|
|
||||||
# -- run_cmd --
|
# -- run_cmd --
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user