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: user management feature with auth0 #562

Closed
wants to merge 81 commits into from

Conversation

vickywane
Copy link
Contributor

@vickywane vickywane commented Feb 16, 2021

This closes this

This PR contains work done to implement the new user management feature.

Note: This PR is an active WIP.

A test of the work being done can be found in the Staging PWA here.

This design flow diagram visualizes the steps performed by different actors to achieve a user subscription.

user-subscription (2)

@commit-lint
Copy link
Contributor

commit-lint bot commented Feb 16, 2021

Features

  • implemented user auth using Identity (3af24ce)
  • added edge-device sync feature (e262415)

Update

  • implemented sync with edge-pwa (2f13a9f)
  • updated obselete tests (594583c)
  • updated obselete tests (d786845)
  • added unit tests for new component (0f077df)
  • edge connections (0faabcb)

Bug Fixes

  • fixed conflicts (deea843)
  • fixed conflicts (b00614b)
  • fixed conflicts (e62cc16)
  • fixed conflicts (1c67c0b)
  • fixed conflicting files (23fed07)
  • fixed conflicting files (1293a0d)
  • fixed conflicting files (3d53814)
  • fixed package-lock.json conflict (ddc9995)
  • fixed package-lock.json conflict (24ec57b)
  • fixing lock files conflict (848b685)
  • fixing lock files conflict (08a2889)
  • fix lock files conflict (991a778)
  • fix lock file conflict (81b2fb4)
  • fixed git conflicts (d4bd8f8)
  • merge conflict (98698d8)
  • merge conflicting package.json file (ed9bee3)
  • merge conflicting package.json file (3f9fc99)
  • added range validation for subscriptions (b4effa7)
  • merge conflicting package.json file (696eaea)

Contributors

vickywane

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

@vickywane vickywane requested a review from ivelin February 16, 2021 09:58
@vickywane vickywane marked this pull request as draft February 16, 2021 09:59
@vickywane vickywane self-assigned this Feb 16, 2021
Copy link
Contributor

@ivelin ivelin left a comment

Choose a reason for hiding this comment

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

@vickywane good call today.

I see that several checks fail the CI. Can you please clear all errors and also polish the rough edges that I experienced today. Users should not have to manually reload a page to get the expected behavior.

Thank you!

@vickywane vickywane force-pushed the feature/user-management branch from 0890ca2 to a063f8e Compare February 17, 2021 09:51
@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #562 (901a755) into master (ca5d6e7) will increase coverage by 3.46%.
The diff coverage is 95.72%.

❗ Current head 901a755 differs from pull request most recent head 04ced60. Consider uploading reports for the commit 04ced60 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #562      +/-   ##
==========================================
+ Coverage   82.11%   85.58%   +3.46%     
==========================================
  Files          35       42       +7     
  Lines         973     1311     +338     
  Branches       84      112      +28     
==========================================
+ Hits          799     1122     +323     
- Misses        174      189      +15     
Impacted Files Coverage Δ
src/views/Home.vue 100.00% <ø> (ø)
src/views/Timeline.vue 29.41% <25.00%> (-0.67%) ⬇️
src/main.js 73.68% <54.54%> (-26.32%) ⬇️
src/components/edge-auth0-sync.vue 92.68% <92.68%> (ø)
src/components/authBarMenu.vue 96.36% <96.36%> (ø)
src/components/subscriptionDialog.vue 96.55% <96.55%> (ø)
src/auth/index.js 98.03% <98.03%> (ø)
...ss/integration/ambianic-tests/authbar-menu.spec.js 100.00% <100.00%> (ø)
cypress/integration/ambianic-tests/navbar.spec.js 100.00% <100.00%> (ø)
...tegration/ambianic-tests/remote-connection.spec.js 100.00% <100.00%> (ø)
... and 15 more

