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

Remove unused files and packages leading to deprecated warning #1936

Closed

Conversation

pranshugupta54
Copy link
Member

@pranshugupta54 pranshugupta54 commented Mar 3, 2024

What kind of change does this PR introduce?

Removed files related to image-hash and pm2 to fix deprecated uuid@3.4.0

Issue Number:

Fixes #1517

Does this PR introduce a breaking change?

Should try uploading same image for multiple user accounts for testing it once.

  • Already tested though

Note:

I'm not familiar with Talawa App, please make sure to test changing images for user and organisations once

Community-Programmer and others added 12 commits December 22, 2023 10:15
* Replace package vm2 with isolated-vm

* Removed package isolated-vm
…oundation#1668)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 3.2.7 to 3.2.8.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v3.2.8/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v3.2.8/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Adding information for MongoDB retry writes feature access.
…n#1808)

Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.9.6 to 6.9.9.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](nodemailer/nodemailer@v6.9.6...v6.9.9)

---
updated-dependencies:
- dependency-name: nodemailer
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Copy link

github-actions bot commented Mar 3, 2024

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

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
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

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

  1. You have removed organization an user image functionality.
  2. Have you checked whether these changes will affect the ability of users to change their profile pictures and organizations to change their thumbnail image in the Admin organizations screen?

This PR seems to be negatively affecting the end user experience and will cause the API clients to break

@pranshugupta54
Copy link
Member Author

  1. You have removed organization an user image functionality.
  2. Have you checked whether these changes will affect the ability of users to change their profile pictures and organizations to change their thumbnail image in the Admin organizations screen?

This PR seems to be negatively affecting the end user experience and will cause the API clients to break

@palisadoes, these files are not being used.
I've tried changing image for the organisation and also for users
https://www.loom.com/share/bff223e2b50344afbadad024ca2d240a?sid=94774c63-7279-4a73-a317-f9edeee47a0c

@pranshugupta54
Copy link
Member Author

Files from src/utilities/encodedImageStorage are being used for this.

image

@palisadoes
Copy link
Contributor

Files from src/utilities/encodedImageStorage are being used for this.
image

Thanks

@palisadoes
Copy link
Contributor

Please fix the failing tests

@Cioppolo14
Copy link
Contributor

@pranshugupta54 It looks like there are still some failing tests. Let us know when its ready.

@pranshugupta54
Copy link
Member Author

@pranshugupta54 It looks like there are still some failing tests. Let us know when its ready.

Hey @Cioppolo14, it's failing some env error test. I think there is some issue with Repo's env added to secrets

Copy link
Member

@varshith257 varshith257 left a comment

Choose a reason for hiding this comment

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

@pranshugupta54 Can I know why you removed pm2?

As pm2 is an important process manager for talawa-api production environment which facilitates built in load-balancing,logging, provide 24/7 no downtime for applications and various facilities for prod env setup.

@pranshugupta54
Copy link
Member Author

@pranshugupta54 Can I know why you removed pm2?

As pm2 is an important process manager for talawa-api production environment which facilitates built in load-balancing,logging, provide 24/7 no downtime for applications and various facilities for prod env setup.

@varshith257, Oh, wasn't sure about production, didn't find it getting imported anywhere.
If we have to use pm2 for production then we'll get the uuid deprecated warning until pm2 fixes it

@pranshugupta54
Copy link
Member Author

pm indirectly depends on uuid@3.4.0
image

@varshith257
Copy link
Member

pm indirectly depends on uuid@3.4.0 image

I have found many reporting about this issue in the package repo of pm2
Unitech/pm2#5733

@xoldyckk Can we use pm2 ignoring the deprecated warning of uuid which hasn't been solved for almost 2+ years of the same issue?
OR
Can we use pm2 alternatives but none of the alternatives provide features of pm2 such as load-balancing , no downtime etc....
https://nodejs.libhunt.com/pm2-alternatives

@pranshugupta54
Copy link
Member Author

@varshith257, the failing test shows the env which uses localhost 🤔

@pranshugupta54
Copy link
Member Author

Failing test's env:
image

@pranshugupta54
Copy link
Member Author

Test passed on another PR with same error - here

image

@varshith257
Copy link
Member

varshith257 commented Mar 10, 2024

@varshith257, the failing test shows the env which uses localhost 🤔

Switch to replica set. It should resolve the above problem. Get ahead to Mongo atlas and create a cluster and copy the connection string for the use of mongo-compass and use that string in mongoDB atlas to create a new connection in mongoDB compass and connect it.

Recently a PR got merged for strict use of replica-set db only. If it isn't a replica set the session can't start and can throw error as above.

@pranshugupta54
Copy link
Member Author

pranshugupta54 commented Mar 10, 2024

@varshith257, the failing test shows the env which uses localhost 🤔

Switch to replica set. It should resolve the above problem. Get ahead to mongo atlas and create a cluster and copy connection string for use of mongo-compass and use that string in mongo atlas to create a new connection in mongoDB comopass and connect it .

Connecting to a mongodb atlas won't do anything as i'll be adding it on my local, so there will be no change on Github Action test

@pranshugupta54
Copy link
Member Author

