Skip to content
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

Unable to fetch private Bitbucket repository #104

Open
Jactami opened this issue Aug 31, 2023 · 5 comments
Open

Unable to fetch private Bitbucket repository #104

Jactami opened this issue Aug 31, 2023 · 5 comments

Comments

@Jactami
Copy link

Jactami commented Aug 31, 2023

Environment

Node: v18.15.0
Nuxt: v3.7.0

Reproduction

Using nuxt:

  1. Create a private Bitbucket repository
  2. Initialize a new nuxt project
  3. Extend your project with the Bitbucket repository (see code below)

Using pure giget:

  1. Create a private Bitbucket repository
  2. Try to fetch the private repository

Either way the fetch will fail

Describe the bug

I am working on a Nuxt Layers project. Nuxt uses uses unjs/giget internally to fetch remote git repositories, but is unable to fetch private Bitbucket repositories. I already raised an issue at the Nuxt repository, but was forwarded to create an issue here.

nuxt setup:

  • .env-file:
GIGET_AUTH=XXXXXXXXXXXXXXXX`
  • nuxt.config.ts:
export default defineNuxtConfig({
 extends: [
   'bitbucket:user_name/project_name#branch_name', 
 ],
 // ...
})



Internally unjs/giget converts this to https://bitbucket.org/user_name/project_name/get/branch_name.tar.gz.
If I try to execute this with npx, the fetch fails:

npx giget@latest https://bitbucket.org/user_name/project_name/get/branch_name.tar.gz --auth XXXXXXXXXXXXXXXX

In my opionion something like https://api.bitbucket.org/2.0/repositories/user_name/project_name/src/branch_name/ would be more correct.


I found an issue for private Github repos which seems pretty similar to my problem. The issue was fixed but is not published yet. Someone also already addressed the problem with private Bitbucket repositories. However the response was insufficient to me.


Am I missing something? Is this a known bug? If so, will it be fixed in a future release? Any help is appreciated.

Additional context

No response

Logs

No response

@Vanger888
Copy link

I faced the same issue. Fetch error when try to extend Nuxt layer from private bitbucket repository.
image

  extends: [
    ['bitbucket:{username}/{repository}#{branchName}',
      { giget: { auth: {validAcceccToken}} },
    ],
  ],

Found this in bitbucket community. Looks like they do not support yet to download archive via repository access tokens.

https://community.atlassian.com/t5/Bitbucket-questions/Bitbucket-API-Get-file-with-access-token/qaq-p/2252581

https://jira.atlassian.com/browse/BCLOUD-22436

Maybe there is some another workaround?

@rtrap-rsi
Copy link

Hello everybody, have someone found a solution/workaround for this problem?

@Tarabass
Copy link

I'm curious as well. We are in the Atlassian eco system and we are migrating to Nuxt 3. Not being able to extend from bitbucket private repo's is pretty much a show stopper for us :|

@rtrap-rsi
Copy link

For the moment I just clone the private repo locally and reference this in the extend config. Same for CI, a script do the same thing.

@Tarabass
Copy link

Sounds great. Our first solution was to go back to external libraries like you do with component libraries, but this doesn't feel good and is not future proof in a way that when it gets possible to extend from private bitbucket repo's.

How do you config this in nuxt config? In theory, I think extend can be overwritten in $development and $production. So this could work?

export default defineNuxtConfig({
  extends: [
    '@nuxt/examples-ui',
    './ui',
    './base'
  ],
  $production: {
    extends: [
      'repo/in/server/folder'
    ]
  },
  $development: [
    extends: [
      'repo/in/local/folder'
    ]
  ]
  ...
})

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

No branches or pull requests

4 participants