Daily cronjob: first iteration #52
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a
/cron_daily
route that can be used to perform polling based PR maintenance.With this first iteration the bot supports three features:
mergeable
- it's only available in the GH API when the PR is requested directly): -> label: "needs rebase"status
GH API - at the moment the settings is conservative as it requires at the minimum two failed CIs to be detected as such) -> label: "needs work"The bot just adds or removes labels that match these detected states. With #51 the Dlang-Bot can also automatically remove e.g. the "needs rebase" label on a rebase event.
The main advantage of just using labels to mark "states" of a PR is that it doesn't trigger a notification and also it's a rather safe playground for the first iteration.
Other notes
CRON_DAILY_SECRET
variable. However as the bot is hosted with SSL-enabled, that should do the trickupdated_at
field for PR isn't equivalent to this one (it seems that the PRupdated_at
gets set by a couple of other things), (2) the IssueList also contains the connected labels and (3) the IssueList is a lot smaller and thus faster to loadOther Changes
commits
) and (b) more fieldsrunTask
is hard-coded to be 128 bytes(a) and the payload file exists: the fileserver continues to send his reply and the expected payload (allows to set custom response headers)
(b) and the payload doesn't exist: the request is finished with
writeVoidBody
(removed a lot of boiler-plate code)