Test passed on another PR with same error - here

image

How is this PR passing with replica set error

@varshith257
Copy link
Member

@pranshugupta54 Got it. I haver observed the behaviour of it. Let me update you on this

@varshith257
Copy link
Member

@pranshugupta54 I have seen the related changes you made to remove image-hash instead it using encodedImageStorage.

  1. You have made changes related to organization image functionality to use encodedImageStorage but you have also deleted the user image functionality instead of modifications.
  2. IMO the image functionality for the user has been dropped. Can you test the image functionality of the user and submit a video as you have done for the org image functionality?

@pranshugupta54
Copy link
Member Author

@varshith257
Copy link
Member

@palisadoes @pranshugupta54 I have tested with dummy PR. The .env variables error is bypassing it isn't the cause of the error. I suscept the issue related to code changes.

@pranshugupta54 as in your error log it also has been bypassed error it doesn't exit with an error due to it. Can run npm run test locally to test changes and verify if is it working fine there?

@pranshugupta54
Copy link
Member Author

@varshith257, it fails on 1 test of fundraising, though this PR has no file changes related to it
image

@pranshugupta54
Copy link
Member Author

It's so confusing now, when i try to test particular file then it passes all

image image

@pranshugupta54
Copy link
Member Author

Hey @palisadoes / @Cioppolo14 / @xoldyckk , is there anything else needed here?

@Olatade
Copy link

Olatade commented Mar 13, 2024

@pranshugupta54 please can you update your branch, it is currently out of date with the develop branch

@pranshugupta54
Copy link
Member Author

Hey @Olatade, updated 👍

Copy link
Member

@varshith257 varshith257 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@varshith257 varshith257 left a comment

Choose a reason for hiding this comment

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

> talawa-api@1.0.0 format:check
> prettier --check "**/*.{ts,tsx,json,scss,css}"

Checking formatting...
[warn] src/utilities/index.ts
[warn] Code style issues found in the above file. Run Prettier to fix.
Error: Process completed with exit code 1.

fix this only it is stopper to pass the all tests
Run Prettier to fix this to src/utilities/index.ts

@pranshugupta54
Copy link
Member Author

Fixed it.
(Didn't add an empty line at the end 😃)

@pranshugupta54
Copy link
Member Author

The test is again failing at some unknown test.
(The env error passes for all PRs, so thats not the issue)

@palisadoes
Copy link
Contributor

Please ask the #talawa-api slack community

@palisadoes
Copy link
Contributor

This is an update on the PR merging freeze:

  1. In the next few hours we will be merging the develop-userTypeFix branch into the develop branch.
  2. The develop-userTypeFix branch was created to fix a long standing design flaw where Admins were Admins of all organizations, not specific ones.
  3. The userType field has been removed from the User collection and it has been replaced by an appUserProfileId field.
    1. This field is null if the user isn’t registered to use the apps. This will help people to add users manually during the event checkin process, or if an Admin wants to manually add someone in the Admin dashboard.
    2. When not null the AppUserProfileID will reference a AppUserProfile collection with App related information such as the organizations for which a user may be an Admin.
    3. The updated schema can be found here https://github.com/PalisadoesFoundation/talawa-api/blob/develop-userTypeFix/schema.graphql
    4. This is the parent issue that we have been using to track progress:
      1. PARENT ISSUE: Fix the usage of userType #1965
  4. This merge will cause some conflicts in your PR.

We decided to do this at the beginning of the weekend to give us all time to adjust PR code and create bug fixes that may arise.

Update your code at or after midnight GMT on the morning of March 23, 2024. (5:30am IST).

If your PRs have already been approved, request a re-review after fixing the conflicts and refactoring to the new AppUserProfileID methodology.

@palisadoes
Copy link
Contributor

The PR merging freeze is lifted.

  1. We are working on bug fixes that may arise. These should be few and are being tracked here:
    1. https://github.com/orgs/PalisadoesFoundation/projects/24
  2. Please update your PRs and local repos. Fix any new merge conflicts that may have occurred.

Background:

  1. The develop-userTypeFix branch was created to fix a long standing design flaw where Admins were Admins of all organizations, not specific ones.
  2. The userType field has been removed from the User collection and it has been replaced by an appUserProfileId field.
    1. This field is null if the user isn’t registered to use the apps. This will help people to add users manually during the event checkin process, or if an Admin wants to manually add someone in the Admin dashboard.
    2. When not null the AppUserProfileID will reference a AppUserProfile collection with App related information such as the organizations for which a user may be an Admin.
    3. The updated schema can be found here https://github.com/PalisadoesFoundation/talawa-api/blob/develop-userTypeFix/schema.graphql
    4. This is the parent issue that we have been using to track progress:
      1. PARENT ISSUE: Fix the usage of userType #1965
  3. If your PRs have already been approved, request a re-review after fixing the conflicts and refactoring to the new AppUserProfileID methodology.

@Cioppolo14
Copy link
Contributor

@pranshugupta54 Please fix the conflicting files and failed tests.

@pranshugupta54
Copy link
Member Author

Now, the issue requires too many other packages to be removed too for fixing the deprecated packages.

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.

7 participants