-
Notifications
You must be signed in to change notification settings - Fork 41
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
Allow upload of source code (and release/reviewer notes) using the API #6158
Comments
This comment has been minimized.
This comment has been minimized.
It might also be nice to allow attaching release- and reviewer-notes when uploading, so publishing could be completely automated. This blocks mozilla/web-ext#804 & mozilla/web-ext#1624. |
Any update on this issue? Just curios since it has been a while |
I'd like to help to implement this feature but I am unfamiliar with the codebase. Would anyone care to guide me through? |
@eviljeff I've verified the new API properties on -dev and these are my results. Please have a look at the source code section in particular because I feel the documentation is not very clear about it or I'm not understanding it fully. Release Notes:
Source code Upload:
As a side note, there is a small error in the API docs: |
Interesting. I can't see any particular reason why it wouldn't work, but I didn't add tests for it. Can you file a follow-up issue?
How are you specifying the values with a formdata formatted request? (I'm a little unclear myself on how complex data structures that are easy in JSON format would be specified as formdata)
whoops, yeah |
@eviljeff I think this all boils down to your last question, because I haven't found the best way to send JSON with a multipart/form-data request yet. I'm using Postman, which has an integrated feature that allows you to specify the content type for each |
@AlexandraMoga I've played around locally in tests and I'm not there is a way to submit complex (lists or objects with nested values) without using JSON. Currently, I can't think of any way that source could be submitted as a nested value - i.e. during addon create, so I think that's an unsupported use-case. If there's no way to specify complex values at the same time as specifying a source file either (i.e. for version create/update) I'll update the api docs to make that clear. |
For the case of new version creation, I've also experimented with smaller bits of data and they weren't accepted either; In the case of release notes, the error message is the following:
So basically, if I want to attach source code, I'm limited to sending only the source file and the
Does this mean that you will update the Version sources docs to no longer include the |
yeah. Only simple values can be sent in a multipart form, so |
Any chance we can get this reopened? I went through the docs, and doesn't look like source code or reviewer notes are supported? |
Both are supported in the API and documented (https://mozilla.github.io/addons-server/topics/api/addons.html#version-create). That being said you did well to file an issue to improve our docs around it. |
@karlicoss There's a GitHub action for uploading to AMO with example code at: https://github.com/birchill/amo-upload/blob/ab657f9e64908ffda49bd3c4bfc1e8bc9fe6d243/index.js#L154-L162 |
@karlicoss I've not investigated but a common gotcha is declaring version level properties (metadata under version-create rather than addon-create) at the top add-on level instead. i.e. it should be this: {
"version": {
"approval_notes": "foo"
}
} |
Thanks, putting it under
, so I'm getting an error here https://github.com/mozilla/web-ext/blob/3e4faa26d4f8ad95cbdf5da75ca9b88dbcc20d9d/src/cmd/sign.js#L96 I could inline (I'd be very happy with simply putting a link to the instructions in the repository, but in the past reviewers demanded pasting detailed step by step addon building instructions in the reviewer notes) |
I think you'll have to inject a stringified representation of your approval notes. |
When uploading an addon using the API (https://addons-server.readthedocs.io/en/latest/topics/api/signing.html) there is no way to upload the source files automatically.
Steps:
It would be nice to have an api for uploading the source files in order to reduce manual intervention.
The text was updated successfully, but these errors were encountered: