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

coderd: autostart: codersdk, http api, database plumbing#879

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

Merged
johnstcn merged 16 commits intomainfromcj/autostart_dbschema
Apr 7, 2022

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedApr 5, 2022
edited
Loading

  • database schema for autostart and associated plumbing
  • http route for PUT `/autostart
  • handler forputWorkspaceAutostart
  • codersdkUpdateWorkspaceAutostart method
  • corresponding unit tests

🌮 to@vapurrmaid on the help with TDD!

NOTE: I also added the autostop-related database stuff before it was deemed better to submit smaller more integrated PRs. If this is a blocker, I can remove it from this PR and add it in the next. But it will likely be used Very Soon.

ALSO NOTE: I'm not using "fixes" here because the issues I opened are "horizontally" aligned, and not "vertically".

@codecov
Copy link

codecovbot commentedApr 5, 2022
edited
Loading

Codecov Report

Merging#879 (be0e6f3) intomain (fe23dcd) willincrease coverage by0.21%.
The diff coverage is77.98%.

@@            Coverage Diff             @@##             main     #879      +/-   ##==========================================+ Coverage   65.77%   65.98%   +0.21%==========================================  Files         216      216                Lines       13734    13834     +100       Branches      103      103              ==========================================+ Hits         9033     9129      +96  Misses       3782     3782- Partials      919      923       +4
FlagCoverage Δ
unittest-go-65.67% <77.98%> (+0.12%)⬆️
unittest-go-macos-latest52.86% <63.30%> (-0.14%)⬇️
unittest-go-ubuntu-latest55.47% <63.30%> (+0.12%)⬆️
unittest-go-windows-202252.24% <63.30%> (+0.13%)⬆️
unittest-js58.87% <ø> (ø)
Impacted FilesCoverage Δ
coderd/workspaces.go56.19% <72.30%> (+2.52%)⬆️
codersdk/workspaces.go63.63% <72.72%> (+4.54%)⬆️
coderd/coderd.go96.87% <100.00%> (+0.12%)⬆️
coderd/database/queries.sql.go83.97% <100.00%> (+0.41%)⬆️
provisionersdk/transport.go78.72% <0.00%> (-6.39%)⬇️
coderd/workspaceresources.go54.87% <0.00%> (-5.70%)⬇️
provisioner/echo/serve.go56.80% <0.00%> (-2.41%)⬇️
peer/channel.go85.38% <0.00%> (-0.59%)⬇️
provisionerd/provisionerd.go80.76% <0.00%> (ø)
... and4 more

Continue to review full report at Codecov.

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

Copy link
Member

@kylecarbskylecarbs left a comment
edited
Loading

Choose a reason for hiding this comment

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

Due to the to-dos I'm going to leave in commented state, but all looks great so far! Just oneextremely minor nit.

)

err := client.UpdateWorkspaceAutostart(ctx, wsid, req)
require.EqualError(t, err, fmt.Sprintf("status code 404: workspace %q does not exist", wsid), "unexpected error")
Copy link
Member

Choose a reason for hiding this comment

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

nit: We could assert tocodersdk.Error here to check the status code!

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

ack

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

FYI I ended up needing to squelch a linter error when trying to useerrors.As oncodersdk.Error.
This is the sort of thing I ended up with:https://go.dev/play/p/NHTmnYWan6g

- add unit tests to and from DST- ensure expected interval between autostarts
@johnstcnjohnstcnforce-pushed thecj/autostart_dbschema branch froma17d3a1 to316501dCompareApril 6, 2022 20:05
greyscaled added a commit that referenced this pull requestApr 13, 2022
Summary:This adds the client-side implementation to match the types introducedin#879 and#844 as well as a card in the Workspaces page to presentworkspace the data.Details:* Added a convenient line break in the example schedule.Weekly* Added missing `json:""` annotations in codersdk/workspaces.go* Installed cronstrue for displaying human-friendly cron strings* Adjusted/Added client-side types to match codersdk/workspaces.go* Added new component WorkspaceSchedule.tsxNext Steps:The WorkspaceSchedule.tsx card only presents data (on purpose). In orderto make it PUT/modify data, a few changes will be made:- a form for updating workspace schedule will be created- the form will wrapped in a dialog or modal- the WorkspaceSchedule card will have a way of opening the modal whichwill likely be generalized up to WorkspaceSection.tsxImpact:This is user-facingThis does not fully resolve either#274 or#275 (I may further decomposethat work to reflect reality and keep things in small deliverableincrements), but adds significant progress towards both.
greyscaled added a commit that referenced this pull requestApr 14, 2022
Summary:This adds the client-side implementation to match the types introducedin#879 and#844 as well as a card in the Workspaces page to presentworkspace the data.Details:* Added a convenient line break in the example schedule.Weekly* Added missing `json:""` annotations in codersdk/workspaces.go* Installed cronstrue for displaying human-friendly cron strings* Adjusted/Added client-side types to match codersdk/workspaces.go* Added new component WorkspaceSchedule.tsxNext Steps:The WorkspaceSchedule.tsx card only presents data (on purpose). In orderto make it PUT/modify data, a few changes will be made:- a form for updating workspace schedule will be created- the form will wrapped in a dialog or modal- the WorkspaceSchedule card will have a way of opening the modal whichwill likely be generalized up to WorkspaceSection.tsxImpact:This is user-facingThis does not fully resolve either#274 or#275 (I may further decomposethat work to reflect reality and keep things in small deliverableincrements), but adds significant progress towards both.
@missknissmisskniss added this to theV2 Beta milestoneMay 15, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@greyscaledgreyscaledgreyscaled approved these changes

@coadlercoadlerAwaiting requested review from coadler

@kylecarbskylecarbsAwaiting requested review from kylecarbs

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
V2 Beta
Development

Successfully merging this pull request may close these issues.

4 participants
@johnstcn@kylecarbs@greyscaled@misskniss

[8]ページ先頭

©2009-2025 Movatter.jp