MCPcopy Index your code
hub / github.com/cli/cli / agentSessionWebURL

Function agentSessionWebURL

pkg/cmd/agent-task/create/create.go:197–205  ·  view source on GitHub ↗
(repo ghrepo.Interface, j *capi.Job)

Source from the content-addressed store, hash-verified

195}
196
197func agentSessionWebURL(repo ghrepo.Interface, j *capi.Job) string {
198 if j.PullRequest == nil {
199 return ""
200 }
201 if j.SessionID == "" {
202 return fmt.Sprintf("https://github.com/%s/%s/pull/%d", url.PathEscape(repo.RepoOwner()), url.PathEscape(repo.RepoName()), j.PullRequest.Number)
203 }
204 return fmt.Sprintf("https://github.com/%s/%s/pull/%d/agent-sessions/%s", url.PathEscape(repo.RepoOwner()), url.PathEscape(repo.RepoName()), j.PullRequest.Number, url.PathEscape(j.SessionID))
205}
206
207// fetchJobSessionURL tries to return the agent session URL for a job. If the pull
208// request is not yet available, ("", nil) is returned.

Callers 1

fetchJobSessionURLFunction · 0.85

Calls 2

RepoOwnerMethod · 0.65
RepoNameMethod · 0.65

Tested by

no test coverage detected