-
Notifications
You must be signed in to change notification settings - Fork 13
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
Initial attempt at a generic webhook for reports. #50
Conversation
Background submission to a notification server that doesn't block rageshake submission.
I'm unsure what the WriteTo error in linting is about at the moment; I haven't adjusted that method or changed calls to it (as far as I'm aware). |
Ah, ignore me (ish). Locally, scripts/lint.sh is reporting:
From the go vet incantation But the actual error in CI is coming from gocyclo complaining that main.go is at 13 now, not sure why go vet isn't reporting/running in CI the same as locally. |
If 8e00140 is a reasonable pattern, i could replicate for the other config handling sections |
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.
seems generally plausible
721f119
to
4e3eeec
Compare
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.
lgtm otherwise
submit.go
Outdated
// Enrich the parsedPayload with a reportURL and listingURL, to convert a single struct | ||
// to JSON easily | ||
genericHookPayload := genericWebhookPayload{ | ||
parsedPayload: p, | ||
ReportURL: reportURL, | ||
ListingURL: listingURL, | ||
} |
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.
hoist outside the loop, since it's independent?
(But keep making bytes.Buffer multiple times as these is read from by each http request)
Background submission to a notification server that doesn't block rageshake submission.
Timeout requests after 300s (to provide some wiggle room for servers that choose to take action inline)
Add docs on the format of the endpoint (though much of it is pass-through so there is no fixed schema in most cases)