diff --git a/src/runboat/api.py b/src/runboat/api.py index 3de887b..609ee3c 100644 --- a/src/runboat/api.py +++ b/src/runboat/api.py @@ -49,7 +49,8 @@ class Build(BaseModel): git_commit: str image: str deploy_link: str - repo_link: str + repo_target_branch_link: str + repo_pr_link: Optional[str] repo_commit_link: str webui_link: str status: models.BuildStatus diff --git a/src/runboat/models.py b/src/runboat/models.py index 7b9ed2e..70edf04 100644 --- a/src/runboat/models.py +++ b/src/runboat/models.py @@ -138,12 +138,14 @@ class Build(BaseModel): return f"http://{self.slug}.{settings.build_domain}" @property - def repo_link(self) -> str: - link = f"https://github.com/{self.repo}" - if self.pr: - return f"{link}/pull/{self.pr}" - else: - return f"{link}/tree/{self.target_branch}" + def repo_target_branch_link(self) -> str: + return f"https://github.com/{self.repo}/tree/{self.target_branch}" + + @property + def repo_pr_link(self) -> str | None: + if not self.pr: + return None + return f"https://github.com/{self.repo}/pull/{self.pr}" @property def repo_commit_link(self) -> str: diff --git a/src/runboat/webui/runboat-build-element.js b/src/runboat/webui/runboat-build-element.js index c9d5716..bb9c716 100644 --- a/src/runboat/webui/runboat-build-element.js +++ b/src/runboat/webui/runboat-build-element.js @@ -42,11 +42,10 @@ class RunboatBuildElement extends LitElement {

${this.build.name}

- ${this.build.repo} + ${this.build.repo} ${this.build.target_branch} ${this.build.pr? - html`PR ${this.build.pr} to`:"" + html`PR ${this.build.pr}`:"" } - ${this.build.target_branch}
${this.build.git_commit? html`(${this.build.git_commit.substring(0, 8)})`:""