mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-17 00:01:00 -04:00
Compare commits
3 Commits
3d34cdabb9
...
73189f0a19
Author | SHA1 | Date | |
---|---|---|---|
|
73189f0a19 | ||
|
92f72d678c | ||
|
7e26f2b626 |
@ -851,7 +851,8 @@ steps:
|
|||||||
image: plugins/hugo:latest
|
image: plugins/hugo:latest
|
||||||
pull: always
|
pull: always
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache make bash curl
|
# https://github.com/drone-plugins/drone-hugo/issues/36
|
||||||
|
- apk upgrade --no-cache libcurl && apk add --no-cache make bash curl
|
||||||
- cd docs
|
- cd docs
|
||||||
- make trans-copy clean build
|
- make trans-copy clean build
|
||||||
|
|
||||||
|
54
CHANGELOG.md
54
CHANGELOG.md
@ -4,6 +4,60 @@ This changelog goes through all the changes that have been made in each release
|
|||||||
without substantial changes to our git log; to see the highlights of what has
|
without substantial changes to our git log; to see the highlights of what has
|
||||||
been added to each release, please refer to the [blog](https://blog.gitea.io).
|
been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||||
|
|
||||||
|
## [1.17.4](https://github.com/go-gitea/gitea/releases/tag/1.17.4) - 2022-12-21
|
||||||
|
|
||||||
|
* SECURITY
|
||||||
|
* Do not allow Ghost access to limited visible user/org (#21849) (#21875)
|
||||||
|
* Fix package access for admins and inactive users (#21580) (#21592)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Fix button in branch list, avoid unexpected page jump before restore branch actually done (#21562) (#21927)
|
||||||
|
* Fix vertical align of committer avatar rendered by email address (#21884) (#21919)
|
||||||
|
* Fix setting HTTP headers after write (#21833) (#21874)
|
||||||
|
* Ignore line anchor links with leading zeroes (#21728) (#21777)
|
||||||
|
* Enable Monaco automaticLayout (#21516)
|
||||||
|
* BUGFIXES
|
||||||
|
* Do not list active repositories as unadopted (#22034) (#22167)
|
||||||
|
* Correctly handle moved files in apply patch (#22118) (#22136)
|
||||||
|
* Fix condition for is_internal (#22095) (#22131)
|
||||||
|
* Fix permission check on issue/pull lock (#22114)
|
||||||
|
* Fix sorting admin user list by last login (#22081) (#22106)
|
||||||
|
* Workaround for container registry push/pull errors (#21862) (#22069)
|
||||||
|
* Fix issue/PR numbers (#22037) (#22045)
|
||||||
|
* Handle empty author names (#21902) (#22028)
|
||||||
|
* Fix ListBranches to handle empty case (#21921) (#22025)
|
||||||
|
* Fix enabling partial clones on 1.17 (#21809)
|
||||||
|
* Prevent panic in doctor command when running default checks (#21791) (#21808)
|
||||||
|
* Upgrade golang.org/x/crypto (#21792) (#21794)
|
||||||
|
* Init git module before database migration (#21764) (#21766)
|
||||||
|
* Set last login when activating account (#21731) (#21754)
|
||||||
|
* Add HEAD fix to gitea doctor (#21352) (#21751)
|
||||||
|
* Fix UI language switching bug (#21597) (#21748)
|
||||||
|
* Remove semver compatible flag and change pypi to an array of test cases (#21708) (#21729)
|
||||||
|
* Allow local package identifiers for PyPI packages (#21690) (#21726)
|
||||||
|
* Fix repository adoption on Windows (#21646) (#21651)
|
||||||
|
* Sync git hooks when config file path changed (#21619) (#21625)
|
||||||
|
* Added check for disabled Packages (#21540) (#21614)
|
||||||
|
* Fix `Timestamp.IsZero` (#21593) (#21604)
|
||||||
|
* Fix issues count bug (#21600)
|
||||||
|
* Support binary deploy in npm packages (#21589)
|
||||||
|
* Update milestone counters when issue is deleted (#21459) (#21586)
|
||||||
|
* SessionUser protection against nil pointer dereference (#21581)
|
||||||
|
* Case-insensitive NuGet symbol file GUID (#21409) (#21575)
|
||||||
|
* Suppress `ExternalLoginUserNotExist` error (#21504) (#21572)
|
||||||
|
* Prevent Authorization header for presigned LFS urls (#21531) (#21569)
|
||||||
|
* Update binding to fix bugs (#21560)
|
||||||
|
* Fix generating compare link (#21519) (#21530)
|
||||||
|
* Ignore error when retrieving changed PR review files (#21487) (#21524)
|
||||||
|
* Fix incorrect notification commit url (#21479) (#21483)
|
||||||
|
* Display total commit count in hook message (#21400) (#21481)
|
||||||
|
* Enforce grouped NuGet search results (#21442) (#21480)
|
||||||
|
* Return 404 when user is not found on avatar (#21476) (#21477)
|
||||||
|
* Normalize NuGet package version on upload (#22186) (#22201)
|
||||||
|
* MISC
|
||||||
|
* Check for zero time instant in TimeStamp.IsZero() (#22171) (#22173)
|
||||||
|
* Fix warn in database structs sync (#22111)
|
||||||
|
* Allow for resolution of NPM registry paths that match upstream (#21568) (#21723)
|
||||||
|
|
||||||
## [1.17.3](https://github.com/go-gitea/gitea/releases/tag/v1.17.3) - 2022-10-15
|
## [1.17.3](https://github.com/go-gitea/gitea/releases/tag/v1.17.3) - 2022-10-15
|
||||||
|
|
||||||
* SECURITY
|
* SECURITY
|
||||||
|
@ -6,8 +6,10 @@ package nuget
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"archive/zip"
|
"archive/zip"
|
||||||
|
"bytes"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
@ -181,7 +183,23 @@ func ParseNuspecMetaData(r io.Reader) (*Package, error) {
|
|||||||
return &Package{
|
return &Package{
|
||||||
PackageType: packageType,
|
PackageType: packageType,
|
||||||
ID: p.Metadata.ID,
|
ID: p.Metadata.ID,
|
||||||
Version: v.String(),
|
Version: toNormalizedVersion(v),
|
||||||
Metadata: m,
|
Metadata: m,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#normalized-version-numbers
|
||||||
|
// https://github.com/NuGet/NuGet.Client/blob/dccbd304b11103e08b97abf4cf4bcc1499d9235a/src/NuGet.Core/NuGet.Versioning/VersionFormatter.cs#L121
|
||||||
|
func toNormalizedVersion(v *version.Version) string {
|
||||||
|
var buf bytes.Buffer
|
||||||
|
segments := v.Segments64()
|
||||||
|
fmt.Fprintf(&buf, "%d.%d.%d", segments[0], segments[1], segments[2])
|
||||||
|
if len(segments) > 3 && segments[3] > 0 {
|
||||||
|
fmt.Fprintf(&buf, ".%d", segments[3])
|
||||||
|
}
|
||||||
|
pre := v.Prerelease()
|
||||||
|
if pre != "" {
|
||||||
|
fmt.Fprint(&buf, "-", pre)
|
||||||
|
}
|
||||||
|
return buf.String()
|
||||||
|
}
|
||||||
|
@ -147,6 +147,19 @@ func TestParseNuspecMetaData(t *testing.T) {
|
|||||||
assert.Len(t, deps, 1)
|
assert.Len(t, deps, 1)
|
||||||
assert.Equal(t, dependencyID, deps[0].ID)
|
assert.Equal(t, dependencyID, deps[0].ID)
|
||||||
assert.Equal(t, dependencyVersion, deps[0].Version)
|
assert.Equal(t, dependencyVersion, deps[0].Version)
|
||||||
|
|
||||||
|
t.Run("NormalizedVersion", func(t *testing.T) {
|
||||||
|
np, err := ParseNuspecMetaData(strings.NewReader(`<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>test</id>
|
||||||
|
<version>1.04.5.2.5-rc.1+metadata</version>
|
||||||
|
</metadata>
|
||||||
|
</package>`))
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.NotNil(t, np)
|
||||||
|
assert.Equal(t, "1.4.5.2-rc.1", np.Version)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Symbols Package", func(t *testing.T) {
|
t.Run("Symbols Package", func(t *testing.T) {
|
||||||
|
@ -5,15 +5,11 @@
|
|||||||
package nuget
|
package nuget
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"fmt"
|
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
packages_model "code.gitea.io/gitea/models/packages"
|
packages_model "code.gitea.io/gitea/models/packages"
|
||||||
nuget_module "code.gitea.io/gitea/modules/packages/nuget"
|
nuget_module "code.gitea.io/gitea/modules/packages/nuget"
|
||||||
|
|
||||||
"github.com/hashicorp/go-version"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServiceIndexResponse https://docs.microsoft.com/en-us/nuget/api/service-index#resources
|
// ServiceIndexResponse https://docs.microsoft.com/en-us/nuget/api/service-index#resources
|
||||||
@ -113,8 +109,8 @@ func createRegistrationIndexResponse(l *linkBuilder, pds []*packages_model.Packa
|
|||||||
{
|
{
|
||||||
RegistrationPageURL: l.GetRegistrationIndexURL(pds[0].Package.Name),
|
RegistrationPageURL: l.GetRegistrationIndexURL(pds[0].Package.Name),
|
||||||
Count: len(pds),
|
Count: len(pds),
|
||||||
Lower: normalizeVersion(pds[0].SemVer),
|
Lower: pds[0].Version.Version,
|
||||||
Upper: normalizeVersion(pds[len(pds)-1].SemVer),
|
Upper: pds[len(pds)-1].Version.Version,
|
||||||
Items: items,
|
Items: items,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -191,7 +187,7 @@ type PackageVersionsResponse struct {
|
|||||||
func createPackageVersionsResponse(pds []*packages_model.PackageDescriptor) *PackageVersionsResponse {
|
func createPackageVersionsResponse(pds []*packages_model.PackageDescriptor) *PackageVersionsResponse {
|
||||||
versions := make([]string, 0, len(pds))
|
versions := make([]string, 0, len(pds))
|
||||||
for _, pd := range pds {
|
for _, pd := range pds {
|
||||||
versions = append(versions, normalizeVersion(pd.SemVer))
|
versions = append(versions, pd.Version.Version)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &PackageVersionsResponse{
|
return &PackageVersionsResponse{
|
||||||
@ -266,15 +262,3 @@ func createSearchResult(l *linkBuilder, pds []*packages_model.PackageDescriptor)
|
|||||||
RegistrationIndexURL: l.GetRegistrationIndexURL(latest.Package.Name),
|
RegistrationIndexURL: l.GetRegistrationIndexURL(latest.Package.Name),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// normalizeVersion removes the metadata
|
|
||||||
func normalizeVersion(v *version.Version) string {
|
|
||||||
var buf bytes.Buffer
|
|
||||||
segments := v.Segments64()
|
|
||||||
fmt.Fprintf(&buf, "%d.%d.%d", segments[0], segments[1], segments[2])
|
|
||||||
pre := v.Prerelease()
|
|
||||||
if pre != "" {
|
|
||||||
fmt.Fprintf(&buf, "-%s", pre)
|
|
||||||
}
|
|
||||||
return buf.String()
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user