On Wed, Jan 6, 2021 at 6:58 AM Bruce Momjian <bruce@momjian.us> wrote:
> On Tue, Jan 5, 2021 at 11:21:07AM +1300, Thomas Munro wrote:
> > For the record, cfbot just uses plain old GNU patch, because that
> > seems to accept nearly everything that anyone posts here (after a step
> > that tries to unpack tarballs etc). Several people have suggested I
> > change it to use git apply instead (IIRC it works better for patches
> > containing binary files such as cryptographic keys?), but then it
> > wouldn't accept ye olde context diffs.
>
> Does Windows also use 'patch'? I think I saw Windows behave differently
> for file additions. Does the commit-fest app and cfbot both have the
> same criteria for recognizing attachments as patches? I don't think
> they do.
If you're asking if cfbot uses 'patch' on Windows, then no, the work
of finding and applying patches is done on a Un*x box (currently a
FreeBSD box of mine, maybe soon a Debian box in postgresql.org orbit).
Once that's done, it's pushed to a branch along with a CI control
file, which causes the CI system(s) to wake up and process it.
No, it doesn't use the CF app's patch recognition logic. It scrapes
the CF app's main page periodically to find out about registered
threads, and whenever it sees the "Latest mail" time change it reads
the thread via the archive URL to find the latest message that has an
attachment with a suffix matching
\\.(diff|diff\\.gz|patch|patch\\.gz|tar\\.gz|tgz|tar\\.bz2). It would
indeed be nice to integrate better, probably while switching from the
current web scraping regexfest[1] to a proper JSON HTTP endpoint.
[1] https://github.com/macdice/cfbot/blob/master/cfbot_commitfest_rpc.py