Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Merge main: Deployments panel in the About, project homepage, both sides' operations | 1 | import type { DeploymentEnvironments, RepoPath, Viewer } from "@g1t/contracts"; |
| 2 | ||
| 3 | import { deployments } from "./services.server"; | |
| 4 | ||
| 5 | /** | |
| 6 | * A repository's environments for a sidebar's Deployments panel, or null | |
| 7 | * when there are none or they cannot be read just now: the page shows | |
| 8 | * without the panel rather than failing. | |
| 9 | */ | |
| 10 | export async function environmentsFor(repo: RepoPath, viewer: Viewer): Promise<DeploymentEnvironments | null> { | |
| 11 | try { | |
| 12 | const found = await deployments.environments(repo, viewer); | |
| 13 | return found.ok && found.value.environments.length > 0 ? found.value : null; | |
| 14 | } catch (error) { | |
| 15 | console.warn("deployments:", error); | |
| 16 | return null; | |
| 17 | } | |
| 18 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.