Skip to content

Conversation

@Nyholm
Copy link
Contributor

@Nyholm Nyholm commented Dec 15, 2025

What was changed

I copied and modified the Github support to make sure I can use the Gitlab API to download my private resources

Why?

I love the fact that I can download binaries and someone else take care of figuring out what architecture.

Checklist

  • Closes #
  • Tested
    • Tested manually
    • Unit tests added
  • Documentation

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 0% with 176 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/Repository/Internal/GitLab/Api/RepositoryApi.php 0.00% 44 Missing ⚠️
...le/Repository/Internal/GitLab/GitLabRepository.php 0.00% 32 Missing ⚠️
.../Module/Repository/Internal/GitLab/GitLabAsset.php 0.00% 21 Missing ⚠️
...c/Module/Repository/Internal/GitLab/Api/Client.php 0.00% 18 Missing ⚠️
...odule/Repository/Internal/GitLab/GitLabRelease.php 0.00% 14 Missing ⚠️
src/Module/Repository/Internal/GitLab/Factory.php 0.00% 13 Missing ⚠️
...itory/Internal/GitLab/Api/Response/ReleaseInfo.php 0.00% 12 Missing ⚠️
...ry/Internal/GitLab/Api/Response/RepositoryInfo.php 0.00% 11 Missing ⚠️
...ository/Internal/GitLab/Api/Response/AssetInfo.php 0.00% 7 Missing ⚠️
src/Bootstrap.php 0.00% 2 Missing ⚠️
... and 1 more
Files with missing lines Coverage Δ Complexity Δ
src/Bootstrap.php 0.00% <0.00%> (ø) 9.00 <0.00> (ø)
...rnal/GitLab/Exception/GitLabRateLimitException.php 0.00% <0.00%> (ø) 1.00 <1.00> (?)
...ository/Internal/GitLab/Api/Response/AssetInfo.php 0.00% <0.00%> (ø) 3.00 <3.00> (?)
...ry/Internal/GitLab/Api/Response/RepositoryInfo.php 0.00% <0.00%> (ø) 2.00 <2.00> (?)
...itory/Internal/GitLab/Api/Response/ReleaseInfo.php 0.00% <0.00%> (ø) 3.00 <3.00> (?)
src/Module/Repository/Internal/GitLab/Factory.php 0.00% <0.00%> (ø) 4.00 <4.00> (?)
...odule/Repository/Internal/GitLab/GitLabRelease.php 0.00% <0.00%> (ø) 6.00 <6.00> (?)
...c/Module/Repository/Internal/GitLab/Api/Client.php 0.00% <0.00%> (ø) 7.00 <7.00> (?)
.../Module/Repository/Internal/GitLab/GitLabAsset.php 0.00% <0.00%> (ø) 6.00 <6.00> (?)
...le/Repository/Internal/GitLab/GitLabRepository.php 0.00% <0.00%> (ø) 11.00 <11.00> (?)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Nyholm
Copy link
Contributor Author

Nyholm commented Dec 15, 2025

Hm.. I struggle to download the final release... It seams to be a known gitlab issue

@roxblnfk
Copy link
Member

Could you share a public GitLab repository with binaries in mind where I can test the feature?

@Nyholm
Copy link
Contributor Author

Nyholm commented Dec 15, 2025

Could you share a public GitLab repository with binaries in mind where I can test the feature?

I only have private ones. But I can create one for us to try it out.

@Nyholm
Copy link
Contributor Author

Nyholm commented Dec 15, 2025

Here you go: A nice little project with a readme and a .gitlab-ci.yml file.

https://gitlab.com/Nyholm/dload-demo/-/tree/main

@roxblnfk
Copy link
Member

In my case, it gets an empty list of assets. It picks up releases well.

Config:

<?xml version="1.0"?>
<dload
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="dload.xsd"
    temp-dir="./runtime"
>
    <actions>
        <download software="cool" version="1.1.0" />
    </actions>
    <registry overwrite="true">
        <software name="cool" description="Cool binaries" homepage="https://gitlab.com/Nyholm/dload-demo">
            <repository type="gitlab" uri="Nyholm/dload-demo" />
            <binary name="cool" pattern="/.*/" />
        </software>
    </registry>
</dload>

Output:

> bin/dload software
There are 1 software available:

cool  cool
Homepage: https://gitlab.com/Nyholm/dload-demo
gitlab: Nyholm/dload-demo
Cool binaries

> bin/dload get cool -vv
Architecture: X86_64
  Op. system: Windows
   Stability: Stable
Trying to load from repo `Nyholm/dload-demo`
Loading releases from `gitlab` repository Nyholm/dload-demo
1 releases found.
Loading release `1.1.0`
0 matching assets found.
No relevant assets found.
...

@roxblnfk
Copy link
Member

Ah, got it. I'm on Windows, and there are no assets for Windows 🙂

@roxblnfk
Copy link
Member

Claude about asset.url vs asset.direct_asset_url:

Prefer direct_asset_url over url when available because it provides:

  • Direct download without redirects (better performance)
  • Native GitLab API authentication support for private repositories
  • Guaranteed availability through GitLab's download proxy

@roxblnfk
Copy link
Member

Please let me know if you plan to add anything here, or if I can merge and make a new release.

@Nyholm
Copy link
Contributor Author

Nyholm commented Dec 16, 2025

Thank you for the review.

Prefer direct_asset_url over url when available because it provides:

I played around with both. The majority of time was spend on working around a series of Gitlab bugs. There is no way to download private gitlab release assets, you have to do the workaround with adding package (which is done automatically when using the gitlab cli).

When I finally got it to work I was just happy and did not test which URL was best. I tested now and both works.

Ah, got it. I'm on Windows, and there are no assets for Windows

Yes, you are right. Sorry.

Please let me know if you plan to add anything here, or if I can merge and make a new release.

Im happy and done. I've tested it around with my fork all day today. It works great.

@roxblnfk roxblnfk merged commit d68a2a1 into php-internal:1.x Dec 17, 2025
19 of 22 checks passed
@roxblnfk
Copy link
Member

The feature is available in 1.8.0
Thank you.

@Nyholm
Copy link
Contributor Author

Nyholm commented Dec 17, 2025

Wohoo. Thank you

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