Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- "3.11"
- "3.12"
- "3.13"
- "3.14"

steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -36,14 +37,15 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: "0.6.16"
version: "0.10.4"
python-version: "${{ matrix.python-version }}"

- name: Install project
run: uv sync --locked --dev

- run: uv run ruff check --output-format=github .
- run: uv run ruff format --check .
- run: uv run ty check
- run: uv run pyright
- run: uv run pytest
- run: uv build
15 changes: 8 additions & 7 deletions release-pr/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "neon-release-pr"
version = "0.2.3"
version = "0.3.0"
description = "CLI to help with neon release PRs."
readme = "README.md"
authors = [
Expand All @@ -9,20 +9,21 @@ authors = [
# 3.10 is required for ubuntu-22.04
requires-python = ">=3.10"
dependencies = [
"rich>=14.0.0",
"typer-slim>=0.16.0",
"rich>=14.2.0",
"typer-slim>=0.20.0",
]

[project.scripts]
neon-release-pr = "neon_release_pr.cli:app"

[build-system]
requires = ["uv_build>=0.8.3,<0.9"]
requires = ["uv_build>=0.10.4,<0.11"]
build-backend = "uv_build"

[dependency-groups]
dev = [
"pyright>=1.1.399",
"pytest>=8.3.5",
"ruff>=0.11.6",
"pyright>=1.1.407",
"pytest>=9.0.1",
"ruff>=0.14.6",
"ty>=0.0.17",
]
2 changes: 1 addition & 1 deletion release-pr/src/neon_release_pr/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def new(
if cherry_pick and base is None:
base = git.release_branch_name()
elif base is None:
base = git.base_branch_name()
base = "main"

branch_name = git.rc_branch_name()

Expand Down
28 changes: 0 additions & 28 deletions release-pr/src/neon_release_pr/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from shutil import which
from subprocess import run, PIPE, CalledProcessError
import re
import typer


def ready():
Expand Down Expand Up @@ -164,33 +163,6 @@ def release_branch_name() -> str:
return f"release-{ctx.component}"


def base_branch_name() -> str:
return (
"neon-main" if github_repo(origin_url()) == "databricks-eng/hadron" else "main"
)


def github_repo(origin_url: str | None) -> str | None:
typer.echo(origin_url)
if origin_url is None:
return None

match = re.search(
r"github[^:/\s]*\.com[^:/\s]*(?::\d+)?[:\/](?P<repo>[^/]+?/[^/]+?)(\.git)?$",
origin_url,
)

assert match, (
"There should be exactly one repo owner/name match in the url for remote origin"
)

return match.group("repo")


def origin_url() -> str | None:
return run_git(["remote", "get-url", "origin"], capture_output=True, dry_run=False)


def merge_message() -> str:
return f"{ctx.component.capitalize()} release {ctx.reference_time.strftime('%Y-%m-%d %H:%M UTC')}"

Expand Down
24 changes: 0 additions & 24 deletions release-pr/tests/test_origin_url_regex.py

This file was deleted.

Loading