smarkets / marge-bot

A merge-bot for GitLab
BSD 3-Clause "New" or "Revised" License
701 stars 136 forks source link

Marge Bot is logging PAT while fetching the repository #357

Open Sayrus opened 2 years ago

Sayrus commented 2 years ago

While investigating https://github.com/smarkets/marge-bot/issues/356, I've stumbled upon logs from marge-bot:

2022-11-03 15:34:03,871 WARNING stderr: b"Cloning into '/tmpmpkpi0fl/tmpcefl0htl'...\nfatal: unable to access 'https://oauth2:glpat-censored@my.domain/repo.git/': SSL certificate problem: certificate has expired\n"

While the log is coming from the Git subprocess, the raw is forwarded to stderr due to how the subprocess pipes are configured. Is this the intended behavior?

This also happens on success as INFO logs pushed directly by marge-bot:

2022-11-10 14:53:17,436 INFO Running git clone --origin=origin https://oauth2:glpat-censored@my.domain/repo.git  /tmpnbm4i1nu/tmptcybhz__