pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.33k stars 337 forks source link

[Bug]: installation of extensions from private repo is not working in the UI #2220

Open jmcouffin opened 7 months ago

jmcouffin commented 7 months ago

✈ Pre-Flight checks

🐞 Describe the bug

image

For context the username and password access was dropped by GitHub for a token system. The cli has been fixed a few years ago but the extension manager is not working with private repos nor saving the token when input in the password text box.

⌨ Error/Debug Message

ERROR [Extensions] Error installing package. | remote authentication required but no callback set

Traceback: File "C:\Users\XXX\AppData\Roaming\pyRevit-Master\extensions\pyRevitCore.extension\pyRevit.tab\pyRevit.panel\Extensions.smartbutton\script.py", line 405, in install_ext_pkg extpkgs.install(self.selected_pkg.ext_pkg,

♻️ To Reproduce

-

⏲️ Expected behavior

-

🖥️ Hardware and Software Setup (please complete the following information)

Any

Additional context

No response

aymanokail commented 7 months ago

i have been testing the fine-grained token and the classic token, both have the same error

jmcouffin commented 7 months ago

i have been testing the fine-grained token and the classic token, both have the same error

can you provide a screen capture of the pyrevit extensions manager UI + the lines of the pyrevit-config file located in %appdata%/pyrevit/ especially the ones with your extensions details to see if it is set to private and if there is a password set.

aymanokail commented 6 months ago

Hello @jmcouffin

here is the screen shot for the error image

when i use the CLI with access token it works fine, with the below command pyrevit extend ui XXX "https:XXX.git" --dest="%AppData%\pyRevit\Extensions" --token="XXXXXX"

but in the Pyrevit extension manager UI with the same token, it gives this error And you can find below the lines of the config file as requested, the last repo in the config "XXX" i tried to change private_repo = true, it does not work, and also if i add my actual username and password or actual user name and token in the config file, same error arrives

[core]
bincache = true
checkupdates = false
rocketmode = true
debug = false
verbose = false
filelogging = false
startuplogtimeout = 10
requiredhostbuild = ""
minhostdrivefreespace = 0
loadbeta = false
cpyengine = 385
userextensions = ["C:\\Users\\XXX\\AppData\\Roaming\\pyRevit\\Extensions","C:\\XXX\\France Projects\\XXX"]
user_locale = "en_gb"
colorize_docs = false
tooltip_debug_info = false

[telemetry]
utc_timestamps = true
active = false
telemetry_file_dir = ""
telemetry_server_url = ""
include_hooks = false
active_app = false
apptelemetry_server_url = ""
apptelemetry_event_flags = "0x0"

[environment]

[pyRevitBundlesCreatorExtension.extension]
disabled = true
private_repo = true
username = ""
password = ""

[pyRevitCore.extension]
disabled = false
private_repo = true
username = ""
password = ""

[pyRevitDevHooks.extension]
disabled = true
private_repo = true
username = ""
password = ""

[pyRevitDevTools.extension]
disabled = true
private_repo = true
username = ""
password = ""

[pyRevitTags.extension]
disabled = true
private_repo = true
username = ""
password = ""

[pyRevitTemplates.extension]
disabled = true
private_repo = true
username = ""
password = ""

[pyRevitTools.extension]
disabled = false
private_repo = true
username = ""
password = ""

[pyRevitTutor.extension]
disabled = true
private_repo = true
username = ""
password = ""

[routes]
enabled = false
core_api = false

[tabcoloring]
sort_colorize_docs = false
tabstyle_index = 0
family_tabstyle_index = 4
tab_colors = ["#FFF39C12","#FF2C3E50","#FF0000FF","#FF8B4513","#FFFFD700","#FF00CED1","#FFFF4500","#FF00FFFF","#FF9ACD32","#FFFF1493"]
tab_filtercolors = {}

[XXX.extension]
disabled = false
private_repo = false
username = ""
password = ""
aymanokail commented 6 months ago

hello @jmcouffin

when i try to clone my private repo from our company local git platform, or private github repo through CMD with normal git commands (out of pyrevit CLI) it works with this command but i must make sslVerify=false to work. i do not know if this is the issue or not with github private repo in the Pyrevit extension manager UI.

here is the code working in a bat script file with CMD with normal git commands instead of pyrevit CLI which request my sign in credentials after running the command, then it clone successfully the repo:

@Echo Off
winget install --id Git.Git -e --source winget
cd %AppData%\pyRevit\Extensions
git -c http.sslVerify=false clone https://XXX/XXX.git

ren "XXX" "XXX.extension"

the idea in this solution that it doesn't update if i commit new changes, users must delete the current extension folder manually and re run this batch script file to re clone the the updated repo once each time we have a new revision of the plugin.

so what i wish to do , is to use the the normal Pyrevit extension manager UI , to clone my private repo from github or any other git platform so it update automatically if i do any modification for the code.

sanzoghenzo commented 4 months ago

Hi @aymanokail, unfortunately we still have to tackle pyRevit's git issues, but I can offer a workaround based on your script:

set dest=%AppData%\pyRevit\Extensions\XXX.extension
git -C %dest% pull || git -c http.sslVerify=false clone https://XXX/XXX.git %dest%

the pull might fail for reasons other than the missing/empty folder, but it's a start; You may add a git -C %dest% fetch origin master && git -C %dest% reset --hard origin/master to overwrite any local edits (but then the control flow would be more complex than a simple ||).