-
-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose the copy package operation through REST API #1258
Conversation
good idea ! |
@neolynx : Absolutely ! We've been a little busy last few days but we resume our work on this 😄 |
6a712c7
to
cde6ac3
Compare
api/repos.go
Outdated
// POST /repos/:name/copy/:src/:file | ||
func apiReposCopyPackage(c *gin.Context) { | ||
dstRepoName := c.Request.URL.Query().Get("name") | ||
srcRepoName := c.Request.URL.Query().Get("name") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name twice ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah and this was a bad idea 😅, we went with c.Params.ByName(key)
which is actually working. I did a few manual tests which seem to indicate this work. To complete this and cover any future modification of this API, @an0rak-dev will propose a series of tests that goes with this API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome ! thanks for your work, guys 👍
cde6ac3
to
4b606cd
Compare
4b606cd
to
dbfc0e4
Compare
@neolynx I have a dilemma regarding the tests of the new I'll need to create a local aptly repo with an existing .deb package in it while setting up the test. To do so, I have three possibilities :
I kind of like the choice 3, and I'll say that at worst we can still forge the .deb using a local docker container with a volume. What do you think ? |
I think we already have option 2:
and it might be easier to create a system test for the copy API, see the system tests you should be able to prepare with I would suggest to remove the |
Oh ! My bad, I was mislead by the existing I'll rewrite the test using the existing E2E system. |
rebased :) flake8 complains: |
996b071
to
0a304cd
Compare
thanks for your amazing work, @an0rak-dev ! seems like the test is failing:
the 2nd repo returns an emtpy list... was the package not copied ? I think there should be no ".deb" in the :file argument... |
bd527c8
to
8fd408c
Compare
8fd408c
to
fad6da1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks !
Requirements
All new code should be covered with tests, documentation should be updated. CI should pass.
Description of the Change
In case we don't have the possibility to use the
aptly
CLI on a repository, expose theaptly copy
command through the REST API.Checklist
AUTHORS