Skip to content

Conversation

@User21T
Copy link

@User21T User21T commented Nov 30, 2024

I have added requests and urllib3 packages in the first place to handle downloading files from Internet via Python script. Then I have rewritten code in pbsync/main.py to allow PBSync for automatic installation of GitHub CLI, Microsoft's Git and Git LFS. For more information see ticket #7.

First, the program checks whether GitHub CLI isn't already installed. If yes, then it proceeds forward. Otherwise, it starts downloading installation file for GH CLI. When downloading fails once, the program will repeat the process 5 times at most until passing. If download and installation process is successful, then Git and Git LFS are installed via GitHub CLI and terminal commands.

Workflow is improved, because we don't download separately by a browser. We can also repeat the version check/install process. Since we are repeating GitHub CLI download process, we don't have to terminate it because of temporary problems like no Internet connection.

Add automated installation of GitHub CLI (if not available), Microsoft's Git and Git LFS in regards to the operating system (Windows, Mac OS)
Add "requests" and "urllib3" package to handle GitHub CLI download
@User21T User21T changed the title Automatic install of GitHub CLI, Git and Git LFS (see ticket #7) Automatic install of GitHub CLI, Git and Git LFS Nov 30, 2024
@User21T User21T changed the title Automatic install of GitHub CLI, Git and Git LFS Automatic installation of GitHub CLI, Git and Git LFS Nov 30, 2024
@User21T User21T marked this pull request as draft December 5, 2024 19:20
@User21T User21T marked this pull request as ready for review December 5, 2024 19:21
@User21T User21T marked this pull request as draft December 5, 2024 19:21
@User21T User21T marked this pull request as ready for review December 5, 2024 19:21
Copy link
Member

@mastercoms mastercoms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for the most part, the upgraded download logic looks nice!

except FileNotFoundError:
return False

def install_gh_cli():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub CLI is expected to be in .github/git/gh.exe, please see pbgh.py. Though, I suppose we need to do some work to fix support for GitHub CLI while using repos on GitLab, since it uses GitLab CLI automatically in that case. So maybe forcing GitHub CLI is good there.

verboselogs = "*"
crcmod = "*"
tinyaes = "*"
requests = "*"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use urllib.request in other places, so if we are including the requests package, we should probably avoid importing urllib.request throughout.


default_config_name = "PBSync.xml"

retry_strategy = Retry(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make a new pbhttp module in pbpy?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants