feat: show GitHub username after PAT validation in gitt miner post - #1005
Conversation
d404904 to
687ddd3
Compare
|
@anderdc |
687ddd3 to
5e40f64
Compare
|
Hi @anderdc, I felt a bit concerned when submitting my PAT to the validators because I couldn’t see the associated GitHub username. I recall that the username might have been visible when submitting a PAT previously, though I’m not entirely sure. It would be really helpful if we could display the GitHub username immediately after submitting the PAT, so we can confirm that it belongs to the correct GitHub account registered on subnet 74. 🙂 |
959955c to
f008c2f
Compare
f008c2f to
465864e
Compare
- Fix _status() and _print() calls in post.py that still passed json_mode after helpers.py removed that parameter (routing to err_console instead) - Use CliRunner(mix_stderr=False) so result.stdout captures only JSON in --json-output mode, compatible with Click 8.1.x and 8.2+ - Mock click.prompt in test_no_pat_prompts_interactively to avoid getpass.getpass opening /dev/tty and blocking indefinitely - Assert github_login in JSON envelope test to cover new PR field - Check result.stderr for error messages (now routed there via err_console)
CliRunner.mix_stderr was removed in Click 8.3 — streams are always separate there. CI venv uses Click 8.3 so mix_stderr caused a TypeError.
|
Hi, @anderdc |
|
stop direct messaging me multiple times in PR threads. I will close your PRs for spam next time |
Okay, will never ping you in the future, thanks for your review. |
Summary
_validate_pat_locallyalready callsGET /userto verify the PAT — the response includes aloginfield that was being discardedbool, and surface it in the confirmation line:PAT is valid. GitHub account: @your-usernamegithub_loginto the--json-outputresult objectCloses #1004
Test plan
gitt miner postwith a valid PAT shows the correct GitHub usernamegitt miner postwith an invalid PAT still exits with the error messagegitt miner post --json-outputincludesgithub_loginin the response