Skip to content

Commit 34dfcc8

Browse files
authored
Merge branch 'main' into local-makefile-customizations
2 parents 1848263 + 367a289 commit 34dfcc8

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

routers/api/packages/conda/conda.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func EnumeratePackages(ctx *context.Context) {
148148
Timestamp: fileMetadata.Timestamp,
149149
Build: fileMetadata.Build,
150150
BuildNumber: fileMetadata.BuildNumber,
151-
Dependencies: fileMetadata.Dependencies,
151+
Dependencies: util.SliceNilAsEmpty(fileMetadata.Dependencies),
152152
License: versionMetadata.License,
153153
LicenseFamily: versionMetadata.LicenseFamily,
154154
HashMD5: pfd.Blob.HashMD5,

templates/repo/release/list.tmpl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,6 @@
7878
{{ctx.Locale.Tr "repo.release.downloads"}}
7979
</summary>
8080
<ul class="ui divided list attachment-list">
81-
{{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
82-
<li class="item">
83-
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow">
84-
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong>
85-
</a>
86-
</li>
87-
<li class="item">
88-
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">
89-
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong>
90-
</a>
91-
</li>
92-
{{end}}
9381
{{range $att := $release.Attachments}}
9482
<li class="item">
9583
<a target="_blank" class="tw-flex-1 gt-ellipsis" rel="nofollow" download href="{{$att.DownloadURL}}">
@@ -105,6 +93,18 @@
10593
</div>
10694
</li>
10795
{{end}}
96+
{{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
97+
<li class="item">
98+
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow">
99+
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong>
100+
</a>
101+
</li>
102+
<li class="item">
103+
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">
104+
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong>
105+
</a>
106+
</li>
107+
{{end}}
108108
</ul>
109109
</details>
110110
</div>

tests/integration/api_packages_conda_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ func TestPackageConda(t *testing.T) {
237237
assert.Equal(t, pd.Files[0].Blob.HashMD5, packageInfo.HashMD5)
238238
assert.Equal(t, pd.Files[0].Blob.HashSHA256, packageInfo.HashSHA256)
239239
assert.Equal(t, pd.Files[0].Blob.Size, packageInfo.Size)
240+
assert.NotNil(t, packageInfo.Dependencies)
241+
assert.Empty(t, packageInfo.Dependencies)
240242
})
241243

242244
t.Run(".conda", func(t *testing.T) {
@@ -268,6 +270,8 @@ func TestPackageConda(t *testing.T) {
268270
assert.Equal(t, pd.Files[0].Blob.HashMD5, packageInfo.HashMD5)
269271
assert.Equal(t, pd.Files[0].Blob.HashSHA256, packageInfo.HashSHA256)
270272
assert.Equal(t, pd.Files[0].Blob.Size, packageInfo.Size)
273+
assert.NotNil(t, packageInfo.Dependencies)
274+
assert.Empty(t, packageInfo.Dependencies)
271275
})
272276
})
273277
}

0 commit comments

Comments
 (0)