Closed NotMyself closed 7 years ago
I think the problem is in the perception around wt cron schedule
command. This command is not an update, it is a complete re-create of the CRON job. This means secrets must be re-specified.
The wt update
only updates code as far as I know.
Agreed, I think this is an indication we need a wt cron update
command.
A cheap improvement could be to introduce wt cron create
and deprecate wt cron schedule
It seems weird that there is no easy way to update a cron schedule. It is pretty easy to typo 1 * * * *
when what you really mean is * * * * *
and there is no simple way to fix it without destroying your webtask.
What about wt cron update [--schedule new_schedule] [--state new_state]
sub-command?
I think the pair of wt cron create
& wt cron update
are clear in their intention and might reduce confusion.
If we take the approach proposed by @tjanczuk here: https://github.com/auth0/wt-cli/issues/155#issuecomment-331230067, I would also change wt cron create
's signature to have the schedule as an option instead of a positional argument.
Verified fixed in 7.0.1
A customer reported issue: https://auth0.zendesk.com/agent/tickets/27553
Steps to Reproduce
Via CLI
wt cron schedule "1 * * * *" foo.js --secret FOO=BAR
wt inspect foo --decrypt
wt update foo foo.js
wt inspect foo --decrypt
wt cron schedule "* * * * *" foo.js
wt inspect foo --decrypt
Result
The schedule has changed but the secrets have been removed.
Expected Result
Secrets should be maintained for CRON schedule updates.
Comments
There appears to be no way to simply update the CRON schedule via the CLI. The CRON command appears to be destructive for an existing webtask. It will clear secret, meta ect values if not supplied every time.
The editor appears to hide this from you by always supplying these values. The CLI does not which is confusing for users.