rlsbl v0.92.0 /rlsbl.commands.pre_push_check
On this page

Pre-push-check command that enforces JSONL commit coverage and warns on manual release-branch pushes, using git_util for monorepo-aware file filtering.

#rlsbl.commands.pre_push_check

#rlsbl.commands.pre_push_check

Pre-push check helpers used by the strictcli check system.

The rlsbl pre-push-check command was removed. These functions are kept because rlsbl/checks/prepush.py imports them for the prepush check implementations.

#_get_release_branches

python
def _get_release_branches(ctx)

Return the configured release-branch list.

Reads release_branches from .rlsbl/config.json if present; falls back to ["main", "master"] when the key is absent.

Raises :class:ValueError if the key is present but malformed (empty list or non-list value). An empty list would silently disable the manual-release-push warning, which is almost never what the user wants; require explicit removal of the key instead.

#_check_gitignore_guard

python
def _check_gitignore_guard(dir_path, *, extra_paths=None)

Check that rlsbl-managed files are not gitignored.

When extra_paths is provided, those paths are also checked (e.g., releasable-level changes files in explicit monorepo mode).

Returns an error string listing gitignored paths, or None if all clear.

#_check_jsonl_changelog

python
def _check_jsonl_changelog(dir_path, refs, pushed_commits=None, *, changes_dir=None)

Check JSONL changelog coverage for commits being pushed.

Verifies that every commit in the push range exists in at least one unreleased.jsonl entry's commits list.

When pushed_commits is provided, uses that set directly instead of calling _get_pushed_commits(refs). This allows callers (e.g. monorepo check) to pass a pre-filtered set of commits.

When changes_dir is provided, uses that directory instead of computing it from dir_path. This supports explicit releasable mode where the changes directory lives at the releasable level, not per-project.

Returns None on success, or an error message string on failure.

#_get_pushed_commits

python
def _get_pushed_commits(refs)

Get the set of commit SHAs being pushed.

Returns a set of full 40-char SHAs, or None on error.

#_read_stdin_lines

python
def _read_stdin_lines()

Read raw pre-push hook stdin lines.

Returns a list of non-empty lines, or None if stdin is not readable or empty.

#_parse_stdin_refs

python
def _parse_stdin_refs(stdin_lines=None)

Parse pre-push hook stdin to extract (local_sha, remote_sha) pairs.

Each line is:

When stdin_lines is provided (a list of raw lines), parses those directly instead of reading stdin. When omitted, reads stdin via _read_stdin_lines().

Returns a list of (local_sha, remote_sha) tuples, or None if the input is empty or unreadable.