coder / coder/internal

Git Flow: coder/coder/v2/cli: query coderd for git repo branches

Open
#406 0 comments 0 reactions 0 assignees View on GitHub
m
Dominant language
No language data
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Relates to https://github.com/coder/internal/issues/404 and https://github.com/coder/internal/issues/405

Using the endpoint added in #405, query the git remote via coderd when a user creates a workspace build using the `coder_git_repo` data source.

This ticket tracks the required work for this functionality in the CLI/API.

Implementation notes:
* If the user does not specify a URL for the `coder_git_repo` data source, we need to prompt the user to specify one so that we can check the remote.
* If the user specifies a URL but not a branch, we should prompt the user to select a remote branch.
* If the user specifies both URL and branch, no prompt is required but the check should still be performed.
* We will likely need to use a similar approach to what the [provider currently does when a parameter value is missing](https://github.com/coder/coder/blob/304007b5ea693cf4fe01f51fb123e557ad4d6955/provisionerd/runner/runner.go#L30) (`MISSING_TEMPLATE_PARAMETER`) if a user attempts to read the data source without having set a value for `data.coder_git_repo.foo.url`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.