Skip to content
rlsbl.tag_glob
On this page

Shared git tag-glob resolution for monorepo projects and releasables, deriving tag match patterns from releasable tag_format or detected target.

#rlsbl.tag_glob

#rlsbl.tag_glob

Shared git tag-glob resolution for monorepo projects and releasables.

A single source of truth for deriving the git tag match pattern of a monorepo project. Two code paths previously derived this independently (rlsbl monorepo status and rlsbl status), and one of them ignored the releasable's tag_format -- so releasable members reported no tag. Both now call :func:resolve_monorepo_tag_glob.

#TagMode

Whether :func:parse_version_tag accepts prerelease tags.

FINAL_ONLY rejects any tag carrying a prerelease suffix (v1.2.3-rc.1) -- used by call sites that count or match final releases only. PRERELEASE_INCLUSIVE accepts both final and prerelease tags. There is no default: every call site must state its semantics explicitly so the mode can never silently flip.

#TagVersion

Result of parsing a git tag into a version.

Attributes:

  • version: the x.y.z (optionally -prerelease) string, no v.
  • scheme: which tag scheme matched -- "standalone" (v1.2.3),

"monorepo" (name@v1.2.3), or "path" (path/v1.2.3).

#parse_version_tag

python
def parse_version_tag(tag: str, *, mode: 'TagMode') -> 'TagVersion | None'

Parse a git tag into a :class:TagVersion, or None if it is not a version tag under any known scheme.

Recognizes three schemes, matched against the whole tag (strict):

  • standalone: v1.2.3
  • monorepo: name@v1.2.3
  • Go path-style: some/path/v1.2.3

The version core must be strict semver (x.y.z); milestone-like tags (latest, milestone-3), partial versions (v1.2), and tags with no scheme separator before v are rejected. mode is required and controls whether a prerelease suffix is accepted:

  • :attr:TagMode.FINAL_ONLY -- v1.2.3-rc.1 is rejected (returns None).
  • :attr:TagMode.PRERELEASE_INCLUSIVE -- v1.2.3-rc.1 yields 1.2.3-rc.1.

#releasable_tag_glob

python
def releasable_tag_glob(tag_format: str, releasable_name: str) -> str

Derive a glob from a releasable's tag_format.

Replaces {version} with * and fills in {name} with the literal releasable name so git tag -l matches all versions (e.g. "{name}@v{version}" -> "www@v*").

#_target_tag_scheme

python
def _target_tag_scheme(target, name, path)

Classify a target's monorepo tag scheme.

Returns "at" for the {name}@v* scheme (base default, used by all targets except Go) or "path" for the {path}/v* scheme (Go's path-based module-proxy tags). Classification is derived from the target's own monorepo_tag_glob output so it stays correct if new targets adopt a path-based scheme.

#_mixed_tag_schemes

python
def _mixed_tag_schemes(target_entries, name, path)

Group a member's targets by tag scheme.

Returns a dict {scheme: [target_name, ...]} when the member's targets span more than one tag scheme (the mixed-scheme hazard), otherwise None. Only targets present in TARGETS are considered.

#derive_releasable_tag_format

python
def derive_releasable_tag_format(target_entries, name, path, *, subject)

The tag format an auto-singleton releasable is created with.

Derived from the member's PRIMARY target's monorepo scheme and returned literally: {name}@v{version} for every target but Go, and the Go module proxy's <path>/v{version} for Go. A member whose targets span BOTH schemes has no single answer, so it is a refusal naming --tag-format rather than a silent pick of whichever target was detected first.

Both commands that create a releasable from a member -- monorepo add and monorepo absorb -- derive through here, so the format a member's targets imply is one fact with one answer.

Args:

  • target_entries: the member's detected (or declared) TargetEntry list.
  • name: the releasable's name, which fills {name} in the @-scheme.
  • path: the member's repo-relative path, which the Go path-scheme tags under.
  • subject: how the refusal names what declared the mixed targets

(e.g. "member dir 'packages/widget'").

Raises:

  • MixedTagSchemeError: the member's targets span both tag schemes.

#_mixed_scheme_error

python
def _mixed_scheme_error(project_path, mixed)

Build the hard-error message for a mixed-tag-scheme member dir.

#resolve_monorepo_tag_glob

python
def resolve_monorepo_tag_glob(project, workspace_root, releasable=None) -> str

Return the git tag glob for a monorepo project.

When the project belongs to a releasable (explicit mode), the glob is derived from the releasable's tag_format -- this is the fix for releasable members previously falling back to the per-member target glob and reporting no tag. Otherwise the glob comes from the project's first detected target's monorepo_tag_glob, or "{name}@v*" when no target is detected.

Args:

  • project: a WorkspaceProject or dict with name/path.
  • workspace_root: path to the monorepo root (str or Path).
  • releasable: optional Releasable the project belongs to; when provided,

its tag_format drives the glob.

More tools from this site

  • claudestream Drive Claude Code from Python: run it as a subprocess and read its output as typed events, with async and sync sessions, sandbox policies, and tools you define in Python
  • claudewheel A TUI Claude Code Launcher that lets you have more than one profile, manage sessions lifecycle, pick the exact CC version, model to use (even older unlisted ones), pick which GitHub account to use, etc.
  • dirstat Fast, single-binary directory statistics CLI: every file under a tree grouped by format, with counts, sizes, and lines of code, as a colored terminal table or as JSON
  • fastware A batteries-included ASGI framework: msgspec JSON, a managed Granian server, dependency injection, SSE, WebSockets, auth, and a test client
  • go-toml-edit Zero-dep TOML editing library for Go with comment preservation
  • howmuchleft The fastest Claude Code statusline: context window, 5-hour, and weekly limit usage as three customizable gradient bars, rendering in about 6 ms
  • orxtra
  • pgdesign
  • predraw Declarative rendering pipeline: describe a scene in JSON and get SVG, PNG and WebP out, with light and dark style tokens, reusable components and text converted to path outlines
  • reposummary Turn a git repository's history into a Markdown journal: pick a time window or revision range and get a readable digest of what changed, optionally narrated by an LLM
  • safegit git wrapper CLI that gives each commit its own temporary index and retries ref updates on conflict, so concurrent agents share one repository
  • saferm Command-line replacement for rm that archives every deletion with a mandatory reason and the context it ran in, so deleted files can be listed, inspected and restored
  • selfdoc Static Site Generator that builds a project's documentation site directly from its source code, so the docs can never drift from the code they describe, with SEO/AEO, first-class blog, search, and cross-project linking built in
  • strictcli
  • stricttest An always-on test-isolation floor: a pytest plugin and a Go env-hygiene module that make a test suite structurally unable to reach real credentials, the real HOME, the network, or the development repository.
  • wesktop A Python framework that turns an ASGI web app into a desktop application, serving it from a local Granian server and displaying it in a native OS window via pywebview
Search