@vickywane vickywane force-pushed the feature/user-management branch from 0d8b090 to 2f13a9f Compare March 30, 2021 12:02
@vickywane vickywane changed the title feat: User management feature using Netlify Identity, Functions and Stripe feat: user management feature with auth0 Mar 30, 2021
@vickywane vickywane force-pushed the feature/user-management branch from 638c998 to f77a2d4 Compare July 6, 2021 09:51
@lgtm-com
Copy link

lgtm-com bot commented Jul 6, 2021

This pull request introduces 1 alert when merging f77a2d4 into 7d7672f - view on LGTM.com

new alerts:

  • 1 for Property access on null or undefined

@lgtm-com
Copy link

lgtm-com bot commented Jul 6, 2021

This pull request introduces 1 alert when merging 915218c into 7d7672f - view on LGTM.com

new alerts:

  • 1 for Property access on null or undefined

@vickywane vickywane marked this pull request as ready for review July 6, 2021 12:08
@vickywane vickywane requested a review from ivelin July 6, 2021 12:08
@vickywane
Copy link
Contributor Author

@ivelin

I have made changes based on your last review.

As a rule of thumb, all new test suites now end with an assertion. Also, I have renamed most of the tests to have more descriptive names.

The merged jest + cypress report is now being uploaded as an artifact on each CI build.

Copy link
Contributor

@ivelin ivelin left a comment

Choose a reason for hiding this comment

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

@vickywane there are still a lot of unresolved conversations. Please take a look at each and provide your comment so we can resolve them. There are currently 23 unresolved conversations in this PR. Click on Conversations to see the list.
Screen Shot 2021-07-09 at 3 33 44 AM

Copy link
Contributor

@ivelin ivelin left a comment

Choose a reason for hiding this comment

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

@vickywane a few minor comments remain. Also the lighthouse errors needs to be fixed.

@@ -43,6 +43,11 @@ jobs:
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Jest coverage to Github Artifacts
Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane should this name value be updated to "Upload combined test coverage report ..." ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, i have renamed this job.

package.json Outdated
@@ -97,7 +103,7 @@
],
"license": "Apache-2.0",
"nyc": {
"report-dir": "coverage",
"report-dir": "cypress-coverage",
Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane what is the purpose of setting nyc's report-dir parameter to the cypress-coverage dir?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially i wanted to create seperate folders for the two reports. I have restored it back to the coverage name.

@@ -0,0 +1,40 @@
{"/home/victory/Desktop/OSS/ambianic-ui/cypress/integration/ambianic-tests/about.spec.js": {"path":"/home/victory/Desktop/OSS/ambianic-ui/cypress/integration/ambianic-tests/about.spec.js","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":33,"column":2}},"1":{"start":{"line":3,"column":2},"end":{"line":5,"column":4}},"2":{"start":{"line":4,"column":4},"end":{"line":4,"column":22}},"3":{"start":{"line":7,"column":2},"end":{"line":13,"column":4}},"4":{"start":{"line":8,"column":4},"end":{"line":9,"column":42}},"5":{"start":{"line":11,"column":4},"end":{"line":12,"column":57}},"6":{"start":{"line":15,"column":2},"end":{"line":20,"column":4}},"7":{"start":{"line":16,"column":14},"end":{"line":16,"column":37}},"8":{"start":{"line":17,"column":4},"end":{"line":17,"column":48}},"9":{"start":{"line":18,"column":4},"end":{"line":19,"column":54}},"10":{"start":{"line":22,"column":2},"end":{"line":27,"column":4}},"11":{"start":{"line":23,"column":14},"end":{"line":23,"column":37}},"12":{"start":{"line":24,"column":4},"end":{"line":24,"column":48}},"13":{"start":{"line":25,"column":4},"end":{"line":26,"column":49}},"14":{"start":{"line":29,"column":2},"end":{"line":32,"column":4}},"15":{"start":{"line":30,"column":4},"end":{"line":31,"column":48}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}},"loc":{"start":{"line":2,"column":27},"end":{"line":33,"column":1}},"line":2},"1":{"name":"(anonymous_1)","decl":{"start":{"line":3,"column":13},"end":{"line":3,"column":14}},"loc":{"start":{"line":3,"column":19},"end":{"line":5,"column":3}},"line":3},"2":{"name":"(anonymous_2)","decl":{"start":{"line":7,"column":33},"end":{"line":7,"column":34}},"loc":{"start":{"line":7,"column":39},"end":{"line":13,"column":3}},"line":7},"3":{"name":"(anonymous_3)","decl":{"start":{"line":15,"column":30},"end":{"line":15,"column":31}},"loc":{"start":{"line":15,"column":36},"end":{"line":20,"column":3}},"line":15},"4":{"name":"(anonymous_4)","decl":{"start":{"line":22,"column":30},"end":{"line":22,"column":31}},"loc":{"start":{"line":22,"column":36},"end":{"line":27,"column":3}},"line":22},"5":{"name":"(anonymous_5)","decl":{"start":{"line":29,"column":27},"end":{"line":29,"column":28}},"loc":{"start":{"line":29,"column":33},"end":{"line":32,"column":3}},"line":29}},"branchMap":{},"s":{"0":2,"1":2,"2":8,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":2,"12":2,"13":2,"14":2,"15":2},"f":{"0":2,"1":8,"2":2,"3":2,"4":2,"5":2},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"d4de55937d062e0d9578189324a6e10f4d882989"}
Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane what is the purpose of adding a coverage report to the github repo? Did you mean to add these files to .gitignore?

Copy link
Contributor

@ivelin ivelin left a comment

Choose a reason for hiding this comment

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

Found a few more unaddressed and unresolved comments.

@@ -43,6 +43,11 @@ jobs:
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Jest coverage to Github Artifacts
Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane did you see this comment?

.github/workflows/main.yml Outdated Show resolved Hide resolved
./coverage/coverage-final.json
./coverage/jest/coverage-final.json
./cypress-coverage/coverage-final.json
./jest-coverage/coverage-final.json
fail_ci_if_error: true # optional (default = false)
path_to_write_report: ./coverage/codecov_report.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane Looking at the codecov docs again, I think we can use this file to directly upload it as a combined coverage report artifact for github action and skip all the nyc merging code in this action workflow. Worth a try. Here is some example docs to look at:
https://github.com/codecov/codecov-action#example-workflowyml-with-codecov-action

Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane Did you see this comment from 15 days ago?
If you looked at the out.json file currently uploaded as a github artifact, you will notice that it is not convenient to read. Let's see if we can use a txt or html format that allows us to quickly understand the coverage report.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have implemented the upload action to upload the file uploaded from this codecov job.

Should i discard the previous copy scripts implemented manually?

If you looked at the out.json file currently uploaded as a github artifact, you will notice that it is not convenient to read. Let's see if we can use a txt or html format that allows us to quickly understand the coverage report.

The current file being uploaded to GH artifacts is in a readable txt format.

package.json Outdated
"codecov:e2e": "codecov -f ./coverage/coverage-final.json",
"codecov:unit": "codecov -f ./coverage/jest/coverage-final.json",
"codecov": "codecov -f coverage/coverage-final.json && codecov -f coverage/jest/coverage-final.json",
"codecov:e2e": "codecov -f ./jest-coverage/coverage-final.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane did you see this comment ^^

@vickywane
Copy link
Contributor Author

@ivelin I have created this separate issue to track the Lighthouse error.

I will fix it today in a new pull request and revert to this.

@vickywane
Copy link
Contributor Author

@vickywane what is the purpose of adding a coverage report to the GitHub repo? Did you mean to add these files to .gitignore?

The reports directory is already included in the .gitignore file.

@vickywane
Copy link
Contributor Author

@vickywane should this name value be updated to "Upload combined test coverage report ..." ?

I have renamed the job.

@vickywane
Copy link
Contributor Author

@vickywane what is the purpose of setting nyc's report-dir parameter to the cypress-coverage dir?

I wanted to split the two tests into separate directories.

@lgtm-com
Copy link

lgtm-com bot commented Jul 19, 2021

This pull request introduces 1 alert when merging 6cfa5a7 into 7d7672f - view on LGTM.com

new alerts:

  • 1 for Property access on null or undefined

@vickywane vickywane force-pushed the feature/user-management branch from b0285eb to 9b81297 Compare July 22, 2021 11:51
@lgtm-com
Copy link

lgtm-com bot commented Jul 22, 2021

This pull request introduces 1 alert when merging 9b81297 into 7d7672f - view on LGTM.com

new alerts:

  • 1 for Property access on null or undefined

@ivelin
Copy link
Contributor

ivelin commented Jul 25, 2021

@vickywane this PR is now out of sync with upstream. Please re-sync.

Copy link
Contributor

@ivelin ivelin left a comment

Choose a reason for hiding this comment

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

@vickywane see open comments.

./coverage/coverage-final.json
./coverage/jest/coverage-final.json
./cypress-coverage/coverage-final.json
./jest-coverage/coverage-final.json
fail_ci_if_error: true # optional (default = false)
path_to_write_report: ./coverage/codecov_report.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane Did you see this comment from 15 days ago?
If you looked at the out.json file currently uploaded as a github artifact, you will notice that it is not convenient to read. Let's see if we can use a txt or html format that allows us to quickly understand the coverage report.

package.json Outdated
"codecov:e2e": "codecov -f ./coverage/coverage-final.json",
"codecov:unit": "codecov -f ./coverage/jest/coverage-final.json",
"codecov": "codecov -f coverage/coverage-final.json && codecov -f coverage/jest/coverage-final.json",
"codecov:e2e": "codecov -f ./jest-coverage/coverage-final.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane Reminder. This comment was made 25 days ago...

"codecov:unit": "codecov -f ./coverage/jest/coverage-final.json",
"codecov": "codecov -f coverage/coverage-final.json && codecov -f coverage/jest/coverage-final.json",
"codecov:e2e": "codecov -f ./jest-coverage/coverage-final.json",
"codecov:unit": "codecov -f ./jest-coverage/coverage-final.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

@vickywane codecov:unit and codecov appear to be stale. Are these used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. They are not being used by the application itself, except by other contributors.

I have removed the codecov:unit script.

@vickywane
Copy link
Contributor Author

vickywane commented Jul 26, 2021

codecov:unit and codecov appear to be stale. Are these used anywhere?

No they are not being used by the application. Alongside with codecov:e2e.
Could they're be a usecase for developers executing the commands?

Should i proceed to remove them?

@lgtm-com
Copy link

lgtm-com bot commented Jul 26, 2021

This pull request introduces 1 alert when merging 9680489 into 011fdad - view on LGTM.com

new alerts:

  • 1 for Property access on null or undefined

@lgtm-com
Copy link

lgtm-com bot commented Jul 26, 2021

This pull request introduces 1 alert when merging 159579b into 011fdad - view on LGTM.com

new alerts:

  • 1 for Property access on null or undefined

@lgtm-com
Copy link

lgtm-com bot commented Jul 26, 2021

This pull request introduces 1 alert when merging 901a755 into 011fdad - view on LGTM.com

new alerts:

  • 1 for Property access on null or undefined

@vickywane vickywane force-pushed the feature/user-management branch from 901a755 to 04ced60 Compare July 30, 2021 13:17
@lgtm-com
Copy link

lgtm-com bot commented Jul 30, 2021

This pull request introduces 1 alert when merging 04ced60 into 011fdad - view on LGTM.com

new alerts:

  • 1 for Property access on null or undefined

@ivelin ivelin closed this Dec 9, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: implement premium subscription management
2 participants