feat(cli): derive the repo URL from the git remote [ship] - #1500
martzoukos wants to merge 2 commits into
Conversation
Projects created by `checkly init` or `import plan` often end up without a repoUrl, which blocks Export to code from syncing bound resources. - getGitInformation now falls back to GitHub Actions' built-in env vars and the `origin` remote, with credentials stripped and SSH remotes converted to https. The derived URL only goes into repoInfo.repoUrl, never project.repoUrl. - Repositories without commits still send their URL; commitId is omitted. - `checkly init` writes repoUrl into the generated config, and the agent onboarding instructions tell the agent to set it from the remote. - `import plan` falls back to the git remote when creating a new project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review SummaryVerdict: Approve, but fix the Important issues before merging. There are no Critical issues. Intent (as understood): When a project has no Overview: The backend already accepts this (see Verification). The code that writes the generated config file and the code that turns SSH remotes into web URLs need work. Triage
Critical IssuesNone. Important Issues
Suggestions
What's Done Well
Verification
Open Questions
🤖 Generated with Claude Code |
…fig repoUrl in trigger - `checkly init` quotes the git-derived URL as a string literal and uses a function replacer, so quotes or `$'` in a remote can't break or inject code into checkly.config.ts. - SSH remotes whose host has no dot (SSH config aliases like `github-work`) or whose web path layout differs (Azure DevOps) no longer produce a URL. - `checkly trigger` passes the config repoUrl, so a declared URL wins over the git remote there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Affected Components
Summary
Projects created by
checkly initorimport planoften have norepoUrl. Export to code can't sync bound resources for those projects.repoInfo.repoUrlfallback chain is nowCHECKLY_REPO_URL→CHECKLY_TEST_REPO_URL→ configrepoUrl→CHECKLY_GITHUB_REPOSITORY→GITHUB_SERVER_URL+GITHUB_REPOSITORY→ theoriginremote.git@host:x/yandssh://remotes becomehttps://host/x/y..gitis dropped.commitIdis left out.commitIdis already optional in the backend'srepoInfoSchema. That schema is shared by/v1/test-sessions/run,/next/test-sessions/triggerand deploy.checkly initwritesrepoUrlinto the generated config. With no remote, it writes a commented placeholder. The agent onboarding instructions (initialize.md,context.ts) now tell the agent to setrepoUrlfrom the remote.import planfalls back to the git remote when it creates a new project.Notes for the Reviewer
repoInfo.repoUrl, never intoproject.repoUrl. The backend lets a derived URL fill a project only when the project has no URL, so forks and mirrors can't overwrite a declared URL.Tests
util.spec.ts: SSH,ssh://with a port, https with a token, no remote, no repo, no commits, and the fallback order.boilerplate.spec.ts:createConfigwith and without a remote.🤖 Generated with Claude Code