lab132 / buildbot-gitea

Buildbot plugin for integration with gitea.
MIT License
62 stars 21 forks source link

Add commits to the changes list in reverse order. #10

Closed mrstanwell closed 3 years ago

mrstanwell commented 3 years ago

The gitea webhook list of pushed commits is in order from newest to oldest. If commits are appended to the changes array and returned, the last commit in the array will be the oldest commit in the push. However, buildbot treats the last change as the most recent. This means that unless you use 'alwaysUseLatest=True' in your Git step, the Git step will not check out the newest commit in the push. If you happen to be using 'shallow=True', this will actually cause the Git update step to fail because only the newest commit is available in a shallow checkout.

This update inserts each commit in the gitea webhook call at the beginning of the array, which means buildbot sees them in chronological order. A Git step with 'shallow=True' will now succeed.

pampersrocker commented 3 years ago

Yes, looks good to me. This is based on the gitlab hook implementation and indeed the gitlab hooks sends the events in the reverse order.

Thank you!

mrstanwell commented 3 years ago

Thank you for maintaining this plugin!