Skip to content

fix: correct gitlab repository path#141

Open
sl0wik wants to merge 2 commits intounjs:mainfrom
sl0wik:fix/gitlab-repository-path
Open

fix: correct gitlab repository path#141
sl0wik wants to merge 2 commits intounjs:mainfrom
sl0wik:fix/gitlab-repository-path

Conversation

@sl0wik
Copy link

@sl0wik sl0wik commented Jan 10, 2024

🔗 Linked issue

#107

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Gitlab supports nested subgroups, like https://gitlab.com/{groupName}/{subgroupName}/{repoName}. Attempting to pull any subgroup would result in a 403 error. This pull request resolves the issue.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Jan 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 43.82%. Comparing base (743c9ae) to head (89ef88d).
Report is 39 commits behind head on main.

Files with missing lines Patch % Lines
src/providers.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #141       +/-   ##
===========================================
- Coverage   54.63%   43.82%   -10.81%     
===========================================
  Files           7        6        -1     
  Lines         615      470      -145     
  Branches       47       47               
===========================================
- Hits          336      206      -130     
+ Misses        278      263       -15     
  Partials        1        1               

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi0
Copy link
Member

pi0 commented Mar 21, 2024

Hi. Sorry for delay on this. I mainly wanted to double check if both with and without subgroups it works and didn't had a chance to make a testing gitlab structure yet. If you have some it can be helpful to speedup landing this 🙏🏼

@kovaletsyurii-hue
Copy link

kovaletsyurii-hue commented May 2, 2024

Hi @sl0wik . Thanks for that fix. It helps me a lot. To be compatible with the latest giget version v1.2.3 your fix need to be updated a little:
url: `${gitlab2}/${parsed.repo}${parsed.subdir}/tree/${parsed.ref}`,
tar: `${gitlab2}/${parsed.repo}${parsed.subdir}/-/archive/${parsed.ref}.tar.gz`,

@younho9
Copy link

younho9 commented Oct 22, 2024

When subdir is used as a subgroup, an error occurs when extract using tar.

The subgroup must be included in the repo regular expression.

@simon-kramer

This comment was marked as off-topic.

url: `${gitlab}/${parsed.repo}/tree/${parsed.ref}${parsed.subdir}`,
tar: `${gitlab}/${parsed.repo}/-/archive/${parsed.ref}.tar.gz`,
url: `${gitlab}/${parsed.repo}${parsed.subdir}/tree/${parsed.ref}`,
tar: `${gitlab}/${parsed.repo}${parsed.subdir}/-/archive/${parsed.ref}.tar.gz`,
Copy link
Member

Choose a reason for hiding this comment

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

this is currently generating with //

{
  name: 'unjs-template',
  version: 'main',
  subdir: '/',
  headers: { authorization: undefined, 'sec-fetch-mode': 'same-origin' },
  url: 'https://gitlab.com/unjs/template//tree/main',
  tar: 'https://gitlab.com/unjs/template//-/archive/main.tar.gz'
}

@ColiZei
Copy link

ColiZei commented Sep 26, 2025

Any updates on this?

@sabasayer
Copy link

@ColiZei I've created a new PR since this seems not fixed #246. If @pi0 can review that one and approve it will be really helpful for my work too. As a workaround here what i did in my Nuxt projects nuxt-config.ts

extends: [
    [
      "providerName:latest",
      {
        giget: {
          provider: "providerName",
          providers: {
            providerName: async (input, { auth }) => {
              return {
                name: "providerName",
                version: input,
                headers: {
                  authorization: `Bearer ${auth}`,
                  "sec-fetch-mode": "same-origin",
                },
                url: `https://gitlab.com/company/subgroup/repo-name/-/tree/main`,
                tar: `https://gitlab.com/company/subgroup/repo-name/-/archive/main/repo-name.tar.gz`,
              };
            },
          },
        },
      },
    ],
  ],

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.

7 participants