Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Installing extension from private Gitlab repository #5827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kamapu opened this issue Jun 6, 2023 · 15 comments
Open

Installing extension from private Gitlab repository #5827

kamapu opened this issue Jun 6, 2023 · 15 comments
Assignees
Labels
enhancement New feature or request extensions relates to Quarto extensions mechanism
Milestone

Comments

@kamapu
Copy link

kamapu commented Jun 6, 2023

Bug description

I am having troubles by adding extensions from a GitLab repo, which I am developing. The extension seems to be downloaded but it fails when unzipping the zip-file.

Steps to reproduce

quarto add https://gitlab.cc-asp.fraunhofer.de/quarto-extensions/mdz/-/archive/main/shorty-main.zip

Expected behavior

The installed extension.

Actual behavior

An error message is retrieved:

Quarto extensions may execute code when documents are rendered. If you do not 
trust the authors of the extension, we recommend that you do not install or 
use the extension.
 ? Do you trust the authors of this extension (Y/n) › Yes
[✓] Downloading
(|) Unzipping
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
[✓] Unzipping
ERROR: Failed to unzip extension.

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Your environment

  • IDE: VScode
  • OS: Ubuntu

Quarto check output

[✓] Checking Quarto installation......OK
      Version: 1.2.335
      Path: /opt/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.6
      Path: /usr/bin/python3
      Jupyter: 5.1.5
      Kernels: ir, python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.1.2
      Path: /usr/lib/R
      LibPaths:
        - /home/miguel/R/x86_64-pc-linux-gnu-library/4.1
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      rmarkdown: 2.20

[✓] Checking Knitr engine render......OK
@kamapu kamapu added the bug Something isn't working label Jun 6, 2023
@mcanouil
Copy link
Collaborator

mcanouil commented Jun 6, 2023

Thank you for reporting this.

First, could you upgrade Quarto to 1.3?

Could you try to use a tar.gz archive instead?
Could you try to install an extension from GitHub, e.g., quarto add https://github.com/mcanouil/quarto-lua-env/archive/refs/heads/main.zip? (This is working for me and since your extension is not public, I can't test a zip from and made by GitLab).

Note:

Depending on the page, it's not obvious if zip is supposed to work or not.

@mcanouil mcanouil added the documentation Doc improvements & quarto-web label Jun 6, 2023
@mcanouil
Copy link
Collaborator

mcanouil commented Jun 6, 2023

This is possibly related to #2419 and #2081

@mcanouil mcanouil added extensions relates to Quarto extensions mechanism triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. labels Jun 6, 2023
@kamapu
Copy link
Author

kamapu commented Jun 7, 2023

Thanks @mcanouil for the prompt response. I hope, you will still consider installing extensions from GitLab since I'm obliged to develop in the own institution. Otherwise I had already met people in our own premises, who are very interested on development and use of quarto extensions. Of course, it implies an additional effort for you and respect the focus on GitHub.

@mcanouil
Copy link
Collaborator

mcanouil commented Jun 7, 2023

It's supposed to work.

There is two things here:

  • some inconsistencies in the documentation
  • issues with handling zip file made by GitLab

This is why I wanted you to try to install an extension as zip from GitHub, i.e., to rule out something fishy in your setup.

@kamapu
Copy link
Author

kamapu commented Jun 7, 2023

Sorry, @mcanouil. I just realized that the project was by mistake private, now I made it public and you could test:

quarto add https://gitlab.cc-asp.fraunhofer.de/quarto-extensions/mdz/-/archive/main/shorty-main.zip

@kamapu
Copy link
Author

kamapu commented Jun 7, 2023

Sorry, @mcanouil. I just realized that the project was by mistake private, now I made it public and you could test:

quarto add https://gitlab.cc-asp.fraunhofer.de/quarto-extensions/mdz/-/archive/main/shorty-main.zip

... and this was the solution. After making it public, I managed to install the extension 🥳 .

@mcanouil
Copy link
Collaborator

mcanouil commented Jun 7, 2023

Could you update the title to highlight the "private repo" aspect?

@mcanouil
Copy link
Collaborator

mcanouil commented Jun 7, 2023

In the end it's related to the following feature request to handle private repositories, see #4444

@cderv cderv changed the title Error using quarto add for a GitLab repo Installing extension private Gitlab repository Jun 7, 2023
@cderv cderv changed the title Installing extension private Gitlab repository Installing extension from private Gitlab repository Jun 7, 2023
@kamapu
Copy link
Author

kamapu commented Jun 7, 2023

I think, this issue may be closed.

@kamapu kamapu closed this as completed Jun 7, 2023
@mcanouil mcanouil reopened this Jul 20, 2023
@mcanouil
Copy link
Collaborator

Reopening this as it's still not possible to install from private repository as far as I can tell.

@mcanouil mcanouil added enhancement New feature or request and removed bug Something isn't working documentation Doc improvements & quarto-web labels Jul 20, 2023
mcanouil added a commit to mcanouil/quarto-web that referenced this issue Jul 20, 2023
@mcanouil
Copy link
Collaborator

I made a PR to clarify #5827 (comment).

@mcanouil
Copy link
Collaborator

As suggested initially by @cderv (#4444 (comment)) it would be great if Quarto was able to leverage usual credentials store.

For GitHub:

For GitLab:

@dragonstyle dragonstyle added this to the v1.5 milestone Sep 20, 2023
@aronatkins
Copy link
Contributor

Another vote for extension installation from a private repository. If possible, use existing configuration (credentials, SSH keys, etc) to obtain the targeted extension from the Git repository.

If it helps, adding a private repository could require the full repository path, leaving the "username/repo" syntax for extensions in public repositories.

quarto add [email protected]:company/private-extension.git

@dragonstyle dragonstyle modified the milestones: v1.5, v1.6 Feb 15, 2024
@dragonstyle dragonstyle removed their assignment Feb 19, 2024
@cscheid cscheid modified the milestones: v1.6, v1.7 Nov 18, 2024
@cscheid cscheid removed the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Apr 2, 2025
@cscheid cscheid modified the milestones: v1.7, Future Apr 2, 2025
@mcanouil
Copy link
Collaborator

mcanouil commented May 1, 2025

As a workaround which can be applied to any setup/host:

export GIT_PAT=...
  • using Git
git clone --depth 1 "https://${GIT_PAT}@github.com/organisation/repository.git" /tmp/quarto-extension
quarto add /tmp/quarto-extension
rm -rf /tmp/quarto-extension
  • using CURL
curl -L -H "Authorization: token ${GIT_PAT}" \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/organisation/repository/zipball/main \
  -o /tmp/quarto-extension.zip
quarto add /tmp/quarto-extension.zip
rm -rf /tmp/quarto-extension.zip

Use your preferred authentication method, especially for git clone: SSH, https via credentials store, or as above via a token.

@cderv cderv self-assigned this May 2, 2025
@mcanouil
Copy link
Collaborator

mcanouil commented May 2, 2025

In some aspects related to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request extensions relates to Quarto extensions mechanism
Projects
None yet
Development

No branches or pull requests

6 participants