Compare commits

..

1 Commits

Author SHA1 Message Date
Clément ab150890cb Add jenny by group edf links 2026-06-09 09:53:21 +02:00
4 changed files with 8 additions and 45 deletions
+4
View File
@@ -133,3 +133,7 @@ Scala sbt:
Molior: Molior:
- `Molior Debian Build System <https://github.com/molior-dbs/molior>`_ by André Roth - `Molior Debian Build System <https://github.com/molior-dbs/molior>`_ by André Roth
Jenny:
- `Jenny, an APT repository manager <https://github.com/groupe-edf/Jenny>`_ by EDF Group
+3 -13
View File
@@ -3,7 +3,6 @@ package api
import ( import (
"fmt" "fmt"
"net/http" "net/http"
"net/url"
"os" "os"
"path/filepath" "path/filepath"
"sort" "sort"
@@ -176,7 +175,7 @@ func apiReposCreate(c *gin.Context) {
type reposEditParams struct { type reposEditParams struct {
// Name of repository to modify // Name of repository to modify
Name *string ` json:"Name" example:"new-repo-name"` Name *string `binding:"required" json:"Name" example:"repo1"`
// Change Comment of repository // Change Comment of repository
Comment *string ` json:"Comment" example:"example repo"` Comment *string ` json:"Comment" example:"example repo"`
// Change Default Distribution for publishing // Change Default Distribution for publishing
@@ -188,7 +187,7 @@ type reposEditParams struct {
// @Summary Update Repository // @Summary Update Repository
// @Description **Update local repository meta information** // @Description **Update local repository meta information**
// @Tags Repos // @Tags Repos
// @Param name path string true "Repository name to modify" // @Param name path string true "Repository name"
// @Consume json // @Consume json
// @Param request body reposEditParams true "Parameters" // @Param request body reposEditParams true "Parameters"
// @Produce json // @Produce json
@@ -201,20 +200,11 @@ func apiReposEdit(c *gin.Context) {
if c.Bind(&b) != nil { if c.Bind(&b) != nil {
return return
} }
if b.Name != nil {
new_name, err := url.PathUnescape(*b.Name)
if err != nil {
AbortWithJSONError(c, 400, err)
return
}
*b.Name = new_name
}
collectionFactory := context.NewCollectionFactory() collectionFactory := context.NewCollectionFactory()
collection := collectionFactory.LocalRepoCollection() collection := collectionFactory.LocalRepoCollection()
name := c.Params.ByName("name") // repo to modify name := c.Params.ByName("name")
repo, err := collection.ByName(name) repo, err := collection.ByName(name)
if err != nil { if err != nil {
AbortWithJSONError(c, 404, err) AbortWithJSONError(c, 404, err)
-31
View File
@@ -461,34 +461,3 @@ class ReposAPITestCopyPackage(APITest):
self.check_equal(self.get(f"/api/repos/{repo2_name}/packages").json(), self.check_equal(self.get(f"/api/repos/{repo2_name}/packages").json(),
['Pi386 libboost-program-options-dev 1.49.0.1 918d2f433384e378']) ['Pi386 libboost-program-options-dev 1.49.0.1 918d2f433384e378'])
class ReposAPITestCreateEdit(APITest):
"""
POST /api/repos,
"""
def check(self):
repo_name = self.random_name() + ' with space'
repo_desc = {'Comment': 'fun repo',
'DefaultComponent': 'contrib',
'DefaultDistribution': 'bookworm',
'Name': repo_name}
resp = self.post("/api/repos", json=repo_desc)
self.check_equal(resp.json(), repo_desc)
self.check_equal(resp.status_code, 201)
repo_desc = {'Comment': 'modified repo',
'DefaultComponent': 'main',
'DefaultDistribution': 'trixie',
'Name': repo_name + '@renamed'}
resp = self.put(f"/api/repos/{repo_name}", json=repo_desc)
self.check_equal(resp.json(), repo_desc)
self.check_equal(resp.status_code, 200)
resp = self.get("/api/repos/" + repo_name + '@renamed')
self.check_equal(resp.json(), repo_desc)
self.check_equal(resp.status_code, 200)
resp = self.delete("/api/repos/" + repo_name + '@renamed')
self.check_equal(resp.status_code, 200)
+1 -1
View File
@@ -3,7 +3,7 @@ import tempfile
class TestOut: class TestOut:
def __init__(self): def __init__(self):
self.tmp_file = tempfile.NamedTemporaryFile(delete=True) self.tmp_file = tempfile.NamedTemporaryFile(delete=False)
self.read_pos = 0 self.read_pos = 0
def fileno(self): def fileno(self):