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 crontab package for supporting autostart/stop.#844

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 9 commits intomainfromcj/crontabtz
Apr 4, 2022

Conversation

johnstcn
Copy link
Member

This is basically a small wrapper around robfig/cron/v3.

Fixes#817.

This is basically a small wrapper around robfig/cron/v3.Fixes#817.
@johnstcnjohnstcn self-assigned thisApr 4, 2022
@codecov
Copy link

codecovbot commentedApr 4, 2022
edited
Loading

Codecov Report

Merging#844 (32f0cb2) intomain (315676b) willincrease coverage by0.12%.
The diff coverage is83.33%.

@@            Coverage Diff             @@##             main     #844      +/-   ##==========================================+ Coverage   65.72%   65.85%   +0.12%==========================================  Files         202      203       +1       Lines       13209    13227      +18       Branches       87       87              ==========================================+ Hits         8681     8710      +29+ Misses       3637     3626      -11  Partials      891      891
FlagCoverage Δ
unittest-go-65.40% <83.33%> (+0.20%)⬆️
unittest-go-macos-latest52.37% <83.33%> (+0.07%)⬆️
unittest-go-ubuntu-latest55.11% <83.33%> (+0.02%)⬆️
unittest-go-windows-202251.77% <83.33%> (-0.02%)⬇️
unittest-js62.63% <ø> (ø)
Impacted FilesCoverage Δ
coderd/autostart/schedule/schedule.go83.33% <83.33%> (ø)
provisionersdk/serve.go35.13% <0.00%> (-8.11%)⬇️
cli/cliui/agent.go77.19% <0.00%> (-5.27%)⬇️
coderd/workspaceresources.go59.34% <0.00%> (-1.63%)⬇️
peerbroker/proxy.go57.55% <0.00%> (-0.59%)⬇️
provisionerd/provisionerd.go79.29% <0.00%> (+0.14%)⬆️
peer/conn.go79.44% <0.00%> (+0.76%)⬆️
provisioner/echo/serve.go56.80% <0.00%> (+2.39%)⬆️
coderd/provisionerdaemons.go62.05% <0.00%> (+2.52%)⬆️
provisionersdk/transport.go85.10% <0.00%> (+6.38%)⬆️

Continue to review full report at Codecov.

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

@johnstcnjohnstcn marked this pull request as ready for reviewApril 4, 2022 11:34
Copy link
Member

@kylecarbskylecarbs left a comment

Choose a reason for hiding this comment

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

I'm nervous about generalizing a CRON package with the single use-case in mind. It's not that this is the wrong abstraction, but it's guesswork on my part to tell if it's the right one since it's not plugged into anything.

You likely have a clearer picture of how this will play out than I do, so I shall approve regardless. It looks well tested and structurally aligned, but it's hard to truly know until we use it!


// WeeklySchedule represents a weekly cron schedule.
// It's essentially a thin wrapper for robfig/cron/v3 that implements Stringer.
type WeeklySchedule struct {
Copy link
Member

Choose a reason for hiding this comment

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

This weekly schedule feels pretty specified to autostart/stop. Could we add this to the autostart/stop package once that's in (assuming it'll be inside it's own package)?

greyscaled and johnstcn reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

Also, I'm not sure this needs to haveWeekly as a prefix. That seems like part of the parsing logic, not the struct functionality.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I can move this tocoderd/autostart/schedule if that works?

Copy link
Member

Choose a reason for hiding this comment

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

Based on what's here, I'd say that makes sense. I'm uncertain what structurally makes sense until we have more of the implementation worked out, but as long as we're not opposed to moving this afterwards, I'm good with it!

@johnstcnjohnstcn merged commit8a1ae18 intomainApr 4, 2022
@johnstcnjohnstcn deleted the cj/crontabtz branchApril 4, 2022 20:34
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

@kylecarbskylecarbskylecarbs approved these changes

@f0sself0sself0ssel left review comments

@deansheatherdeansheatherdeansheather approved these changes

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
V2 Beta
Development

Successfully merging this pull request may close these issues.

create cron-style library or wrapper for workspace autostart / autostop
5 participants
@johnstcn@kylecarbs@deansheather@f0ssel@misskniss

[8]ページ先頭

©2009-2025 Movatter.jp