-
Notifications
You must be signed in to change notification settings - Fork 611
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
feat(workers): allow enabling logpush on worker uploads #1160
feat(workers): allow enabling logpush on worker uploads #1160
Conversation
Re:
|
changelog detected ✅ |
Codecov Report
@@ Coverage Diff @@
## master #1160 +/- ##
==========================================
- Coverage 49.40% 49.33% -0.07%
==========================================
Files 127 128 +1
Lines 12290 12408 +118
==========================================
+ Hits 6072 6122 +50
- Misses 4840 4885 +45
- Partials 1378 1401 +23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
workers_test.go
Outdated
logpush := true | ||
res, err := client.UploadWorker(context.Background(), AccountIdentifier(testAccountID), CreateWorkerParams{ScriptName: "foo", Script: workerScript, Logpush: &logpush}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logpush := true | |
res, err := client.UploadWorker(context.Background(), AccountIdentifier(testAccountID), CreateWorkerParams{ScriptName: "foo", Script: workerScript, Logpush: &logpush}) | |
res, err := client.UploadWorker(context.Background(), AccountIdentifier(testAccountID), CreateWorkerParams{ScriptName: "foo", Script: workerScript, Logpush: BoolPtr(true)}) |
we have BoolPtr
helper to simlify this sort of usage.
This functionality has been released in v0.58.0. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
This allows cloudflare-go users to turn on/off logpush support for Cloudflare Workers.
The analogous functionality in Wrangler can be found here: https://github.com/cloudflare/wrangler2/blob/7169142171b1c9b4ff2f19b8b46871932ef7d10a/packages/wrangler/src/create-worker-upload-form.ts#L294
Description
This adds a new option to
CreateWorkerParams
that allows control over the logpush setting. Note its a nullable bool: the 3 states are true - on / false - off / nil - unchanged. Again, this is analogous to wrangler with itsboolean | undefined
type.Has your change been tested?
A new test was created to test this.
Screenshots (if appropriate):
Types of changes
What sort of change does your code introduce/modify?
Checklist: