GabeDuarteM / semantic-release-chrome

Set of semantic-release plugins for publishing a Chrome extension release
https://www.npmjs.com/package/semantic-release-chrome
MIT License
43 stars 16 forks source link

fix: ignore warnings in publishing #47

Closed exKAZUu closed 4 years ago

exKAZUu commented 4 years ago

Pull Request

Related issue

Close #46 Include #44

Description

This PR makes this plugin ignores warnings given by Chrome Web Store.

Why

Actually, extensions are published even if warnings occur.

How

This PR makes this plugin ignores warnings whose status code contains WARNING.

Screenshots

[1:55:45 PM] [semantic-release] › ℹ  Start step "publish" of plugin "semantic-release-chrome"
[1:55:54 PM] [semantic-release] › ✖  Failed step "publish" of plugin "semantic-release-chrome"
[1:55:54 PM] [semantic-release] › ℹ  Start step "fail" of plugin "@semantic-release/github"
[1:55:55 PM] [semantic-release] [@semantic-release/github] › ℹ  Created issue #229: https://github.com/WillBooster/plantuml-visualizer/issues/229.
[1:55:55 PM] [semantic-release] › ✔  Completed step "fail" of plugin "@semantic-release/github"
[1:55:55 PM] [semantic-release] › ✖  PUBLISHED_WITH_FRICTION_WARNING Your item needs extra time to review because your item has all hosts permission.
{ AggregateError: 
    SemanticReleaseError: Your item needs extra time to review because your item has all hosts permission.
        at publish (/home/circleci/project/node_modules/semantic-release-chrome/dist/publish.js:62:19)
    at publish (/home/circleci/project/node_modules/semantic-release-chrome/dist/publish.js:66:11)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'AggregateError' }error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

How has this been tested

I've tested my fork (https://github.com/exKAZUu/semantic-release-chrome) including this patch by published my extension using the fork.

Type of change

Checklist

GabeDuarteM commented 4 years ago

Hi @exKAZUu! Thank you for another PR!

I was looking for this PUBLISHED_WITH_FRICTION_WARNING on google, but it doesn't seem very common, mostly it pointed to another extension which had also this problem, and I couldn't find anything about that warning on the webstore api docs... It seems to be related to when the extension gets into a review process, did that happen to you as well?

If it is because of the review thing, the extension probably would not available for download right away (correct me if I'm wrong), so we should probably display a message to inform that to the user so that it doesn't get unnoticed.

exKAZUu commented 4 years ago

@GabrielDuarteM

Thank you for taking your time!

I was looking for this PUBLISHED_WITH_FRICTION_WARNING on google, but it doesn't seem very common, mostly it pointed to another extension which had also this problem, and I couldn't find anything about that warning on the webstore api docs... It seems to be related to when the extension gets into a review process, did that happen to you as well?

Yes. When publishing our extension (https://github.com/WillBooster/plantuml-visualizer), we always face PUBLISHED_WITH_FRICTION_WARNING because our extension has broad permissions (https://github.com/WillBooster/plantuml-visualizer/blob/master/manifest.json#L14-L23). As you understand, this warning indicates Google takes just a long time to review our extension and our extension will be released after 5-10 days.

Are you sure that code can also be PUBLISHED_WITH_FRICTION_WARNING?

Yes, I'm sure. We always receive this warning in code variable and then the current implementation (without this PR) fails.

If it is because of the review thing, the extension probably would not available for download right away (correct me if I'm wrong), so we should probably display a message to inform that to the user so that it doesn't get unnoticed.

This PR shows the following message so I think it's enough.

PUBLISHED_WITH_FRICTION_WARNING: Your item needs extra time to review because your item has all hosts permission.
exKAZUu commented 4 years ago

FYI: we are using my fork (https://github.com/exKAZUu/semantic-release-chrome/blob/master/src/publish.ts) as a temporal workaround in our repo (https://github.com/WillBooster/plantuml-visualizer/blob/master/package.json#L61) and I confirmed this worked well.

GabeDuarteM commented 4 years ago

@exKAZUu Fair enough, it's unfortunate (and a bit weird) that this is not on their docs, but anyway, I left just a small last comment on the PR, and overall it LGTM :)

exKAZUu commented 4 years ago

Hmm, the current type definition doesn't include logger.warn. I will check whether logger.warn exists in semantic-release or not at first.

GabeDuarteM commented 4 years ago

Yesterday I took a quick look at their code, it seems that they use warn here https://github.com/semantic-release/semantic-release/blob/7a939a897097a730f1579002ed641a583d3381c4/index.js#L29

It seems that they use signale to create the logger, which has the warn variant, so I guess its just a matter of adding it to the typings

exKAZUu commented 4 years ago

Thanks! I've added the type definition.

GabeDuarteM commented 4 years ago

Thanks a lot for the PR!

github-actions[bot] commented 4 years ago

:tada: This PR is included in version 1.1.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: