Describe the bug
The repositories page route specifies a default query with a filter that is not correct for repositories (as they don't have the type field specified:
|
const query = { |
|
type: 'push', |
|
}; |
|
|
|
for (const k in req.query) { |
|
if (!k) continue; |
|
|
|
if (k === 'limit') continue; |
|
if (k === 'skip') continue; |
|
let v = req.query[k]; |
|
if (v === 'false') v = false; |
|
if (v === 'true') v = true; |
|
query[k] = v; |
|
} |
|
|
|
const qd = await db.getRepos(query); |
Meanwhile the DB implementations ignore the query passed in, which is the only reason that the page displays any repos (as they all would have been hidden by the filter):
File DB client:
|
exports.getRepos = async (query = {}) => { |
|
return new Promise((resolve, reject) => { |
|
db.find({}, (err, docs) => { |
Mongo:
|
exports.getRepos = async (query = {}) => { |
|
const collection = await connect(cnName); |
|
return collection.find().toArray(); |
|
}; |
Both errors should be fixed. The query parameter should be retained for future use in paginating and filtering results.
Expected behavior
- The default query for the repos page should be empty so all results are returned
- The DB client implementations should handle query parameters to support pagination etc. in future.
Additional context
I'll raise PR to correct this in the repos page and at least the file client, perhaps also mongo.
Describe the bug
The repositories page route specifies a default query with a filter that is not correct for repositories (as they don't have the
typefield specified:git-proxy/src/service/routes/repo.js
Lines 8 to 23 in 5d24d9d
Meanwhile the DB implementations ignore the query passed in, which is the only reason that the page displays any repos (as they all would have been hidden by the filter):
File DB client:
git-proxy/src/db/file/repo.js
Lines 9 to 11 in 5d24d9d
Mongo:
git-proxy/src/db/mongo/repo.js
Lines 8 to 11 in 5d24d9d
Both errors should be fixed. The query parameter should be retained for future use in paginating and filtering results.
Expected behavior
Additional context
I'll raise PR to correct this in the repos page and at least the file client, perhaps also mongo.