Skip to content

feat: show GitHub username after PAT validation in gitt miner post - #1005

Merged
anderdc merged 9 commits into
entrius:testfrom
wdeveloper16:feat/show-github-login-after-pat-validation
May 9, 2026
Merged

feat: show GitHub username after PAT validation in gitt miner post#1005
anderdc merged 9 commits into
entrius:testfrom
wdeveloper16:feat/show-github-login-after-pat-validation

Conversation

@wdeveloper16

Copy link
Copy Markdown
Contributor

Summary

  • _validate_pat_locally already calls GET /user to verify the PAT — the response includes a login field that was being discarded
  • Return the login instead of a bare bool, and surface it in the confirmation line: PAT is valid. GitHub account: @your-username
  • Add github_login to the --json-output result object
  • No additional API call — zero performance impact

Closes #1004

Test plan

  • gitt miner post with a valid PAT shows the correct GitHub username
  • gitt miner post with an invalid PAT still exits with the error message
  • gitt miner post --json-output includes github_login in the response
image

@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label May 5, 2026
@wdeveloper16
wdeveloper16 force-pushed the feat/show-github-login-after-pat-validation branch 3 times, most recently from d404904 to 687ddd3 Compare May 5, 2026 21:51
@wdeveloper16

Copy link
Copy Markdown
Contributor Author

@anderdc
Please review the PR when you have a chance.

@wdeveloper16
wdeveloper16 force-pushed the feat/show-github-login-after-pat-validation branch from 687ddd3 to 5e40f64 Compare May 6, 2026 17:47
@wdeveloper16

wdeveloper16 commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @anderdc,
Could you please review this PR?

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. 🙂

@wdeveloper16
wdeveloper16 force-pushed the feat/show-github-login-after-pat-validation branch 4 times, most recently from 959955c to f008c2f Compare May 7, 2026 19:09
@wdeveloper16
wdeveloper16 force-pushed the feat/show-github-login-after-pat-validation branch from f008c2f to 465864e Compare May 8, 2026 02:19
- 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.
@wdeveloper16

Copy link
Copy Markdown
Contributor Author

Hi, @anderdc
Could you please review the PR?

@anderdc
anderdc merged commit bc80882 into entrius:test May 9, 2026
3 checks passed
@anderdc

anderdc commented May 9, 2026

Copy link
Copy Markdown
Collaborator

stop direct messaging me multiple times in PR threads. I will close your PRs for spam next time

@wdeveloper16

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: show GitHub username after PAT validation in gitt miner post

2 participants