GRM-51: fix: release pipeline determinism with lock, rebase, and consistent classification
This commit is contained in:
@@ -176,7 +176,13 @@ def get_latest_tag() -> str:
|
||||
@click.option("--base", default=None, help="Base ref (default: latest tag).")
|
||||
@click.option("--head", default="HEAD", help="Head ref (default: HEAD).")
|
||||
@click.option("--quiet", is_flag=True, default=False, help="Only output true/false.")
|
||||
def main(base: str | None, head: str, quiet: bool) -> None:
|
||||
@click.option(
|
||||
"--check",
|
||||
type=click.Choice(["all", "ansible", "user-facing"]),
|
||||
default="all",
|
||||
help="Check specific category: all (default), ansible, or user-facing.",
|
||||
)
|
||||
def main(base: str | None, head: str, quiet: bool, check: str) -> None:
|
||||
if base is None:
|
||||
base = get_latest_tag()
|
||||
if not base:
|
||||
@@ -194,6 +200,34 @@ def main(base: str | None, head: str, quiet: bool) -> None:
|
||||
click.echo(_("No changes between {base} and {head}.", base=base, head=head))
|
||||
return
|
||||
|
||||
if check == "ansible":
|
||||
# Check only for Ansible-related file changes
|
||||
ansible_files = [f for f in files if f.startswith("ansible/") or f == ".ansible-lint"]
|
||||
has_ansible = bool(ansible_files)
|
||||
if quiet:
|
||||
click.echo("true" if has_ansible else "false")
|
||||
return
|
||||
click.echo(_("\nAnsible files changed ({count}):", count=len(ansible_files)))
|
||||
for f in ansible_files:
|
||||
click.echo(f" {f}")
|
||||
click.echo(_("\nResult: {status}", status="Ansible changes detected" if has_ansible else "No Ansible changes"))
|
||||
return
|
||||
|
||||
if check == "user-facing":
|
||||
# Check only for user-facing file changes (inverse of workflow-only)
|
||||
user_files = [f for f in files if is_user_facing(f)]
|
||||
has_user = bool(user_files)
|
||||
if quiet:
|
||||
click.echo("true" if has_user else "false")
|
||||
return
|
||||
click.echo(_("\nUser-facing files changed ({count}):", count=len(user_files)))
|
||||
for f in user_files:
|
||||
click.echo(f" {f}")
|
||||
click.echo(
|
||||
_("\nResult: {status}", status="User-facing changes detected" if has_user else "No user-facing changes")
|
||||
)
|
||||
return
|
||||
|
||||
result = classify_changes(files)
|
||||
has_user = bool(result["user_facing"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user