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

Feature Request: auto populating plugin data during the initial server setup. #1345

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

SiddheshKukade
Copy link
Member

@SiddheshKukade SiddheshKukade commented Jun 16, 2023

What kind of change does this PR introduce?

Feature for auto populating

Issue Number:

Fixes #1337

Did you add tests for your changes?
N/A

Snapshots/Videos:
Describe the solution you'd like
Some default plugin data should be automatically populated in the mongoDB collection to make sure that all plugin work smoothly

  1. Features working for the first time (No plugin data present in the db)
    Take a look at the success message talawa17june is the name of collection
    image
    Available plugin data on the database for the first time
    image

  2. Features working if the data is already present
    Take a look at the success message talawa17june is the name of collection
    image

Example

Here I've change the Event plugin title to Events22222222
image
But even after running the app it does not change the plugin data as it's already present. Hence maintaining the consistency of the plugin data afterwards.
image
image

Video Demo: Talawa API: Demos of Websocket, schema change, auto populating features

Chapters:

0:00 Auto Populating plugins demo
05:38 Discussing websockets code and change schema code
10:10 Demo of Websockets, createPlugin, updatePluginStatus

https://www.youtube.com/watch?v=MaETaxPGNxk
IMAGE ALT TEXT HERE

If relevant, did you update the documentation?
n/a

Summary

  • Added logic to load the plugin initially in the database on when the developer sets up the app for the first time.
  • The plugin data in src/config/plugins/pluginData.json is considered as primary plugins stating that they are the fundamental features of the app that's why they're there.
  • Now about using them in the app

PRODUCTION MODE

  1. The ADMIN or SUPERADMIN will login and create a new org and then all of the orgs would be uninstalled on for his newly created org by default. So only for the first time the ADMIN or SUPERADMIN whoever creates an org has to manually go to the plugin store and install the required plugins

DEVELOPMENT MODE

  1. I was thinking about making all plugins installed by default by using a wilfcard Org ID but later I discovered some problems that can occur to developers with it.
  2. If the plugin usage explained in PRODUCTION MODE is finalized by reviewers then I will implement another suitable approach for install plugin in development mode IF REQUIRED.

I personally think that, as the ADMIN has to manually install the plugins for the orgs only for the first time to make them visible in the mobile app for development. So the current process will work perfect for them and there will be no need to create any new approach

Does this PR introduce a breaking change?
No breaking changes.

Other information
No

Have you read the contributing guide?
Yes

@SiddheshKukade SiddheshKukade self-assigned this Jun 16, 2023
@github-actions
Copy link

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold
  3. Merge conflicts

The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.

Reviewers

When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

@SiddheshKukade
Copy link
Member Author

Note: Currently the approaches discussed in the PR description for the PRODUCTION and DEVELOPMENT mode are not ready to be used (as the plugins are not re-added yet to mobile app).
I was thinking about adding the websockets logic (which is next step in my project ) in that PR: PalisadoesFoundation/talawa#1778 .
This will ensure that other contributors would not face any problems with their work regarding plugins.

This #1345 pull request can be merged without any issues.

@SiddheshKukade SiddheshKukade requested review from tasneemkoushar, itstasneem and DMills27 and removed request for itstasneem June 16, 2023 16:33
@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Merging #1345 (9c5837c) into develop (68e6f74) will decrease coverage by 0.30%.
The diff coverage is 96.75%.

@@             Coverage Diff             @@
##           develop    #1345      +/-   ##
===========================================
- Coverage    99.59%   99.29%   -0.30%     
===========================================
  Files          177      172       -5     
  Lines        10166    10141      -25     
  Branches       753      757       +4     
===========================================
- Hits         10125    10070      -55     
- Misses          41       61      +20     
- Partials         0       10      +10     
Impacted Files Coverage Δ
src/resolvers/Mutation/updatePost.ts 97.64% <71.42%> (-2.36%) ⬇️
src/resolvers/Mutation/updateEvent.ts 97.24% <72.72%> (-2.76%) ⬇️
src/resolvers/Mutation/createUserTag.ts 99.07% <75.00%> (-0.93%) ⬇️
src/resolvers/Mutation/createEvent.ts 98.24% <76.92%> (-1.76%) ⬇️
src/resolvers/Mutation/togglePostPin.ts 99.13% <80.00%> (-0.87%) ⬇️
src/resolvers/Mutation/updateUserProfile.ts 90.80% <80.00%> (-9.20%) ⬇️
src/resolvers/Mutation/login.ts 99.00% <83.33%> (-1.00%) ⬇️
src/resolvers/Mutation/removeMember.ts 99.32% <90.00%> (-0.68%) ⬇️
src/resolvers/Mutation/createMember.ts 90.82% <90.82%> (ø)
src/directives/authDirective.ts 100.00% <100.00%> (ø)
... and 160 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tasneemkoushar
Copy link
Contributor

@DMills27 please add your review.

@palisadoes palisadoes merged commit 0017abe into PalisadoesFoundation:develop Jun 28, 2023
@SiddheshKukade
Copy link
Member Author

Video Demo: Talawa API: Demos of Websocket, schema change, auto populating features

Chapters:

0:00 Auto Populating plugins demo
05:38 Discussing websockets code and change schema code
10:10 Demo of Websockets, createPlugin, updatePluginStatus

https://www.youtube.com/watch?v=MaETaxPGNxk
IMAGE ALT TEXT HERE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Feature Request: auto populating plugin data during the initial server setup.
4 participants