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

feat(service-worker): add JSON schema for service worker config #27859

Closed
wants to merge 6 commits into from

Conversation

@cyrilletuzi
Copy link
Contributor

@cyrilletuzi cyrilletuzi commented Dec 28, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

No assistance/validation in editor for service worker config.

Issue Number: Fixes #19847

With angular/angular-cli#13325, it will also fix angular/angular-cli#13324

What is the new behavior?

Assistance/validation in editor for service worker config.

Does this PR introduce a breaking change?

  • No

Other information

The schema follows @angular/service-worker interfaces (here).

Descriptions come from the official documentation on angular.io (here).

Default values have been verified in @angular/service-worker code (here).

I don't understand how the build works. When following the contributing guidelines, I can't see the static files that should be copied (like safety-worker.js and schema.json) in dist builds. So this part have to be checked.

As this is just an helper for development, this could be added in a patch version.

@gkalpak

Copy link
Member

@gkalpak gkalpak left a comment

Awesome work 💯

A couple of comments:

  1. Wrap property names/values in backticks or quotes (to make it clear you are referring to a property name/value).
  2. Change the commit message to match our guidelines; e.g.:

    feat(service-worker): add JSON schema for service worker config

    Fixes #19847

packages/service-worker/config/test/generator_spec.ts Outdated Show resolved Hide resolved
packages/service-worker/BUILD.bazel Outdated Show resolved Hide resolved
packages/service-worker/schema.json Outdated Show resolved Hide resolved
packages/service-worker/schema.json Outdated Show resolved Hide resolved
packages/service-worker/schema.json Outdated Show resolved Hide resolved
packages/service-worker/schema.json Outdated Show resolved Hide resolved
packages/service-worker/schema.json Outdated Show resolved Hide resolved
packages/service-worker/config/src/in.ts Outdated Show resolved Hide resolved
@cyrilletuzi
Copy link
Contributor Author

@cyrilletuzi cyrilletuzi commented Dec 29, 2018

For the commit message, I don't see what I'm not respecting from the contributing guidelines, it's just adding the "fixes" part right?

@gkalpak
Copy link
Member

@gkalpak gkalpak commented Dec 29, 2018

It's the "fixes" part and adding add (😉) to the subject (i.e. describing what change you are making: adding a JSON schema (in contrast to updating or fixing or refactoring the JSON schema)).

@cyrilletuzi cyrilletuzi changed the title feat(service-worker): JSON schema for service worker config feat(service-worker): add JSON schema for service worker config Dec 29, 2018
@cyrilletuzi
Copy link
Contributor Author

@cyrilletuzi cyrilletuzi commented Dec 29, 2018

@gkalpak Changes done.

The bazel part (for copying the schema.json in the dist package) should be checked, as I don't know how to check this myself.

Should the fix of the doc (about the bad default for version) be part of this PR or be another?

@cyrilletuzi
Copy link
Contributor Author

@cyrilletuzi cyrilletuzi commented Dec 29, 2018

Integration test is failing but I don't think it's related to this PR.

@gkalpak
Copy link
Member

@gkalpak gkalpak commented Dec 30, 2018

Thx, @cyrilletuzi!

Should the fix of the doc (about the bad default for version) be part of this PR or be another?

Let's make it a separate PR so we can merge it into the patch branch as well.

Copy link
Member

@gkalpak gkalpak left a comment

Almost there 😃 A couple of minor comments.

packages/service-worker/config/schema.json Outdated Show resolved Hide resolved
packages/service-worker/config/schema.json Outdated Show resolved Hide resolved
packages/service-worker/config/schema.json Outdated Show resolved Hide resolved
@cyrilletuzi
Copy link
Contributor Author

@cyrilletuzi cyrilletuzi commented Dec 30, 2018

Changes done. (Again a Travis fail unrelated to this PR)

gkalpak
gkalpak approved these changes Jan 3, 2019
Copy link
Member

@gkalpak gkalpak left a comment

One minor comment. LGTM otherwise 🎉

BTW, it helps with reviews if you make subsequent changes in fixup commits (instead of amending the original commit)

packages/service-worker/config/schema.json Outdated Show resolved Hide resolved
Copy link
Member

@gkalpak gkalpak left a comment

I just checked and it seems that schema.json is not published in dist/packages-dist/. (I had checked before and it was published, but maybe that was before moving it to service-worker/config/.)

Maybe package.json is special (in a way that schema.json is not) and we should include schema.json elsewhere. We need to pull in a bazel expert 😒

@cyrilletuzi
Copy link
Contributor Author

@cyrilletuzi cyrilletuzi commented Mar 5, 2019

@gkalpak Yep, sorry, I've seen you were working at the same time at the moment I pushed. :/

packages/service-worker/config/schema.json Outdated Show resolved Hide resolved
@gkalpak
Copy link
Member

@gkalpak gkalpak commented Mar 5, 2019

I am done. CI is green. @cyrilletuzi, could you take care of #27859 (comment) (if needed)?
(Also happy to drop this commit from the PR, merge the PR and then open a new PR with the fix.)

@cyrilletuzi
Copy link
Contributor Author

@cyrilletuzi cyrilletuzi commented Mar 5, 2019

@gkalpak You're totally right, it's fixed. I hope I didn't mess with your CI fixes, as I admit I'm quite lost with the git conflicts...

gkalpak
gkalpak approved these changes Mar 5, 2019
@ngbot
Copy link

@ngbot ngbot bot commented Mar 5, 2019

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure status "cla/google" is failing
    pending missing required labels: cla: yes
    pending forbidden labels detected: cla: no
    pending status "ci/angular: size" is pending
    pending status "ci/circleci: aio_preview" is pending
    pending status "ci/circleci: build-ivy-npm-packages" is pending
    pending status "ci/circleci: build-npm-packages" is pending
    pending status "ci/circleci: lint" is pending
    pending status "ci/circleci: test" is pending
    pending status "ci/circleci: test_aio" is pending
    pending status "ci/circleci: test_ivy_aot" is pending
    pending missing required status "ci/circleci: publish_snapshot"

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@googlebot
Copy link

@googlebot googlebot commented Mar 5, 2019

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@gkalpak
Copy link
Member

@gkalpak gkalpak commented Mar 5, 2019

Thx, @cyrilletuzi! (No worries about the git merge/rebase mess. I cleaned it up 😉)
As soon as CI is happy, this should be good to go.

merge-asssitance: The fw-compiler, fw-forms and tools-language-service approvals are not needed (they were auto-requested by GitHub after a bad rebase).
merge-assistance: @alexeagle's approval should cover fw-integration. (It probably shows as pending because GitHub auto-re-requested after the aforementioned bad rebase.)

@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Sep 14, 2019

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants