Giter VIP home page Giter VIP logo

Comments (13)

whwright avatar whwright commented on July 23, 2024 1

I don't think I realized log_error exits the whole script when I wrote that PR:

My proposed solution:

  • Make a log_warning function which writes to stderr but does not exit the script
  • Use log_warning here instead of log_error
  • Add conditional to only log this warning if !args.organization

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

Ah yes, that is much more correct. I use a token as well, but added -u in testing this.

from python-github-backup.

whwright avatar whwright commented on July 23, 2024

I wrote my first comment hastily and it was incorrect (now deleted). I am looking at this.

from python-github-backup.

whwright avatar whwright commented on July 23, 2024

So as stated in my original comment your proposed solution is not correct, as it assumes you are using the --username option for basic auth which is not required.

I fail to see the issue here, if you are passing --organization option then

if args.organization:
template = 'https://{0}/orgs/{1}/repos'.format(
get_github_api_host(args),
args.user)

will be executed and override the template for an organization

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

Then the readme needs a bit of work, as it instructs you to:

github-backup WhiteHouse --token $ACCESS_TOKEN --organization --output-directory /tmp/white-house --repositories

Take this example I just ran:

+ pipenv run github-backup MYORG --token **** --prefer-ssh --private --output-directory=/hadoop/backups/github/github-backup --all
Authenticated user is different from user being backed up, thus private repositories cannot be accessed
Backing up user MYORG to /hadoop/backups/github/github-backup
Requesting https://api.github.com/user?per_page=100&page=1
Retrieving repositories

Why would this be failing then?

from python-github-backup.

whwright avatar whwright commented on July 23, 2024

I think the only issue is that

Authenticated user is different from user being backed up, thus private repositories cannot be accessed

is being logged incorrectly. Are private repos not being backed up? Is anything being backed up? I cannot tell what is written to disk from your log statement.

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

Nothing backs up as the process fails entirely. From Jenkins:

+ pipenv run github-backup MYORG --token **** --prefer-ssh --private --output-directory=/hadoop/backups/github/github-backup --all
Authenticated user is different from user being backed up, thus private repositories cannot be accessed
Backing up user MYORG to /hadoop/backups/github/github-backup
Requesting https://api.github.com/user?per_page=100&page=1
Retrieving repositories
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // stage
[Pipeline] hipchatSend
[INFO] HipChat notification sent to the following rooms: Jenkins
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
ERROR: script returned exit code 1
Finished: FAILURE

$ ls /hadoop/backups/github/github-backup/ | wc -l
0

Yes I figured the if conditional set needs a little update.

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

Are you drafting a PR for this fix? Just want to make sure I am not duplicating efforts.

from python-github-backup.

whwright avatar whwright commented on July 23, 2024

from python-github-backup.

whwright avatar whwright commented on July 23, 2024

I'll work on a PR this week

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

#103 still crashes my backups:

+ pipenv install --skip-lock github-backup
Installing github-backup…
Collecting github-backup
  Downloading https://files.pythonhosted.org/packages/a3/2c/1b571c0335507b47b0f21633b43c60996a078fa32d72d6f4514249e1fb93/github_backup-0.21.1-py2-none-any.whl
Installing collected packages: github-backup
Successfully installed github-backup-0.21.1
[...]

+ pipenv run github-backup MyOrg --token **** --prefer-ssh --private --output-directory=/backups/github/github-backup --all
Authenticated user is different from user being backed up, thus private repositories cannot be accessed
Backing up user MyOrg to /backups/github/github-backup
Requesting https://api.github.com/user?per_page=100&page=1
Retrieving repositories
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // stage
[Pipeline] hipchatSend
[INFO] HipChat notification sent to the following rooms: Jenkins
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s

from python-github-backup.

whwright avatar whwright commented on July 23, 2024

My PR has not been released yet

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

ah.. sorry. I thought it had been released. My mistake.

from python-github-backup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.