Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Bot might recursively trigger itself when posting a comment #256

Closed
joao-paulo-parity opened this issue Mar 22, 2021 · 0 comments · Fixed by #261
Closed

Bot might recursively trigger itself when posting a comment #256

joao-paulo-parity opened this issue Mar 22, 2021 · 0 comments · Fixed by #261
Assignees

Comments

@joao-paulo-parity
Copy link
Contributor

Happened in paritytech/substrate#8409

The current assumption is as follows:

  1. The bot reacts to "Issue Comment Created" events. The code triggered by this event makes it analyze the PR.
  2. The API data was missing some expected field, therefore it posted "check the error logs".
  3. The bot's comment triggered another "Issue Comment Created" event, then it goes back to step 1.

Straightforward fix is to ignore comments by bots, therefore it won't be able to re-trigger itself during scenarios like that.


Also as shown by the logs:

[2021-03-21T13:58:35Z ERROR parity_processbot::webhook] Source: Source: error decoding response body: invalid type: null, expected struct HeadRepo at line 1 column 5799

Clearly one of the fields is incorrectly being decoded as non-optional. It might be safer eventually move all fields to Option to ensure all missing information scenarios are handled gracefully in case e.g. the Github API changes without notice (paritytech/opstooling#96).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant