Hi Kenneth,

Kenneth Hoste <[email protected]> writes:

> Hi Loris,
>
> Two things are needed in order for --new-pr to work:
>
> 1) You need a GitHub token available, which allows EasyBuild to take care of
> actually opening the pull request for you (it basically avoids having to use 
> the
> GitHub web interface for doing that);
>
> 2) You need to have an SSH key available that allows you to push a branch in
> your fork of the easybuild-easyconfigs GitHub repository.
>
> In your case, 2) is fine, 1) is not (as shown by --check-github).
>
>
> There's a variety of reasons why the token may not be available:
>
> Do you have 'keyring' Python package installed? Check with "python -c 'import
> keyring'.

This works.

> Is the token installed in this account? (if not, use "eb
> --install-github-token")

Yes.

> Is keyring able to access the saved token?
> If your keyring installation is recent enough, you can try getting the saved
> token using:
>
>     python -m keyring get github_token GITHUB_USER
>
> (where you replace GITHUB_USER_NAME with, you guessed it, your GitHub user 
> name)

That gave the error

  /usr/bin/python: No module named keyring.__main__; 'keyring' is a package and 
cannot be directly executed

but was able to do the following (which you sent me last time I was
struggling with the Github integration):

  [build@admin ~]$ python
  Python 2.7.5 (default, Nov 16 2020, 22:23:17) 
  [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import getpass, keyring
  >>> keyring.get_password("github_token", "tardigradus")
  Please enter password for encrypted keyring: 
  u'my_secret_token'

> Note: if you share the results of these tests, be careful to not accidentally
> share your GitHub token... ;)

So everything seems to work.  Even the new PR was created, but I just
seem to be getting spurious error messages.  Very odd.

Cheers,

Loris

>
>
> regards,
>
> Kenneth
>
> On 08/06/2022 15:18, Loris Bennett wrote:
>> Hi,
>> In the past I have successfully submitted new PRs.  However, when I tried
>> today, I got:
>>    [build@admin ~]$ eb --new-pr --git-working-dirs-path=~/git
>> --github-user=tardigradus --pr-commit-msg="{data}[foss-2021b] RStan v2.21.5 
>> w/
>> R 4.1.2" ~/easyconfigs/RStan-2.21.5-foss-2021b-R-4.1.2.eb
>>    == Temporary log file in case of crash 
>> /tmp/eb-mp19jq6s/easybuild-_u_eolj6.log
>>    == found valid index for 
>> /trinity/shared/easybuild/software/EasyBuild/4.5.5/easybuild/easyconfigs, so 
>> using it...
>>    == found valid index for 
>> /trinity/shared/easybuild/software/EasyBuild/4.5.5/easybuild/easyconfigs, so 
>> using it...
>>    == fetching branch 'develop' from 
>> https://github.com/easybuilders/easybuild-easyconfigs.git>>    == copying 
>> files to /tmp/eb-mp19jq6s/git-working-dir9yzypblw/easybuild-easyconfigs...
>>    == pushing branch '20220608140722_new_pr_RStan2215' to remote 
>> 'github_tardigradus_SbVOR' 
>> ([email protected]:tardigradus/easybuild-easyconfigs.git)
>>    ERROR: GitHub token for user 'tardigradus' must be available to open a 
>> pull request
>> Running
>>    eb --check-github  --github-user=tardigradus
>> gave
>>    == Temporary log file in case of crash
>> /tmp/eb-qoptphw6/easybuild-t_h6dk5i.log
>>    Checking status of GitHub integration...
>>    Making sure we're online...OK
>>    * GitHub user...tardigradus => OK
>>    * GitHub token...(no token found) => FAIL
>>    * git command...OK ("git version 1.8.3.1; ")
>>    * GitPython module...OK (GitPython version 1.0.2)
>>    * push access to tardigradus/easybuild-easyconfigs repo @ GitHub...OK
>>    * creating gists...FAIL (gist_url: None)
>>    * location to Git working dirs... not found (suboptimal)
>> I thought the token was needed primarily for the push, which worked.  To
>> actually create the PR I had to press a button in Github, which I don't
>> remember having done in the past.
>> Does anyone know what the issue might be?
>> Cheers,
>> Loris
>> 

Reply via email to