mirror of
https://github.com/go-gitea/gitea
synced 2025-01-09 09:24:25 +00:00
Fix package error handling and npm meta and empty repo guide (#33112)
This commit is contained in:
parent
e637008fe3
commit
0fad40dd8c
@ -81,6 +81,7 @@ type PackageMetadataVersion struct {
|
|||||||
BundleDependencies []string `json:"bundleDependencies,omitempty"`
|
BundleDependencies []string `json:"bundleDependencies,omitempty"`
|
||||||
DevDependencies map[string]string `json:"devDependencies,omitempty"`
|
DevDependencies map[string]string `json:"devDependencies,omitempty"`
|
||||||
PeerDependencies map[string]string `json:"peerDependencies,omitempty"`
|
PeerDependencies map[string]string `json:"peerDependencies,omitempty"`
|
||||||
|
PeerDependenciesMeta map[string]any `json:"peerDependenciesMeta,omitempty"`
|
||||||
Bin map[string]string `json:"bin,omitempty"`
|
Bin map[string]string `json:"bin,omitempty"`
|
||||||
OptionalDependencies map[string]string `json:"optionalDependencies,omitempty"`
|
OptionalDependencies map[string]string `json:"optionalDependencies,omitempty"`
|
||||||
Readme string `json:"readme,omitempty"`
|
Readme string `json:"readme,omitempty"`
|
||||||
@ -222,6 +223,7 @@ func ParsePackage(r io.Reader) (*Package, error) {
|
|||||||
BundleDependencies: meta.BundleDependencies,
|
BundleDependencies: meta.BundleDependencies,
|
||||||
DevelopmentDependencies: meta.DevDependencies,
|
DevelopmentDependencies: meta.DevDependencies,
|
||||||
PeerDependencies: meta.PeerDependencies,
|
PeerDependencies: meta.PeerDependencies,
|
||||||
|
PeerDependenciesMeta: meta.PeerDependenciesMeta,
|
||||||
OptionalDependencies: meta.OptionalDependencies,
|
OptionalDependencies: meta.OptionalDependencies,
|
||||||
Bin: meta.Bin,
|
Bin: meta.Bin,
|
||||||
Readme: meta.Readme,
|
Readme: meta.Readme,
|
||||||
|
@ -19,6 +19,7 @@ type Metadata struct {
|
|||||||
BundleDependencies []string `json:"bundleDependencies,omitempty"`
|
BundleDependencies []string `json:"bundleDependencies,omitempty"`
|
||||||
DevelopmentDependencies map[string]string `json:"development_dependencies,omitempty"`
|
DevelopmentDependencies map[string]string `json:"development_dependencies,omitempty"`
|
||||||
PeerDependencies map[string]string `json:"peer_dependencies,omitempty"`
|
PeerDependencies map[string]string `json:"peer_dependencies,omitempty"`
|
||||||
|
PeerDependenciesMeta map[string]any `json:"peer_dependencies_meta,omitempty"`
|
||||||
OptionalDependencies map[string]string `json:"optional_dependencies,omitempty"`
|
OptionalDependencies map[string]string `json:"optional_dependencies,omitempty"`
|
||||||
Bin map[string]string `json:"bin,omitempty"`
|
Bin map[string]string `json:"bin,omitempty"`
|
||||||
Readme string `json:"readme,omitempty"`
|
Readme string `json:"readme,omitempty"`
|
||||||
|
@ -111,12 +111,11 @@ func getOrCreateUploadVersion(ctx context.Context, pi *packages_service.PackageI
|
|||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
if p, err = packages_model.TryInsertPackage(ctx, p); err != nil {
|
if p, err = packages_model.TryInsertPackage(ctx, p); err != nil {
|
||||||
if err == packages_model.ErrDuplicatePackage {
|
if !errors.Is(err, packages_model.ErrDuplicatePackage) {
|
||||||
created = false
|
|
||||||
} else {
|
|
||||||
log.Error("Error inserting package: %v", err)
|
log.Error("Error inserting package: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
created = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if created {
|
if created {
|
||||||
@ -135,7 +134,7 @@ func getOrCreateUploadVersion(ctx context.Context, pi *packages_service.PackageI
|
|||||||
MetadataJSON: "null",
|
MetadataJSON: "null",
|
||||||
}
|
}
|
||||||
if pv, err = packages_model.GetOrInsertVersion(ctx, pv); err != nil {
|
if pv, err = packages_model.GetOrInsertVersion(ctx, pv); err != nil {
|
||||||
if err != packages_model.ErrDuplicatePackageVersion {
|
if !errors.Is(err, packages_model.ErrDuplicatePackageVersion) {
|
||||||
log.Error("Error inserting package: %v", err)
|
log.Error("Error inserting package: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -161,7 +160,7 @@ func createFileForBlob(ctx context.Context, pv *packages_model.PackageVersion, p
|
|||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
if pf, err = packages_model.TryInsertFile(ctx, pf); err != nil {
|
if pf, err = packages_model.TryInsertFile(ctx, pf); err != nil {
|
||||||
if err == packages_model.ErrDuplicatePackageFile {
|
if errors.Is(err, packages_model.ErrDuplicatePackageFile) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
log.Error("Error inserting package file: %v", err)
|
log.Error("Error inserting package file: %v", err)
|
||||||
|
@ -324,7 +324,7 @@ func GetUploadBlob(ctx *context.Context) {
|
|||||||
|
|
||||||
upload, err := packages_model.GetBlobUploadByID(ctx, uuid)
|
upload, err := packages_model.GetBlobUploadByID(ctx, uuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == packages_model.ErrPackageBlobUploadNotExist {
|
if errors.Is(err, packages_model.ErrPackageBlobUploadNotExist) {
|
||||||
apiErrorDefined(ctx, errBlobUploadUnknown)
|
apiErrorDefined(ctx, errBlobUploadUnknown)
|
||||||
} else {
|
} else {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
@ -345,7 +345,7 @@ func UploadBlob(ctx *context.Context) {
|
|||||||
|
|
||||||
uploader, err := container_service.NewBlobUploader(ctx, ctx.PathParam("uuid"))
|
uploader, err := container_service.NewBlobUploader(ctx, ctx.PathParam("uuid"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == packages_model.ErrPackageBlobUploadNotExist {
|
if errors.Is(err, packages_model.ErrPackageBlobUploadNotExist) {
|
||||||
apiErrorDefined(ctx, errBlobUploadUnknown)
|
apiErrorDefined(ctx, errBlobUploadUnknown)
|
||||||
} else {
|
} else {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
@ -396,7 +396,7 @@ func EndUploadBlob(ctx *context.Context) {
|
|||||||
|
|
||||||
uploader, err := container_service.NewBlobUploader(ctx, ctx.PathParam("uuid"))
|
uploader, err := container_service.NewBlobUploader(ctx, ctx.PathParam("uuid"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == packages_model.ErrPackageBlobUploadNotExist {
|
if errors.Is(err, packages_model.ErrPackageBlobUploadNotExist) {
|
||||||
apiErrorDefined(ctx, errBlobUploadUnknown)
|
apiErrorDefined(ctx, errBlobUploadUnknown)
|
||||||
} else {
|
} else {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
@ -465,7 +465,7 @@ func CancelUploadBlob(ctx *context.Context) {
|
|||||||
|
|
||||||
_, err := packages_model.GetBlobUploadByID(ctx, uuid)
|
_, err := packages_model.GetBlobUploadByID(ctx, uuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == packages_model.ErrPackageBlobUploadNotExist {
|
if errors.Is(err, packages_model.ErrPackageBlobUploadNotExist) {
|
||||||
apiErrorDefined(ctx, errBlobUploadUnknown)
|
apiErrorDefined(ctx, errBlobUploadUnknown)
|
||||||
} else {
|
} else {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
@ -501,7 +501,7 @@ func getBlobFromContext(ctx *context.Context) (*packages_model.PackageFileDescri
|
|||||||
func HeadBlob(ctx *context.Context) {
|
func HeadBlob(ctx *context.Context) {
|
||||||
blob, err := getBlobFromContext(ctx)
|
blob, err := getBlobFromContext(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == container_model.ErrContainerBlobNotExist {
|
if errors.Is(err, container_model.ErrContainerBlobNotExist) {
|
||||||
apiErrorDefined(ctx, errBlobUnknown)
|
apiErrorDefined(ctx, errBlobUnknown)
|
||||||
} else {
|
} else {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
@ -520,7 +520,7 @@ func HeadBlob(ctx *context.Context) {
|
|||||||
func GetBlob(ctx *context.Context) {
|
func GetBlob(ctx *context.Context) {
|
||||||
blob, err := getBlobFromContext(ctx)
|
blob, err := getBlobFromContext(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == container_model.ErrContainerBlobNotExist {
|
if errors.Is(err, container_model.ErrContainerBlobNotExist) {
|
||||||
apiErrorDefined(ctx, errBlobUnknown)
|
apiErrorDefined(ctx, errBlobUnknown)
|
||||||
} else {
|
} else {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
@ -639,7 +639,7 @@ func getManifestFromContext(ctx *context.Context) (*packages_model.PackageFileDe
|
|||||||
func HeadManifest(ctx *context.Context) {
|
func HeadManifest(ctx *context.Context) {
|
||||||
manifest, err := getManifestFromContext(ctx)
|
manifest, err := getManifestFromContext(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == container_model.ErrContainerBlobNotExist {
|
if errors.Is(err, container_model.ErrContainerBlobNotExist) {
|
||||||
apiErrorDefined(ctx, errManifestUnknown)
|
apiErrorDefined(ctx, errManifestUnknown)
|
||||||
} else {
|
} else {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
@ -659,7 +659,7 @@ func HeadManifest(ctx *context.Context) {
|
|||||||
func GetManifest(ctx *context.Context) {
|
func GetManifest(ctx *context.Context) {
|
||||||
manifest, err := getManifestFromContext(ctx)
|
manifest, err := getManifestFromContext(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == container_model.ErrContainerBlobNotExist {
|
if errors.Is(err, container_model.ErrContainerBlobNotExist) {
|
||||||
apiErrorDefined(ctx, errManifestUnknown)
|
apiErrorDefined(ctx, errManifestUnknown)
|
||||||
} else {
|
} else {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
@ -739,7 +739,7 @@ func GetTagList(ctx *context.Context) {
|
|||||||
image := ctx.PathParam("image")
|
image := ctx.PathParam("image")
|
||||||
|
|
||||||
if _, err := packages_model.GetPackageByName(ctx, ctx.Package.Owner.ID, packages_model.TypeContainer, image); err != nil {
|
if _, err := packages_model.GetPackageByName(ctx, ctx.Package.Owner.ID, packages_model.TypeContainer, image); err != nil {
|
||||||
if err == packages_model.ErrPackageNotExist {
|
if errors.Is(err, packages_model.ErrPackageNotExist) {
|
||||||
apiErrorDefined(ctx, errNameUnknown)
|
apiErrorDefined(ctx, errNameUnknown)
|
||||||
} else {
|
} else {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
|
@ -240,7 +240,7 @@ func processImageManifestIndex(ctx context.Context, mci *manifestCreationInfo, b
|
|||||||
IsManifest: true,
|
IsManifest: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == container_model.ErrContainerBlobNotExist {
|
if errors.Is(err, container_model.ErrContainerBlobNotExist) {
|
||||||
return errManifestBlobUnknown
|
return errManifestBlobUnknown
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
@ -321,12 +321,11 @@ func createPackageAndVersion(ctx context.Context, mci *manifestCreationInfo, met
|
|||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
if p, err = packages_model.TryInsertPackage(ctx, p); err != nil {
|
if p, err = packages_model.TryInsertPackage(ctx, p); err != nil {
|
||||||
if err == packages_model.ErrDuplicatePackage {
|
if !errors.Is(err, packages_model.ErrDuplicatePackage) {
|
||||||
created = false
|
|
||||||
} else {
|
|
||||||
log.Error("Error inserting package: %v", err)
|
log.Error("Error inserting package: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
created = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if created {
|
if created {
|
||||||
@ -352,21 +351,23 @@ func createPackageAndVersion(ctx context.Context, mci *manifestCreationInfo, met
|
|||||||
}
|
}
|
||||||
var pv *packages_model.PackageVersion
|
var pv *packages_model.PackageVersion
|
||||||
if pv, err = packages_model.GetOrInsertVersion(ctx, _pv); err != nil {
|
if pv, err = packages_model.GetOrInsertVersion(ctx, _pv); err != nil {
|
||||||
if err == packages_model.ErrDuplicatePackageVersion {
|
if !errors.Is(err, packages_model.ErrDuplicatePackageVersion) {
|
||||||
if err := packages_service.DeletePackageVersionAndReferences(ctx, pv); err != nil {
|
log.Error("Error inserting package: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// keep download count on overwrite
|
if err = packages_service.DeletePackageVersionAndReferences(ctx, pv); err != nil {
|
||||||
_pv.DownloadCount = pv.DownloadCount
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
if pv, err = packages_model.GetOrInsertVersion(ctx, _pv); err != nil {
|
// keep download count on overwrite
|
||||||
|
_pv.DownloadCount = pv.DownloadCount
|
||||||
|
|
||||||
|
if pv, err = packages_model.GetOrInsertVersion(ctx, _pv); err != nil {
|
||||||
|
if !errors.Is(err, packages_model.ErrDuplicatePackageVersion) {
|
||||||
log.Error("Error inserting package: %v", err)
|
log.Error("Error inserting package: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
log.Error("Error inserting package: %v", err)
|
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,7 +418,7 @@ func createFileFromBlobReference(ctx context.Context, pv, uploadVersion *package
|
|||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
if pf, err = packages_model.TryInsertFile(ctx, pf); err != nil {
|
if pf, err = packages_model.TryInsertFile(ctx, pf); err != nil {
|
||||||
if err == packages_model.ErrDuplicatePackageFile {
|
if errors.Is(err, packages_model.ErrDuplicatePackageFile) {
|
||||||
// Skip this blob because the manifest contains the same filesystem layer multiple times.
|
// Skip this blob because the manifest contains the same filesystem layer multiple times.
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ func createPackageMetadataVersion(registryURL string, pd *packages_model.Package
|
|||||||
BundleDependencies: metadata.BundleDependencies,
|
BundleDependencies: metadata.BundleDependencies,
|
||||||
DevDependencies: metadata.DevelopmentDependencies,
|
DevDependencies: metadata.DevelopmentDependencies,
|
||||||
PeerDependencies: metadata.PeerDependencies,
|
PeerDependencies: metadata.PeerDependencies,
|
||||||
|
PeerDependenciesMeta: metadata.PeerDependenciesMeta,
|
||||||
OptionalDependencies: metadata.OptionalDependencies,
|
OptionalDependencies: metadata.OptionalDependencies,
|
||||||
Readme: metadata.Readme,
|
Readme: metadata.Readme,
|
||||||
Bin: metadata.Bin,
|
Bin: metadata.Bin,
|
||||||
|
@ -250,6 +250,7 @@ func handleRepoEmptyOrBroken(ctx *context.Context) {
|
|||||||
showEmpty = true // it is not really empty, but there is no branch
|
showEmpty = true // it is not really empty, but there is no branch
|
||||||
// at the moment, other repo units like "actions" are not able to handle such case,
|
// at the moment, other repo units like "actions" are not able to handle such case,
|
||||||
// so we just mark the repo as empty to prevent from displaying these units.
|
// so we just mark the repo as empty to prevent from displaying these units.
|
||||||
|
ctx.Data["RepoHasContentsWithoutBranch"] = true
|
||||||
updateContextRepoEmptyAndStatus(ctx, true, repo_model.RepositoryReady)
|
updateContextRepoEmptyAndStatus(ctx, true, repo_model.RepositoryReady)
|
||||||
} else {
|
} else {
|
||||||
// the repo is actually not empty and has branches, need to update the database later
|
// the repo is actually not empty and has branches, need to update the database later
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
{{if .Repository.IsBroken}}
|
{{if .Repository.IsBroken}}
|
||||||
<div class="ui segment center">{{ctx.Locale.Tr "repo.broken_message"}}</div>
|
<div class="ui segment center">{{ctx.Locale.Tr "repo.broken_message"}}</div>
|
||||||
{{else if .Repository.IsEmpty}}
|
{{else if .RepoHasContentsWithoutBranch}}
|
||||||
<div class="ui segment center">{{ctx.Locale.Tr "repo.no_branch"}}</div>
|
<div class="ui segment center">{{ctx.Locale.Tr "repo.no_branch"}}</div>
|
||||||
{{else if .CanWriteCode}}
|
{{else if .CanWriteCode}}
|
||||||
<h4 class="ui top attached header">{{ctx.Locale.Tr "repo.quick_guide"}}</h4>
|
<h4 class="ui top attached header">{{ctx.Locale.Tr "repo.quick_guide"}}</h4>
|
||||||
|
@ -52,24 +52,33 @@ func TestPackageNpm(t *testing.T) {
|
|||||||
"` + packageTag + `": "` + version + `"
|
"` + packageTag + `": "` + version + `"
|
||||||
},
|
},
|
||||||
"versions": {
|
"versions": {
|
||||||
"` + version + `": {
|
"` + version + `": {
|
||||||
"name": "` + packageName + `",
|
"name": "` + packageName + `",
|
||||||
"version": "` + version + `",
|
"version": "` + version + `",
|
||||||
"description": "` + packageDescription + `",
|
"description": "` + packageDescription + `",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "` + packageAuthor + `"
|
"name": "` + packageAuthor + `"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"` + packageBinName + `": "` + packageBinPath + `"
|
"` + packageBinName + `": "` + packageBinPath + `"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"integrity": "sha512-yA4FJsVhetynGfOC1jFf79BuS+jrHbm0fhh+aHzCQkOaOBXKf9oBnC4a6DnLLnEsHQDRLYd00cwj8sCXpC+wIg==",
|
"integrity": "sha512-yA4FJsVhetynGfOC1jFf79BuS+jrHbm0fhh+aHzCQkOaOBXKf9oBnC4a6DnLLnEsHQDRLYd00cwj8sCXpC+wIg==",
|
||||||
"shasum": "aaa7eaf852a948b0aa05afeda35b1badca155d90"
|
"shasum": "aaa7eaf852a948b0aa05afeda35b1badca155d90"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "` + repoType + `",
|
"type": "` + repoType + `",
|
||||||
"url": "` + repoURL + `"
|
"url": "` + repoURL + `"
|
||||||
}
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"tea": "2.x",
|
||||||
|
"soy-milk": "1.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"soy-milk": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"_attachments": {
|
"_attachments": {
|
||||||
@ -178,6 +187,8 @@ func TestPackageNpm(t *testing.T) {
|
|||||||
assert.Equal(t, fmt.Sprintf("%s%s/-/%s/%s", setting.AppURL, root[1:], packageVersion, filename), pmv.Dist.Tarball)
|
assert.Equal(t, fmt.Sprintf("%s%s/-/%s/%s", setting.AppURL, root[1:], packageVersion, filename), pmv.Dist.Tarball)
|
||||||
assert.Equal(t, repoType, result.Repository.Type)
|
assert.Equal(t, repoType, result.Repository.Type)
|
||||||
assert.Equal(t, repoURL, result.Repository.URL)
|
assert.Equal(t, repoURL, result.Repository.URL)
|
||||||
|
assert.Equal(t, map[string]string{"tea": "2.x", "soy-milk": "1.2"}, pmv.PeerDependencies)
|
||||||
|
assert.Equal(t, map[string]any{"soy-milk": map[string]any{"optional": true}}, pmv.PeerDependenciesMeta)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("AddTag", func(t *testing.T) {
|
t.Run("AddTag", func(t *testing.T) {
|
||||||
|
@ -58,8 +58,12 @@ func TestEmptyRepoAddFile(t *testing.T) {
|
|||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
session := loginUser(t, "user30")
|
session := loginUser(t, "user30")
|
||||||
req := NewRequest(t, "GET", "/user30/empty/_new/"+setting.Repository.DefaultBranch)
|
req := NewRequest(t, "GET", "/user30/empty")
|
||||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||||
|
assert.Contains(t, resp.Body.String(), "empty-repo-guide")
|
||||||
|
|
||||||
|
req = NewRequest(t, "GET", "/user30/empty/_new/"+setting.Repository.DefaultBranch)
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||||
doc := NewHTMLParser(t, resp.Body).Find(`input[name="commit_choice"]`)
|
doc := NewHTMLParser(t, resp.Body).Find(`input[name="commit_choice"]`)
|
||||||
assert.Empty(t, doc.AttrOr("checked", "_no_"))
|
assert.Empty(t, doc.AttrOr("checked", "_no_"))
|
||||||
req = NewRequestWithValues(t, "POST", "/user30/empty/_new/"+setting.Repository.DefaultBranch, map[string]string{
|
req = NewRequestWithValues(t, "POST", "/user30/empty/_new/"+setting.Repository.DefaultBranch, map[string]string{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user