Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add autostart/autostop show, show autostart/autostop schedule in ls output #1436

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2022

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented May 13, 2022

Slipped my mind to do this before 🤦

Closes #1431

@johnstcn johnstcn requested a review from a team May 13, 2022 18:33
@johnstcn johnstcn self-assigned this May 13, 2022
@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #1436 (4f994cb) into main (9410237) will decrease coverage by 0.22%.
The diff coverage is 47.50%.

@@            Coverage Diff             @@
##             main    #1436      +/-   ##
==========================================
- Coverage   67.26%   67.04%   -0.23%     
==========================================
  Files         288      284       -4     
  Lines       19422    19297     -125     
  Branches      244      244              
==========================================
- Hits        13065    12938     -127     
- Misses       5019     5020       +1     
- Partials     1338     1339       +1     
Flag Coverage Δ
unittest-go-macos-latest 54.28% <47.50%> (+0.16%) ⬆️
unittest-go-postgres- 65.52% <47.50%> (-0.23%) ⬇️
unittest-go-ubuntu-latest 56.49% <47.50%> (-0.12%) ⬇️
unittest-go-windows-2022 ?
unittest-js 75.26% <ø> (ø)
Impacted Files Coverage Δ
cli/autostart.go 66.37% <43.75%> (-8.63%) ⬇️
cli/list.go 46.42% <45.45%> (-0.64%) ⬇️
cli/autostop.go 66.37% <51.35%> (-8.32%) ⬇️
provisionersdk/serve.go 35.13% <0.00%> (-8.11%) ⬇️
cli/configssh.go 62.58% <0.00%> (-6.48%) ⬇️
pty/ptytest/ptytest.go 86.95% <0.00%> (-4.35%) ⬇️
cli/templateinit.go 58.62% <0.00%> (-3.45%) ⬇️
peer/conn.go 78.86% <0.00%> (-2.71%) ⬇️
coderd/workspaceagents.go 56.04% <0.00%> (-1.87%) ⬇️
agent/agent.go 65.28% <0.00%> (-1.86%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9410237...4f994cb. Read the comment docs.

Copy link
Contributor

@dwahler dwahler left a comment

Choose a reason for hiding this comment

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

Couple of minor issues with the message formatting, but other than that LGTM.

cli/autostart.go Outdated
}

if workspace.AutostartSchedule == "" {
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "not enabled")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this and some of the other fmt.Fprintf calls in autostart.go and autostop.go are missing trailing newlines.

Copy link
Member Author

Choose a reason for hiding this comment

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

whoops!

cli/autostart.go Outdated
return nil
}

_, _ = fmt.Fprintf(cmd.OutOrStdout(), "\nschedule: %s\nnext: %s\n", workspace.AutostartSchedule, validSchedule.Next(time.Now()))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any particular reason for printing an extra blank line at the beginning?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably because I yanked the line from somewhere else and forgot to clean it up 🙃

@johnstcn johnstcn enabled auto-merge (squash) May 13, 2022 18:49
@johnstcn johnstcn merged commit f970829 into main May 13, 2022
@johnstcn johnstcn deleted the cj/gh-1431/cli-show-autostart-autostop branch May 13, 2022 19:03
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
…n ls output (#1436)

* feat: add autostart/autostop show, show autostart/autostop schedule in ls output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cli: No way to view auto start after it's set
3 participants