Skip to content
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

upload files icon #2868

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

eviljeff
Copy link
Member

@eviljeff eviljeff commented Sep 5, 2023

further part of #2497, depends on #2859 - implements add-on icon upload.

I'm going to say fixes #2497 as previews (screenshots) use a different sub endpoint and with things like localized captions would be a feature in itself - that would need evaluating for usefulness first.

@eviljeff eviljeff force-pushed the 2497-upload-files-icon branch from d5a46fa to b5dc49a Compare September 27, 2023 09:40
@eviljeff eviljeff requested a review from Rob--W September 27, 2023 11:25
Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I posted a question below. More broadly I'm also wondering what the desired behavior is when a post-submission failure occurs. I guess that the current failure mode is to still create the XPI on AMO, but to not have it available locally.

I can imagine conflicting requirements, depending on the most desired scenario:

  • Someone wants to publish an update and doesn't care about source code submission or icon/metadata
    • In this case, it would be desirable to upload the xpi and ignore any icon/source code errors.
    • The downside to ignoring errors is that if used in CI, that people won't know that the icon/source code submission has failed. So perhaps it's better to not ignore the error completely, but at least wait until the next appropriate checkpoint before exiting with an error.
  • Someone wants to publish an update and cares about the add-on listing & branding to be in sync with the add-on package.
    • In this case, it would be desirable to update everything in one transaction, and not commit the changes until every part succeeded.

log.info(`Submitting ${Object.keys(patchData.addon)} to addon`);
promises.push(this.doFormDataPatch(patchData.addon, addonId));
}
await Promise.all(promises);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version-specific (source code) data and addon-global (icon) data are independent. A failure in any of these can result in an early termination of the logic. Is that desirable?

Instead of termination as soon as any failure occurs, it may make sense to wrap individual promises in always-fulfilling promises and doing error handling there.

Alternatively, if you'd like to report errors late, use Promise.allSettled, and then check whether there are any errors (and print useful information if needed).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, broadly, proceeding with a warning is probably the way forward - because at that point they can't fix the problem without a whole new version being uploaded (with a version number bump).

The downside is there isn't a function in web-ext to make arbitrary API calls without uploading a versions. So the "fix" would be for them to either make a manual API request (difficult, without the tooling to make the jwt for the Auth); or use devhub (a different UX to command line). And yeah, they might miss the message in the other logging if there isn't a hard error thrown.

Given this is a flaw with the source code upload too, we should probably address that as a separate issue first (blocking V8?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support uploading file content to addons submission api
2 participants