Merge pull request 'Add CLI tests' (#22) from cli-tests into master
Reviewed-on: #22
This commit is contained in:
commit
8a02b56c67
24
flake.lock
24
flake.lock
@ -2,11 +2,11 @@
|
|||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735471104,
|
"lastModified": 1736012469,
|
||||||
"narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=",
|
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4",
|
"rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -29,11 +29,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735027065,
|
"lastModified": 1736122544,
|
||||||
"narHash": "sha256-4S8cjcqosbGW0zVYSRChff3Mk10R6Wz5E31NmyPT/lA=",
|
"narHash": "sha256-3Pb/yiQa2MpWPWshxluQR2n1/Bq21hoGqJf3UAC3+ts=",
|
||||||
"owner": "pyproject-nix",
|
"owner": "pyproject-nix",
|
||||||
"repo": "build-system-pkgs",
|
"repo": "build-system-pkgs",
|
||||||
"rev": "d6fc977ce830832901f542fe3de8a7f35abbe37c",
|
"rev": "68b4c6dae0c47974bda803cf4e87921776f6081d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -49,11 +49,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735533414,
|
"lastModified": 1735874123,
|
||||||
"narHash": "sha256-prriyGBvzb2JS7wMELw2G+9RIYBHBzHCFstnKJYxuis=",
|
"narHash": "sha256-0uSnm3tyid97v6/m7SoBPgcfMya3nVqEM9Y2EpaTlp0=",
|
||||||
"owner": "pyproject-nix",
|
"owner": "pyproject-nix",
|
||||||
"repo": "pyproject.nix",
|
"repo": "pyproject.nix",
|
||||||
"rev": "919cdee9344097b67d9e73f2179a9dc8ab783f65",
|
"rev": "e14a14de0d0026e62d809bfa4cd92c4f9badb262",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -80,11 +80,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735524217,
|
"lastModified": 1736123193,
|
||||||
"narHash": "sha256-8NiHtEUrJFSjB+Q6mVZQISQIOdSvVTxVNwX59dMoeOA=",
|
"narHash": "sha256-C2OUc0wtxB3oTut1noH/nbyNOtV3bcj6PxxsvP7Pr7k=",
|
||||||
"owner": "pyproject-nix",
|
"owner": "pyproject-nix",
|
||||||
"repo": "uv2nix",
|
"repo": "uv2nix",
|
||||||
"rev": "c38b0af56110b58ec132b0e781f9943a8deefd52",
|
"rev": "0da15a60f2de3c6206b0cc62267c7be4b2de5a59",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1,92 +1,4 @@
|
|||||||
import typer
|
from nixprstatus.app import app
|
||||||
import json
|
|
||||||
from typing import Annotated
|
|
||||||
from nixprstatus.pr import pr_merge_status
|
|
||||||
from nixprstatus.pr import commits_since
|
|
||||||
from nixprstatus.watchlist import Watchlist
|
|
||||||
from nixprstatus.output import OutputFormat
|
|
||||||
|
|
||||||
app = typer.Typer(rich_markup_mode=None)
|
|
||||||
watchlist_app = typer.Typer()
|
|
||||||
app.add_typer(watchlist_app, name="watchlist", help="Manage watchlist.")
|
|
||||||
|
|
||||||
DEFAULT_HEADERS = {
|
|
||||||
"Accept": "application/vnd.github.text+json",
|
|
||||||
}
|
|
||||||
|
|
||||||
BRANCHES = ["nixos-unstable-small", "nixos-unstable", "nixos-24.05"]
|
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
|
||||||
def pr(
|
|
||||||
pr: list[int],
|
|
||||||
branches: Annotated[
|
|
||||||
list[str] | None, typer.Option(help="Check specific branch")
|
|
||||||
] = None,
|
|
||||||
format: Annotated[
|
|
||||||
OutputFormat, typer.Option(help="Output format")
|
|
||||||
] = OutputFormat.CONSOLE,
|
|
||||||
) -> None:
|
|
||||||
"""Get merge status of pull request."""
|
|
||||||
if isinstance(pr, int):
|
|
||||||
status = pr_merge_status(pr, branches)
|
|
||||||
status.print(format=format)
|
|
||||||
return
|
|
||||||
|
|
||||||
for pr_ in pr:
|
|
||||||
status = pr_merge_status(pr_, branches)
|
|
||||||
status.print(format=format)
|
|
||||||
print()
|
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
|
||||||
def since(
|
|
||||||
commit_sha: str,
|
|
||||||
target: str = "nixos-unstable",
|
|
||||||
waybar_format: Annotated[
|
|
||||||
bool, typer.Option(help="Output in format expected by waybar")
|
|
||||||
] = False,
|
|
||||||
) -> None:
|
|
||||||
"""
|
|
||||||
Return the count of commits that has happened between the two refs.
|
|
||||||
"""
|
|
||||||
count = commits_since(target, commit_sha)
|
|
||||||
|
|
||||||
if waybar_format:
|
|
||||||
output = {"text": str(count), "tooltip": f"{target}: {count}"}
|
|
||||||
typer.echo(json.dumps(output))
|
|
||||||
return
|
|
||||||
typer.echo(count)
|
|
||||||
|
|
||||||
|
|
||||||
@watchlist_app.command(name="list")
|
|
||||||
def command_list(
|
|
||||||
watchlist: str | None = None, format: OutputFormat = OutputFormat.CONSOLE
|
|
||||||
) -> None:
|
|
||||||
"""List PRs in watchlist."""
|
|
||||||
wl = Watchlist.from_file(path=watchlist)
|
|
||||||
wl.print(format=format)
|
|
||||||
|
|
||||||
|
|
||||||
@watchlist_app.command()
|
|
||||||
def add(pr: int, watchlist: str | None = None) -> None:
|
|
||||||
"""Add PR to watchlist."""
|
|
||||||
wl = Watchlist.from_file(path=watchlist)
|
|
||||||
info = wl.add_pr(pr)
|
|
||||||
wl.to_file(path=watchlist)
|
|
||||||
print(f"Added #{info.pr}: {info.title} to watchlist.")
|
|
||||||
|
|
||||||
|
|
||||||
@watchlist_app.command()
|
|
||||||
def remove(pr: int) -> None:
|
|
||||||
"""Remove PR from watchlist."""
|
|
||||||
wl = Watchlist.from_file()
|
|
||||||
if pr not in wl:
|
|
||||||
print(f"#{pr} not in watchlist.")
|
|
||||||
return
|
|
||||||
wl.remove(pr)
|
|
||||||
wl.to_file()
|
|
||||||
print(f"Removed #{pr} from watchlist.")
|
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
85
nixprstatus/app.py
Normal file
85
nixprstatus/app.py
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
import typer
|
||||||
|
import json
|
||||||
|
from typing import Annotated
|
||||||
|
from nixprstatus.pr import pr_merge_status
|
||||||
|
from nixprstatus.pr import commits_since
|
||||||
|
from nixprstatus.watchlist import Watchlist
|
||||||
|
from nixprstatus.output import OutputFormat
|
||||||
|
|
||||||
|
app = typer.Typer(rich_markup_mode=None)
|
||||||
|
watchlist_app = typer.Typer()
|
||||||
|
app.add_typer(watchlist_app, name="watchlist", help="Manage watchlist.")
|
||||||
|
|
||||||
|
DEFAULT_HEADERS = {
|
||||||
|
"Accept": "application/vnd.github.text+json",
|
||||||
|
}
|
||||||
|
|
||||||
|
BRANCHES = ["nixos-unstable-small", "nixos-unstable", "nixos-24.05"]
|
||||||
|
|
||||||
|
|
||||||
|
@app.command()
|
||||||
|
def pr(
|
||||||
|
pr: list[int],
|
||||||
|
branches: Annotated[
|
||||||
|
list[str] | None, typer.Option(help="Check specific branch")
|
||||||
|
] = None,
|
||||||
|
format: Annotated[
|
||||||
|
OutputFormat, typer.Option(help="Output format")
|
||||||
|
] = OutputFormat.CONSOLE,
|
||||||
|
) -> None:
|
||||||
|
"""Get merge status of pull request(s)."""
|
||||||
|
for pr_ in pr:
|
||||||
|
status = pr_merge_status(pr_, branches)
|
||||||
|
status.print(format=format)
|
||||||
|
if format != OutputFormat.JSON:
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
@app.command()
|
||||||
|
def since(
|
||||||
|
commit_sha: str,
|
||||||
|
target: str = "nixos-unstable",
|
||||||
|
waybar_format: Annotated[
|
||||||
|
bool, typer.Option(help="Output in format expected by waybar")
|
||||||
|
] = False,
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Return the count of commits that has happened between the two refs.
|
||||||
|
"""
|
||||||
|
count = commits_since(target, commit_sha)
|
||||||
|
|
||||||
|
if waybar_format:
|
||||||
|
output = {"text": str(count), "tooltip": f"{target}: {count}"}
|
||||||
|
typer.echo(json.dumps(output))
|
||||||
|
return
|
||||||
|
typer.echo(count)
|
||||||
|
|
||||||
|
|
||||||
|
@watchlist_app.command(name="list")
|
||||||
|
def command_list(
|
||||||
|
watchlist: str | None = None, format: OutputFormat = OutputFormat.CONSOLE
|
||||||
|
) -> None:
|
||||||
|
"""List PRs in watchlist."""
|
||||||
|
wl = Watchlist.from_file(path=watchlist)
|
||||||
|
wl.print(format=format)
|
||||||
|
|
||||||
|
|
||||||
|
@watchlist_app.command()
|
||||||
|
def add(pr: int, watchlist: str | None = None) -> None:
|
||||||
|
"""Add PR to watchlist."""
|
||||||
|
wl = Watchlist.from_file(path=watchlist)
|
||||||
|
info = wl.add_pr(pr)
|
||||||
|
wl.to_file(path=watchlist)
|
||||||
|
print(f"Added #{info.pr}: {info.title} to watchlist.")
|
||||||
|
|
||||||
|
|
||||||
|
@watchlist_app.command()
|
||||||
|
def remove(pr: int) -> None:
|
||||||
|
"""Remove PR from watchlist."""
|
||||||
|
wl = Watchlist.from_file()
|
||||||
|
if pr not in wl:
|
||||||
|
print(f"#{pr} not in watchlist.")
|
||||||
|
return
|
||||||
|
wl.remove(pr)
|
||||||
|
wl.to_file()
|
||||||
|
print(f"Removed #{pr} from watchlist.")
|
@ -9,8 +9,9 @@ from nixprstatus.output import OutputFormat
|
|||||||
DEFAULT_HEADERS = {
|
DEFAULT_HEADERS = {
|
||||||
"Accept": "application/vnd.github.text+json",
|
"Accept": "application/vnd.github.text+json",
|
||||||
}
|
}
|
||||||
DEFAULT_BRANCHES = ["master", "nixos-unstable-small", "nixos-unstable", "nixos-24.05"]
|
DEFAULT_BRANCHES = ["master", "nixos-unstable-small", "nixos-unstable", "nixos-24.11"]
|
||||||
BACKPORT_LABEL = "backport release-24.05"
|
STABLE_BRANCH = "nixos-24.11"
|
||||||
|
BACKPORT_LABEL = "backport release-24.11"
|
||||||
|
|
||||||
|
|
||||||
class PRStatus(BaseModel):
|
class PRStatus(BaseModel):
|
||||||
@ -110,7 +111,7 @@ def pr_merge_status(
|
|||||||
in_branch = commit_in_branch(commit_sha, branch)
|
in_branch = commit_in_branch(commit_sha, branch)
|
||||||
results[branch] = in_branch
|
results[branch] = in_branch
|
||||||
|
|
||||||
if check_backport and has_backport_label and "nixos-24.05" in branches:
|
if check_backport and has_backport_label and STABLE_BRANCH in branches:
|
||||||
# Check comments for message about backport
|
# Check comments for message about backport
|
||||||
comment_url = f"https://api.github.com/repos/NixOS/nixpkgs/issues/{pr}/comments"
|
comment_url = f"https://api.github.com/repos/NixOS/nixpkgs/issues/{pr}/comments"
|
||||||
comment_response = requests.get(comment_url, headers=DEFAULT_HEADERS)
|
comment_response = requests.get(comment_url, headers=DEFAULT_HEADERS)
|
||||||
@ -128,12 +129,12 @@ def pr_merge_status(
|
|||||||
backport_response = requests.get(backport_url, headers=DEFAULT_HEADERS)
|
backport_response = requests.get(backport_url, headers=DEFAULT_HEADERS)
|
||||||
backport_sha = backport_response.json().get("merge_commit_sha")
|
backport_sha = backport_response.json().get("merge_commit_sha")
|
||||||
if backport_sha is None:
|
if backport_sha is None:
|
||||||
results[f"nixos-24.05 (#{backport_pr})"] = False
|
results[f"{STABLE_BRANCH} (#{backport_pr})"] = False
|
||||||
return PRStatus(title=title, merged=True, branches=results)
|
return PRStatus(title=title, merged=True, branches=results)
|
||||||
|
|
||||||
results.pop("nixos-24.05")
|
results.pop(STABLE_BRANCH)
|
||||||
results[f"nixos-24.05 (#{backport_pr})"] = commit_in_branch(
|
results[f"{STABLE_BRANCH} (#{backport_pr})"] = commit_in_branch(
|
||||||
backport_sha, "nixos-24.05"
|
backport_sha, STABLE_BRANCH
|
||||||
)
|
)
|
||||||
|
|
||||||
return PRStatus(title=title, merged=True, branches=results)
|
return PRStatus(title=title, merged=True, branches=results)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "nixprstatus"
|
name = "nixprstatus"
|
||||||
version = "0.1.16"
|
version = "0.1.17"
|
||||||
description = "Nixpkgs PR status checker"
|
description = "Nixpkgs PR status checker"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
|
177
tests/fixtures/comments_345583.json
vendored
Normal file
177
tests/fixtures/comments_345583.json
vendored
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/issues/comments/2388655041",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/pull/345769#issuecomment-2388655041",
|
||||||
|
"issue_url": "https://api.github.com/repos/NixOS/nixpkgs/issues/345769",
|
||||||
|
"id": 2388655041,
|
||||||
|
"node_id": "IC_kwDOAEVQ_M6OX_vB",
|
||||||
|
"user": {
|
||||||
|
"login": "mweinelt",
|
||||||
|
"id": 131599,
|
||||||
|
"node_id": "MDQ6VXNlcjEzMTU5OQ==",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/131599?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/mweinelt",
|
||||||
|
"html_url": "https://github.com/mweinelt",
|
||||||
|
"followers_url": "https://api.github.com/users/mweinelt/followers",
|
||||||
|
"following_url": "https://api.github.com/users/mweinelt/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/mweinelt/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/mweinelt/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/mweinelt/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/mweinelt/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/mweinelt/repos",
|
||||||
|
"events_url": "https://api.github.com/users/mweinelt/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/mweinelt/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"created_at": "2024-10-02T13:31:48Z",
|
||||||
|
"updated_at": "2024-10-02T13:31:48Z",
|
||||||
|
"author_association": "MEMBER",
|
||||||
|
"body_text": "@ofborg build firefox-unwrapped.tests",
|
||||||
|
"reactions": {
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/issues/comments/2388655041/reactions",
|
||||||
|
"total_count": 0,
|
||||||
|
"+1": 0,
|
||||||
|
"-1": 0,
|
||||||
|
"laugh": 0,
|
||||||
|
"hooray": 0,
|
||||||
|
"confused": 0,
|
||||||
|
"heart": 0,
|
||||||
|
"rocket": 0,
|
||||||
|
"eyes": 0
|
||||||
|
},
|
||||||
|
"performed_via_github_app": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/issues/comments/2389811254",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/pull/345769#issuecomment-2389811254",
|
||||||
|
"issue_url": "https://api.github.com/repos/NixOS/nixpkgs/issues/345769",
|
||||||
|
"id": 2389811254,
|
||||||
|
"node_id": "IC_kwDOAEVQ_M6OcaA2",
|
||||||
|
"user": {
|
||||||
|
"login": "github-actions[bot]",
|
||||||
|
"id": 41898282,
|
||||||
|
"node_id": "MDM6Qm90NDE4OTgyODI=",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
|
||||||
|
"html_url": "https://github.com/apps/github-actions",
|
||||||
|
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
|
||||||
|
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
|
||||||
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
||||||
|
"type": "Bot",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"created_at": "2024-10-02T22:45:02Z",
|
||||||
|
"updated_at": "2024-10-02T22:45:02Z",
|
||||||
|
"author_association": "CONTRIBUTOR",
|
||||||
|
"body_text": "Successfully created backport PR for `release-24.05`:\n\n#346022",
|
||||||
|
"reactions": {
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/issues/comments/2389811254/reactions",
|
||||||
|
"total_count": 0,
|
||||||
|
"+1": 0,
|
||||||
|
"-1": 0,
|
||||||
|
"laugh": 0,
|
||||||
|
"hooray": 0,
|
||||||
|
"confused": 0,
|
||||||
|
"heart": 0,
|
||||||
|
"rocket": 0,
|
||||||
|
"eyes": 0
|
||||||
|
},
|
||||||
|
"performed_via_github_app": {
|
||||||
|
"id": 15368,
|
||||||
|
"client_id": "Iv1.05c79e9ad1f6bdfa",
|
||||||
|
"slug": "github-actions",
|
||||||
|
"node_id": "MDM6QXBwMTUzNjg=",
|
||||||
|
"owner": {
|
||||||
|
"login": "github",
|
||||||
|
"id": 9919,
|
||||||
|
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/github",
|
||||||
|
"html_url": "https://github.com/github",
|
||||||
|
"followers_url": "https://api.github.com/users/github/followers",
|
||||||
|
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/github/repos",
|
||||||
|
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||||
|
"type": "Organization",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"name": "GitHub Actions",
|
||||||
|
"description": "Automate your workflow from idea to production",
|
||||||
|
"external_url": "https://help.github.com/en/actions",
|
||||||
|
"html_url": "https://github.com/apps/github-actions",
|
||||||
|
"created_at": "2018-07-30T09:30:17Z",
|
||||||
|
"updated_at": "2024-04-10T20:33:16Z",
|
||||||
|
"permissions": {
|
||||||
|
"actions": "write",
|
||||||
|
"administration": "read",
|
||||||
|
"attestations": "write",
|
||||||
|
"checks": "write",
|
||||||
|
"contents": "write",
|
||||||
|
"deployments": "write",
|
||||||
|
"discussions": "write",
|
||||||
|
"issues": "write",
|
||||||
|
"merge_queues": "write",
|
||||||
|
"metadata": "read",
|
||||||
|
"packages": "write",
|
||||||
|
"pages": "write",
|
||||||
|
"pull_requests": "write",
|
||||||
|
"repository_hooks": "write",
|
||||||
|
"repository_projects": "write",
|
||||||
|
"security_events": "write",
|
||||||
|
"statuses": "write",
|
||||||
|
"vulnerability_alerts": "read"
|
||||||
|
},
|
||||||
|
"events": [
|
||||||
|
"branch_protection_rule",
|
||||||
|
"check_run",
|
||||||
|
"check_suite",
|
||||||
|
"create",
|
||||||
|
"delete",
|
||||||
|
"deployment",
|
||||||
|
"deployment_status",
|
||||||
|
"discussion",
|
||||||
|
"discussion_comment",
|
||||||
|
"fork",
|
||||||
|
"gollum",
|
||||||
|
"issues",
|
||||||
|
"issue_comment",
|
||||||
|
"label",
|
||||||
|
"merge_group",
|
||||||
|
"milestone",
|
||||||
|
"page_build",
|
||||||
|
"project",
|
||||||
|
"project_card",
|
||||||
|
"project_column",
|
||||||
|
"public",
|
||||||
|
"pull_request",
|
||||||
|
"pull_request_review",
|
||||||
|
"pull_request_review_comment",
|
||||||
|
"push",
|
||||||
|
"registry_package",
|
||||||
|
"release",
|
||||||
|
"repository",
|
||||||
|
"repository_dispatch",
|
||||||
|
"status",
|
||||||
|
"watch",
|
||||||
|
"workflow_dispatch",
|
||||||
|
"workflow_run"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
186
tests/fixtures/compare_nixos-24.11_1e6376619b9192dc7603e07d7187572c45048dd7.json
vendored
Normal file
186
tests/fixtures/compare_nixos-24.11_1e6376619b9192dc7603e07d7187572c45048dd7.json
vendored
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
{
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/compare/nixos-24.05...1e6376619b9192dc7603e07d7187572c45048dd7",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/compare/nixos-24.05...1e6376619b9192dc7603e07d7187572c45048dd7",
|
||||||
|
"permalink_url": "https://github.com/NixOS/nixpkgs/compare/NixOS:ecbc1ca...NixOS:1e63766",
|
||||||
|
"diff_url": "https://github.com/NixOS/nixpkgs/compare/nixos-24.05...1e6376619b9192dc7603e07d7187572c45048dd7.diff",
|
||||||
|
"patch_url": "https://github.com/NixOS/nixpkgs/compare/nixos-24.05...1e6376619b9192dc7603e07d7187572c45048dd7.patch",
|
||||||
|
"base_commit": {
|
||||||
|
"sha": "ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6",
|
||||||
|
"node_id": "C_kwDOAEVQ_NoAKGVjYmMxY2E4ZmZkNmFlYTgzNzJhZDE2YmU5ZWJiYjM5ODg5ZTU1YjY",
|
||||||
|
"commit": {
|
||||||
|
"author": {
|
||||||
|
"name": "OTABI Tomoya",
|
||||||
|
"email": "tomoya.otabi@gmail.com",
|
||||||
|
"date": "2024-10-06T05:47:56Z"
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"name": "GitHub",
|
||||||
|
"email": "noreply@github.com",
|
||||||
|
"date": "2024-10-06T05:47:56Z"
|
||||||
|
},
|
||||||
|
"message": "[Backport release-24.05] brave: 1.70.119 -> 1.70.123 (#346428)",
|
||||||
|
"tree": {
|
||||||
|
"sha": "f0b5ae7d234fd6c2d86f5603b4522f2ba74eda5b",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/git/trees/f0b5ae7d234fd6c2d86f5603b4522f2ba74eda5b"
|
||||||
|
},
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/git/commits/ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6",
|
||||||
|
"comment_count": 0,
|
||||||
|
"verification": {
|
||||||
|
"verified": true,
|
||||||
|
"reason": "valid",
|
||||||
|
"signature": "-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJnAiSMCRC1aQ7uu5UhlAAA0TYQAKRPy/FYu1l+CaEVlEayD+7E\ngFboJbXErmlX5/5lmwW/J3VQb2t3wlhlP5R82Utb66Gucy49vSbKcWAC3DgAT0fG\n2UOozKXq6bAJ+tzBPX/lFNNJHYmTFN3uGifkP+cHZdh7CE0EHH8IFE7rWOfYSMpK\n7Syjl1DsJ72j6ZNdWB3c1J4jCnGQKJRtgJI5yw7feqt6MYVUNLIENuo/RZHZtEF8\nCLZwx9a950pXPLUAH3HyTnoV76H9wC2ahWGUq3Mum/Cdf3WqPi0nuw+rqtjQvvCh\nK1cuS/wOlSTPqVt9S1U4GgUIdE1u82o2Zkxm/b8hOAxBNNg7nCf8RYyITL3gkubc\nIM4UgiOxL/ybpsYmNZ7zzpi8z1N28SrbGlfVG0Zp/7asniKCe/uJoXTQlxR+2GsN\nTld9B272Ttvrnyfokb05+DbTqEPV7NEG7HzXRIKcIYvcP0QdFFYch893n/t1fbFP\niOyqV3FJB68Dcjsr35zqQBPMcGNUtoo2hQFbmCZV3xYWKRfgUD6RnP+oFyIqrw5s\ne1WBwaiAbVnlCACkugGSXNF8s563cHauQkJi7553o75hqXsE8ezHCW12C4OUAQM8\nIspE3A8C/yC137IdAz3L/CpG6Qdp11AZQ1EG0oO0v7TtxQQHR3cBEUTO1vknG5iV\nuWuPBHuc5atQWRe2eVco\n=gGAX\n-----END PGP SIGNATURE-----\n",
|
||||||
|
"payload": "tree f0b5ae7d234fd6c2d86f5603b4522f2ba74eda5b\nparent 17ae88b569bb15590549ff478bab6494dde4a907\nparent d4eb7924598b8bd830e85c93aeb6aa7c5294de9a\nauthor OTABI Tomoya <tomoya.otabi@gmail.com> 1728193676 +0900\ncommitter GitHub <noreply@github.com> 1728193676 +0900\n\n[Backport release-24.05] brave: 1.70.119 -> 1.70.123 (#346428)\n\n"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6",
|
||||||
|
"comments_url": "https://api.github.com/repos/NixOS/nixpkgs/commits/ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6/comments",
|
||||||
|
"author": {
|
||||||
|
"login": "natsukium",
|
||||||
|
"id": 25083790,
|
||||||
|
"node_id": "MDQ6VXNlcjI1MDgzNzkw",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/25083790?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/natsukium",
|
||||||
|
"html_url": "https://github.com/natsukium",
|
||||||
|
"followers_url": "https://api.github.com/users/natsukium/followers",
|
||||||
|
"following_url": "https://api.github.com/users/natsukium/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/natsukium/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/natsukium/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/natsukium/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/natsukium/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/natsukium/repos",
|
||||||
|
"events_url": "https://api.github.com/users/natsukium/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/natsukium/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"login": "web-flow",
|
||||||
|
"id": 19864447,
|
||||||
|
"node_id": "MDQ6VXNlcjE5ODY0NDQ3",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/19864447?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/web-flow",
|
||||||
|
"html_url": "https://github.com/web-flow",
|
||||||
|
"followers_url": "https://api.github.com/users/web-flow/followers",
|
||||||
|
"following_url": "https://api.github.com/users/web-flow/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/web-flow/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/web-flow/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/web-flow/repos",
|
||||||
|
"events_url": "https://api.github.com/users/web-flow/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/web-flow/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"parents": [
|
||||||
|
{
|
||||||
|
"sha": "17ae88b569bb15590549ff478bab6494dde4a907",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/17ae88b569bb15590549ff478bab6494dde4a907",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/17ae88b569bb15590549ff478bab6494dde4a907"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sha": "d4eb7924598b8bd830e85c93aeb6aa7c5294de9a",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/d4eb7924598b8bd830e85c93aeb6aa7c5294de9a",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/d4eb7924598b8bd830e85c93aeb6aa7c5294de9a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"merge_base_commit": {
|
||||||
|
"sha": "1e6376619b9192dc7603e07d7187572c45048dd7",
|
||||||
|
"node_id": "C_kwDOAEVQ_NoAKDFlNjM3NjYxOWI5MTkyZGM3NjAzZTA3ZDcxODc1NzJjNDUwNDhkZDc",
|
||||||
|
"commit": {
|
||||||
|
"author": {
|
||||||
|
"name": "Martin Weinelt",
|
||||||
|
"email": "mweinelt@users.noreply.github.com",
|
||||||
|
"date": "2024-10-04T00:25:13Z"
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"name": "GitHub",
|
||||||
|
"email": "noreply@github.com",
|
||||||
|
"date": "2024-10-04T00:25:13Z"
|
||||||
|
},
|
||||||
|
"message": "[Backport release-24.05] Firefox: 130.0.1 -> 131.0; 128.2.0esr -> 128.3.0esr; 115.15.0esr -> 115.16.0esr (#346022)",
|
||||||
|
"tree": {
|
||||||
|
"sha": "ca267bfaced108f8b846f36b4222f50bcbea132e",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/git/trees/ca267bfaced108f8b846f36b4222f50bcbea132e"
|
||||||
|
},
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/git/commits/1e6376619b9192dc7603e07d7187572c45048dd7",
|
||||||
|
"comment_count": 0,
|
||||||
|
"verification": {
|
||||||
|
"verified": true,
|
||||||
|
"reason": "valid",
|
||||||
|
"signature": "-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJm/zXpCRC1aQ7uu5UhlAAAwfYQAKQ+YS049CLiRZX5L6663sip\nQ0lB49M6NgX6cx/uzDP2wkNdPZ+Ft/76Fngki9B3UBvJsdfgYsWMZ0L8lNCJPV5v\n65FCH0yzbwHz2gCgE2dTPMbd1qQGFaO1rSqksmLlovoA5NTHLrkoN7PEdNt97YQm\nvsJKHNAMzBgwmdom7OyxcBQfAmvNT4nijFqDW0AJ8VzS72EYW2il0S/uVzK2EE0k\nZdVX+oK2pYYYwaWchPofOalDLgXY5dteqNU7cQRdSI1saxoFbXVyLqo2N/lSm4/b\nv9+Uwwycjl7FyRCwucWXVBuMbbDsJW68xHSg060HbxBUEL3os8CleTiRWcXVa64d\nc619UC4/PQM+7pQFhOvATVBX+jWe508PQX5RCWIzQJWoOu+xcBbNeSImstM6jFWB\nDhKRYGM56+nPH+WRliTK6w07KAOhYMFDRAGHbUm3x5L03oqXowVjYx9UfdFBeNqW\noeETR77F6zfH/lBcW68JQMWM4ZG/sCo4HM81DY4vR99EPNKOPKNycjmV2Jb3WHRN\nO1DSmEeiCt7lgeuGmvIOXA5Z+QvAEGv8ZWRZ/K276GuK9kePh6xbu0ntAXRvy5iw\n/f426Ikzy7UM/yEL7458jrhyyqHlxiOXm+B+TSwbNSjLXHJdH5Ap3seIQjdo+num\nTWeoCrlH/oi+Tv83Iiye\n=G4zI\n-----END PGP SIGNATURE-----\n",
|
||||||
|
"payload": "tree ca267bfaced108f8b846f36b4222f50bcbea132e\nparent 0799dfba72420acad00f6c6b643e42f14589da6f\nparent 0010c39a77012492a1602258ad8e3fd5e9377bf6\nauthor Martin Weinelt <mweinelt@users.noreply.github.com> 1728001513 +0200\ncommitter GitHub <noreply@github.com> 1728001513 +0200\n\n[Backport release-24.05] Firefox: 130.0.1 -> 131.0; 128.2.0esr -> 128.3.0esr; 115.15.0esr -> 115.16.0esr (#346022)\n\n"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/1e6376619b9192dc7603e07d7187572c45048dd7",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/1e6376619b9192dc7603e07d7187572c45048dd7",
|
||||||
|
"comments_url": "https://api.github.com/repos/NixOS/nixpkgs/commits/1e6376619b9192dc7603e07d7187572c45048dd7/comments",
|
||||||
|
"author": {
|
||||||
|
"login": "mweinelt",
|
||||||
|
"id": 131599,
|
||||||
|
"node_id": "MDQ6VXNlcjEzMTU5OQ==",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/131599?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/mweinelt",
|
||||||
|
"html_url": "https://github.com/mweinelt",
|
||||||
|
"followers_url": "https://api.github.com/users/mweinelt/followers",
|
||||||
|
"following_url": "https://api.github.com/users/mweinelt/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/mweinelt/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/mweinelt/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/mweinelt/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/mweinelt/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/mweinelt/repos",
|
||||||
|
"events_url": "https://api.github.com/users/mweinelt/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/mweinelt/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"login": "web-flow",
|
||||||
|
"id": 19864447,
|
||||||
|
"node_id": "MDQ6VXNlcjE5ODY0NDQ3",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/19864447?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/web-flow",
|
||||||
|
"html_url": "https://github.com/web-flow",
|
||||||
|
"followers_url": "https://api.github.com/users/web-flow/followers",
|
||||||
|
"following_url": "https://api.github.com/users/web-flow/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/web-flow/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/web-flow/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/web-flow/repos",
|
||||||
|
"events_url": "https://api.github.com/users/web-flow/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/web-flow/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"parents": [
|
||||||
|
{
|
||||||
|
"sha": "0799dfba72420acad00f6c6b643e42f14589da6f",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/0799dfba72420acad00f6c6b643e42f14589da6f",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/0799dfba72420acad00f6c6b643e42f14589da6f"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sha": "0010c39a77012492a1602258ad8e3fd5e9377bf6",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/0010c39a77012492a1602258ad8e3fd5e9377bf6",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/0010c39a77012492a1602258ad8e3fd5e9377bf6"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"status": "behind",
|
||||||
|
"ahead_by": 0,
|
||||||
|
"behind_by": 68,
|
||||||
|
"total_commits": 0,
|
||||||
|
"commits": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
24306
tests/fixtures/compare_nixos-24.11_2c5fac3edf2d00d948253e392ec1604b29b38f14.json
vendored
Normal file
24306
tests/fixtures/compare_nixos-24.11_2c5fac3edf2d00d948253e392ec1604b29b38f14.json
vendored
Normal file
File diff suppressed because one or more lines are too long
24154
tests/fixtures/compare_nixos-24.11_3569a56280e8afba7c10f9171dac71ff882ff1c1.json
vendored
Normal file
24154
tests/fixtures/compare_nixos-24.11_3569a56280e8afba7c10f9171dac71ff882ff1c1.json
vendored
Normal file
File diff suppressed because one or more lines are too long
180
tests/fixtures/compare_nixos-unstable-small_2c5fac3edf2d00d948253e392ec1604b29b38f14.json
vendored
Normal file
180
tests/fixtures/compare_nixos-unstable-small_2c5fac3edf2d00d948253e392ec1604b29b38f14.json
vendored
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
{
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/compare/nixos-unstable...2c5fac3edf2d00d948253e392ec1604b29b38f14",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/compare/nixos-unstable...2c5fac3edf2d00d948253e392ec1604b29b38f14",
|
||||||
|
"permalink_url": "https://github.com/NixOS/nixpkgs/compare/NixOS:bc947f5...NixOS:2c5fac3",
|
||||||
|
"diff_url": "https://github.com/NixOS/nixpkgs/compare/nixos-unstable...2c5fac3edf2d00d948253e392ec1604b29b38f14.diff",
|
||||||
|
"patch_url": "https://github.com/NixOS/nixpkgs/compare/nixos-unstable...2c5fac3edf2d00d948253e392ec1604b29b38f14.patch",
|
||||||
|
"base_commit": {
|
||||||
|
"sha": "bc947f541ae55e999ffdb4013441347d83b00feb",
|
||||||
|
"node_id": "C_kwDOAEVQ_NoAKGJjOTQ3ZjU0MWFlNTVlOTk5ZmZkYjQwMTM0NDEzNDdkODNiMDBmZWI",
|
||||||
|
"commit": {
|
||||||
|
"author": {
|
||||||
|
"name": "Masum Reza",
|
||||||
|
"email": "50095635+JohnRTitor@users.noreply.github.com",
|
||||||
|
"date": "2024-10-04T05:06:13Z"
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"name": "GitHub",
|
||||||
|
"email": "noreply@github.com",
|
||||||
|
"date": "2024-10-04T05:06:13Z"
|
||||||
|
},
|
||||||
|
"message": "alpaca: 2.0.3 -> 2.0.5 (#345070)",
|
||||||
|
"tree": {
|
||||||
|
"sha": "3e7376cebbaf8793c39bb68447950f1045fd4ea5",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/git/trees/3e7376cebbaf8793c39bb68447950f1045fd4ea5"
|
||||||
|
},
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/git/commits/bc947f541ae55e999ffdb4013441347d83b00feb",
|
||||||
|
"comment_count": 0,
|
||||||
|
"verification": {
|
||||||
|
"verified": true,
|
||||||
|
"reason": "valid",
|
||||||
|
"signature": "-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJm/3fFCRC1aQ7uu5UhlAAA2JMQAIz5pfsohrsrdPgPxlZVDuaQ\nVPLlM82MOpkq958U90OnXyC4ZlIX2+YwvCUkuRjYjMv9VlHMHU6olHy/jvt5VF/g\nckoaAMztOsPqgyKUXiMew83j8L8EBqVQQZ3W2Br9EnzG2RNEDUQdP5c6Fwc4tccl\nmb3PPb15Nm0lFnitwUO78KxILhrekjdxxrKC/wUihaL/gH4CzdkReVZJ6FPbq9l6\n/HTTDW+amrpOr2XLQ2dC5Cy/nvZS+MPjduNSPsf5a5/ElKmNltbPFChTY0pnv/dq\nrH1zDsohfbtk5WgcmLhiIOpvO86yLfa82sPUJA65GuAW7gYGbMsN6Sh3CnfY7sxb\n7x5r7/sSodxG4t2lML571JfX2aFCeNKgeYomViRu1ZGyHg3LJAN8jKi1JIyVCpH1\nkiTOmQQWzPJRC2COvMGSdXVc7h4CuInev7MmDDiubJDkFYyT8DBzpqVxUTmni13p\ndwr6QAWZZpjnxZxVFnYLlTSifLUIazEJTqaNWnCCc99hyWAo+f5njUlT+9fPLoKE\nHAgMmC55sOzOXnLLgPIoZe2g3wtHNELY3Y6wq7hfS2K9GCxJnJ3mttiUypnyHEuR\n/dVGOlES5p7xWUZ+zEYOp+cLnMWudB5X5cf/ojooLQJc8CL8gIfOD7KOrKewf2Yi\nUUUYH6/erCgoQE2klAaS\n=Hu+V\n-----END PGP SIGNATURE-----\n",
|
||||||
|
"payload": "tree 3e7376cebbaf8793c39bb68447950f1045fd4ea5\nparent 674acd883193175de91d37a6b3ea8c814d12c8bb\nparent e229318f7d34f4988a815e6d10b8fb0f7e0e2974\nauthor Masum Reza <50095635+JohnRTitor@users.noreply.github.com> 1728018373 +0530\ncommitter GitHub <noreply@github.com> 1728018373 +0530\n\nalpaca: 2.0.3 -> 2.0.5 (#345070)\n\n"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/bc947f541ae55e999ffdb4013441347d83b00feb",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/bc947f541ae55e999ffdb4013441347d83b00feb",
|
||||||
|
"comments_url": "https://api.github.com/repos/NixOS/nixpkgs/commits/bc947f541ae55e999ffdb4013441347d83b00feb/comments",
|
||||||
|
"author": {
|
||||||
|
"login": "JohnRTitor",
|
||||||
|
"id": 50095635,
|
||||||
|
"node_id": "MDQ6VXNlcjUwMDk1NjM1",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/50095635?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/JohnRTitor",
|
||||||
|
"html_url": "https://github.com/JohnRTitor",
|
||||||
|
"followers_url": "https://api.github.com/users/JohnRTitor/followers",
|
||||||
|
"following_url": "https://api.github.com/users/JohnRTitor/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/JohnRTitor/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/JohnRTitor/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/JohnRTitor/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/JohnRTitor/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/JohnRTitor/repos",
|
||||||
|
"events_url": "https://api.github.com/users/JohnRTitor/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/JohnRTitor/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"login": "web-flow",
|
||||||
|
"id": 19864447,
|
||||||
|
"node_id": "MDQ6VXNlcjE5ODY0NDQ3",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/19864447?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/web-flow",
|
||||||
|
"html_url": "https://github.com/web-flow",
|
||||||
|
"followers_url": "https://api.github.com/users/web-flow/followers",
|
||||||
|
"following_url": "https://api.github.com/users/web-flow/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/web-flow/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/web-flow/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/web-flow/repos",
|
||||||
|
"events_url": "https://api.github.com/users/web-flow/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/web-flow/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"parents": [
|
||||||
|
{
|
||||||
|
"sha": "674acd883193175de91d37a6b3ea8c814d12c8bb",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/674acd883193175de91d37a6b3ea8c814d12c8bb",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/674acd883193175de91d37a6b3ea8c814d12c8bb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sha": "e229318f7d34f4988a815e6d10b8fb0f7e0e2974",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/e229318f7d34f4988a815e6d10b8fb0f7e0e2974",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/e229318f7d34f4988a815e6d10b8fb0f7e0e2974"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"merge_base_commit": {
|
||||||
|
"sha": "2c5fac3edf2d00d948253e392ec1604b29b38f14",
|
||||||
|
"node_id": "C_kwDOAEVQ_NoAKDJjNWZhYzNlZGYyZDAwZDk0ODI1M2UzOTJlYzE2MDRiMjliMzhmMTQ",
|
||||||
|
"commit": {
|
||||||
|
"author": {
|
||||||
|
"name": "Thomas Gerbet",
|
||||||
|
"email": "thomas@gerbet.me",
|
||||||
|
"date": "2024-09-30T18:58:09Z"
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"name": "Bjørn Forsman",
|
||||||
|
"email": "bjorn.forsman@gmail.com",
|
||||||
|
"date": "2024-10-01T06:56:48Z"
|
||||||
|
},
|
||||||
|
"message": "wireshark: 4.2.6 -> 4.2.7\n\nFixes CVE-2024-8250.\nhttps://www.wireshark.org/security/wnpa-sec-2024-11.html\n\nChanges:\nhttps://www.wireshark.org/docs/relnotes/wireshark-4.2.7.html",
|
||||||
|
"tree": {
|
||||||
|
"sha": "35384ecd1601439a960f3ef76a1974bb7784523f",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/git/trees/35384ecd1601439a960f3ef76a1974bb7784523f"
|
||||||
|
},
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/git/commits/2c5fac3edf2d00d948253e392ec1604b29b38f14",
|
||||||
|
"comment_count": 0,
|
||||||
|
"verification": {
|
||||||
|
"verified": false,
|
||||||
|
"reason": "unsigned",
|
||||||
|
"signature": null,
|
||||||
|
"payload": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/2c5fac3edf2d00d948253e392ec1604b29b38f14",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/2c5fac3edf2d00d948253e392ec1604b29b38f14",
|
||||||
|
"comments_url": "https://api.github.com/repos/NixOS/nixpkgs/commits/2c5fac3edf2d00d948253e392ec1604b29b38f14/comments",
|
||||||
|
"author": {
|
||||||
|
"login": "LeSuisse",
|
||||||
|
"id": 737767,
|
||||||
|
"node_id": "MDQ6VXNlcjczNzc2Nw==",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/737767?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/LeSuisse",
|
||||||
|
"html_url": "https://github.com/LeSuisse",
|
||||||
|
"followers_url": "https://api.github.com/users/LeSuisse/followers",
|
||||||
|
"following_url": "https://api.github.com/users/LeSuisse/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/LeSuisse/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/LeSuisse/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/LeSuisse/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/LeSuisse/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/LeSuisse/repos",
|
||||||
|
"events_url": "https://api.github.com/users/LeSuisse/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/LeSuisse/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"login": "bjornfor",
|
||||||
|
"id": 133602,
|
||||||
|
"node_id": "MDQ6VXNlcjEzMzYwMg==",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/133602?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/bjornfor",
|
||||||
|
"html_url": "https://github.com/bjornfor",
|
||||||
|
"followers_url": "https://api.github.com/users/bjornfor/followers",
|
||||||
|
"following_url": "https://api.github.com/users/bjornfor/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/bjornfor/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/bjornfor/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/bjornfor/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/bjornfor/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/bjornfor/repos",
|
||||||
|
"events_url": "https://api.github.com/users/bjornfor/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/bjornfor/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"parents": [
|
||||||
|
{
|
||||||
|
"sha": "92bdb0b4e0f698cdde010c2254cdb2afee6e07c3",
|
||||||
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/commits/92bdb0b4e0f698cdde010c2254cdb2afee6e07c3",
|
||||||
|
"html_url": "https://github.com/NixOS/nixpkgs/commit/92bdb0b4e0f698cdde010c2254cdb2afee6e07c3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"status": "behind",
|
||||||
|
"ahead_by": 0,
|
||||||
|
"behind_by": 918,
|
||||||
|
"total_commits": 0,
|
||||||
|
"commits": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
24154
tests/fixtures/compare_nixos-unstable-small_3569a56280e8afba7c10f9171dac71ff882ff1c1.json
vendored
Normal file
24154
tests/fixtures/compare_nixos-unstable-small_3569a56280e8afba7c10f9171dac71ff882ff1c1.json
vendored
Normal file
File diff suppressed because one or more lines are too long
24154
tests/fixtures/compare_nixos-unstable_3569a56280e8afba7c10f9171dac71ff882ff1c1.json
vendored
Normal file
24154
tests/fixtures/compare_nixos-unstable_3569a56280e8afba7c10f9171dac71ff882ff1c1.json
vendored
Normal file
File diff suppressed because one or more lines are too long
2
tests/fixtures/pulls_345769.json
vendored
2
tests/fixtures/pulls_345769.json
vendored
@ -106,7 +106,7 @@
|
|||||||
"id": 6984924132,
|
"id": 6984924132,
|
||||||
"node_id": "LA_kwDOAEVQ_M8AAAABoFV75A",
|
"node_id": "LA_kwDOAEVQ_M8AAAABoFV75A",
|
||||||
"url": "https://api.github.com/repos/NixOS/nixpkgs/labels/backport%20release-24.05",
|
"url": "https://api.github.com/repos/NixOS/nixpkgs/labels/backport%20release-24.05",
|
||||||
"name": "backport release-24.05",
|
"name": "backport release-24.11",
|
||||||
"color": "0fafaa",
|
"color": "0fafaa",
|
||||||
"default": false,
|
"default": false,
|
||||||
"description": "Backport PR automatically"
|
"description": "Backport PR automatically"
|
||||||
|
83
tests/test_cli.py
Normal file
83
tests/test_cli.py
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
import unittest
|
||||||
|
import unittest.mock
|
||||||
|
import json
|
||||||
|
|
||||||
|
from typer.testing import CliRunner
|
||||||
|
|
||||||
|
from nixprstatus.app import app
|
||||||
|
|
||||||
|
from tests.helpers.mocks import mocked_requests_get
|
||||||
|
|
||||||
|
runner = CliRunner()
|
||||||
|
|
||||||
|
|
||||||
|
class TestCli(unittest.TestCase):
|
||||||
|
def test_help(self):
|
||||||
|
result = runner.invoke(app, ["--help"])
|
||||||
|
self.assertEqual(result.exit_code, 0)
|
||||||
|
self.assertIn("Usage: root [OPTIONS] COMMAND [ARGS]...", result.output)
|
||||||
|
self.assertIn("--show-completion", result.output)
|
||||||
|
self.assertIn("Commands:", result.output)
|
||||||
|
self.assertIn("pr", result.output)
|
||||||
|
self.assertIn("watchlist", result.output)
|
||||||
|
self.assertIn("since", result.output)
|
||||||
|
|
||||||
|
def test_pr_help(self):
|
||||||
|
result = runner.invoke(app, ["pr", "--help"])
|
||||||
|
self.assertEqual(result.exit_code, 0)
|
||||||
|
self.assertIn("Usage: root pr [OPTIONS] PR..", result.output)
|
||||||
|
self.assertIn("Options:", result.output)
|
||||||
|
|
||||||
|
@unittest.mock.patch("requests.get", side_effect=mocked_requests_get)
|
||||||
|
def test_pr_single_simple(self, mock_get):
|
||||||
|
result = runner.invoke(app, ["pr", "345583"])
|
||||||
|
print(result.exception)
|
||||||
|
self.assertEqual(result.exit_code, 0)
|
||||||
|
self.assertIn("wireshark: 4.2.6 -> 4.2.7", result.output)
|
||||||
|
|
||||||
|
@unittest.mock.patch("requests.get", side_effect=mocked_requests_get)
|
||||||
|
def test_pr_single_json(self, mock_get):
|
||||||
|
result = runner.invoke(app, ["pr", "--format", "json", "345583"])
|
||||||
|
self.assertEqual(result.exit_code, 0)
|
||||||
|
expected = {
|
||||||
|
"title": "wireshark: 4.2.6 -> 4.2.7",
|
||||||
|
"merged": True,
|
||||||
|
"branches": {
|
||||||
|
"nixos-unstable-small": True,
|
||||||
|
"nixos-unstable": True,
|
||||||
|
"nixos-24.11": False,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
output = json.loads(result.output)
|
||||||
|
self.assertEqual(output, expected)
|
||||||
|
|
||||||
|
@unittest.mock.patch("requests.get", side_effect=mocked_requests_get)
|
||||||
|
def test_pr_multiple(self, mock_get):
|
||||||
|
result = runner.invoke(app, ["pr", "--format", "json", "345583", "345769"])
|
||||||
|
self.assertEqual(result.exit_code, 0)
|
||||||
|
expected = [
|
||||||
|
{
|
||||||
|
"title": "wireshark: 4.2.6 -> 4.2.7",
|
||||||
|
"merged": True,
|
||||||
|
"branches": {
|
||||||
|
"master": True,
|
||||||
|
"nixos-unstable-small": True,
|
||||||
|
"nixos-unstable": True,
|
||||||
|
"nixos-24.11": False,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Firefox: 130.0.1 -> 131.0; 128.2.0esr -> 128.3.0esr; 115.15.0esr -> 115.16.0esr",
|
||||||
|
"merged": True,
|
||||||
|
"branches": {
|
||||||
|
"nixos-unstable-small": False,
|
||||||
|
"nixos-unstable": False,
|
||||||
|
"nixos-24.11 (#346022)": True,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
output = []
|
||||||
|
for line in result.output.split("\n"):
|
||||||
|
if len(line) > 0:
|
||||||
|
output.append(json.loads(line))
|
||||||
|
self.assertEqual(output, expected)
|
@ -20,11 +20,11 @@ class TestPRMergeStatus(unittest.TestCase):
|
|||||||
@unittest.mock.patch("requests.get", side_effect=mocked_requests_get)
|
@unittest.mock.patch("requests.get", side_effect=mocked_requests_get)
|
||||||
def test_pr_merge_status_backport_345769(self, mock_get):
|
def test_pr_merge_status_backport_345769(self, mock_get):
|
||||||
pr = 345769
|
pr = 345769
|
||||||
branches = ["nixos-24.05"]
|
branches = ["nixos-24.11"]
|
||||||
|
|
||||||
res = pr_merge_status(pr, branches, check_backport=True)
|
res = pr_merge_status(pr, branches, check_backport=True)
|
||||||
self.assertTrue(res.merged)
|
self.assertTrue(res.merged)
|
||||||
self.assertTrue(res.branches["nixos-24.05 (#346022)"])
|
self.assertTrue(res.branches["nixos-24.11 (#346022)"])
|
||||||
|
|
||||||
@unittest.mock.patch("requests.get", side_effect=mocked_requests_get)
|
@unittest.mock.patch("requests.get", side_effect=mocked_requests_get)
|
||||||
def test_pr_merge_status_title_345769(self, mock_get):
|
def test_pr_merge_status_title_345769(self, mock_get):
|
||||||
|
Loading…
Reference in New Issue
Block a user