Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add DevURL support#1316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
kylecarbs wants to merge9 commits intomainfromdevurls
Closed

feat: Add DevURL support#1316

kylecarbs wants to merge9 commits intomainfromdevurls

Conversation

kylecarbs
Copy link
Member

This adds DevURLs as a property to a workspace agent.

The resource is added to the Terraform provider here:
coder/terraform-provider-coder#17

DevURLs will be opened in the dashboard or via the CLI
withcoder open <name>. Ifcommand is specified, a
terminal will appear locally and in the web. Iftarget
is specified, the browser will open to an exposed instance
of that target.

Todo:

  • Add wildcard subdomain support.
  • Add path-based routing for when wildcards are not supported.
  • Addcoder open command to open a DevURL via the CLI.

ntimo reacted with heart emojintimo reacted with rocket emojintimo reacted with eyes emoji
@kylecarbskylecarbs self-assigned thisMay 6, 2022
@codecov
Copy link

codecovbot commentedMay 6, 2022
edited
Loading

Codecov Report

Merging#1316 (bdfa61a) intomain (914a2f4) willdecrease coverage by8.21%.
The diff coverage is48.91%.

@@            Coverage Diff             @@##             main    #1316      +/-   ##==========================================- Coverage   66.28%   58.06%   -8.22%==========================================  Files         281      284       +3       Lines       18438    18752     +314       Branches      220      235      +15     ==========================================- Hits        12221    10888    -1333- Misses       4962     6697    +1735+ Partials     1255     1167      -88
FlagCoverage Δ
unittest-go-macos-latest53.48% <34.78%> (-0.11%)⬇️
unittest-go-postgres-?
unittest-go-ubuntu-latest55.86% <48.91%> (-0.03%)⬇️
unittest-go-windows-202251.82% <34.23%> (-0.05%)⬇️
unittest-js73.67% <ø> (+2.06%)⬆️
Impacted FilesCoverage Δ
coderd/database/queries.sql.go0.00% <0.00%> (-78.11%)⬇️
coderd/rbac/object.go100.00% <ø> (ø)
codersdk/workspaceresources.go45.45% <ø> (ø)
coderd/provisionerjobs.go63.52% <70.00%> (+0.41%)⬆️
coderd/workspaceresources.go41.07% <70.00%> (+14.04%)⬆️
coderd/workspaceagents.go56.00% <76.00%> (-0.98%)⬇️
provisioner/terraform/provision.go72.50% <83.87%> (+0.60%)⬆️
coderd/provisionerdaemons.go63.14% <85.00%> (-0.34%)⬇️
coderd/devtunnel/tunnel.go0.00% <0.00%> (-79.67%)⬇️
... and44 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update914a2f4...bdfa61a. Read thecomment docs.

This adds apps as a property to a workspace agent.The resource is added to the Terraform provider here:coder/terraform-provider-coder#17Apps will be opened in the dashboard or via the CLIwith `coder open <name>`. If `command` is specified, aterminal will appear locally and in the web. If `target`is specified, the browser will open to an exposed instanceof that target.
Comment on lines 1 to 19
-- name: GetWorkspaceAppsByAgentID :many
SELECT * FROM workspace_apps WHERE agent_id = $1;

-- name: GetWorkspaceAppsByAgentIDs :many
SELECT * FROM workspace_apps WHERE agent_id = ANY(@ids :: uuid [ ]);

-- name: InsertWorkspaceApp :one
INSERT INTO
workspace_apps (
id,
created_at,
agent_id,
name,
icon,
command,
target
)
VALUES
($1, $2, $3, $4, $5, $6, $7) RETURNING *;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If these are only specified in the template, why are they defined on a per-agent basis instead of a per-template basis?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You could technically have a dynamic DevURL based on input parameters.

@@ -645,6 +645,27 @@ func insertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
if err != nil {
return xerrors.Errorf("insert agent: %w", err)
}

for _, app := range agent.Apps {
_, err := db.InsertWorkspaceApp(ctx, database.InsertWorkspaceAppParams{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What happens if an app is added to or removed from the template?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Because templates are versioned and so are our builds, we won't have these problems!

@missknissmisskniss added Community MVP 🏁 siteArea: frontend dashboard apiArea: HTTP API and removed V2 BETA labelsMay 16, 2022
@misskniss
Copy link

Is this PR still blocked by@deansheather's Port forwarding code?

@kylecarbs
Copy link
MemberAuthor

Yup, I'm reviewing his now!

@BrunoQuaresmaBrunoQuaresma removed the siteArea: frontend dashboard labelMay 24, 2022
@BrunoQuaresmaBrunoQuaresma removed their assignmentMay 24, 2022
@misskniss
Copy link

Note: This PR addresses:

#259
#314
#260
#261

Abstracting coderd into an interface added misdirection becausethe interface was never intended to be fulfilled outside of a singleimplementation.This lifts the abstraction, and attaches all handlers to a root structnamed `*coderd.API`.
@kylecarbskylecarbs deleted the devurls branchMay 26, 2022 03:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@deansheatherdeansheatherdeansheather left review comments

@coadlercoadlerAwaiting requested review from coadler

@spikecurtisspikecurtisAwaiting requested review from spikecurtisspikecurtis will be requested when the pull request is marked ready for reviewspikecurtis is a code owner

@johnstcnjohnstcnAwaiting requested review from johnstcnjohnstcn will be requested when the pull request is marked ready for reviewjohnstcn is a code owner

Assignees

@kylecarbskylecarbs

Labels
apiArea: HTTP API
Projects
None yet
Milestone
Community MVP
Development

Successfully merging this pull request may close these issues.

Add subpath handling/devurls for customers that cannot use wildcards
4 participants
@kylecarbs@misskniss@deansheather@BrunoQuaresma

[8]ページ先頭

©2009-2025 Movatter.jp