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

standarized file uploads #1773

Closed

Conversation

manishjha-04
Copy link

Pull Request: Standarizing file Uploads

Description

This pull request addresses the issue < #1715 >, which involves

  1. Limiting the image size and resizing to a configured maximum in the .env file
  2. Updating the setup.ts script to manage this new parameter and
  3. Limiting the image types that can be uploaded to the most popular predefined types

Changes Made

  1. Added new environment variables for image validation in .env.sample.
  2. Created the imageValidation function in setup.ts to prompt the user for image upload settings and update the .env file accordingly.
  3. Integrated image check whereever the upload was needed basically it looks for file type and image size and also resizes the image to the given size in .env file

Video

Below is changes made in setup.ts file as asked for in the previous PR

20240131-2050-02.5856874.mp4

Copy link

github-actions bot commented Jan 31, 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

@Cioppolo14
Copy link
Contributor

@manishjha-04 Please set the image size in MB and update the installation.md file for the new parameters.

@manishjha-04
Copy link
Author

@Cioppolo14 done!..please review!

@Cioppolo14
Copy link
Contributor

@manishjha-04 Please fix the linting/formatting test errors.

@manishjha-04
Copy link
Author

hey @Cioppolo14 fixed the linting issue

Copy link

codecov bot commented Feb 4, 2024

Codecov Report

Attention: 93 lines in your changes are missing coverage. Please review.

Comparison is base (c0468a4) 98.17% compared to head (6de868e) 97.83%.
Report is 308 commits behind head on develop.

Files Patch % Lines
src/libraries/errors/ImageSizeLimitExceeded.ts 27.27% 16 Missing ⚠️
src/resolvers/Mutation/updateUserProfile.ts 72.41% 1 Missing and 15 partials ⚠️
src/resolvers/Mutation/createEvent.ts 83.51% 13 Missing and 2 partials ⚠️
src/resolvers/middleware/currentUserExists.ts 45.83% 13 Missing ⚠️
src/libraries/logger.ts 16.66% 10 Missing ⚠️
src/resolvers/Mutation/createPost.ts 85.07% 10 Missing ⚠️
src/resolvers/Mutation/createOrganization.ts 96.03% 4 Missing ⚠️
src/resolvers/Mutation/addOrganizationImage.ts 90.32% 3 Missing ⚠️
src/resolvers/Mutation/removeAdvertisement.ts 92.85% 2 Missing ⚠️
...c/resolvers/Query/postsByOrganizationConnection.ts 33.33% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1773      +/-   ##
===========================================
- Coverage    98.17%   97.83%   -0.35%     
===========================================
  Files          184      227      +43     
  Lines        10767    13781    +3014     
  Branches       835     1151     +316     
===========================================
+ Hits         10571    13483    +2912     
- Misses         186      266      +80     
- Partials        10       32      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

This pull request did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please verify it has no conflicts with the develop branch and rebase if needed. Mention it now if you need help or give permission to other people to finish your work.

@github-actions github-actions bot added the no-pr-activity No pull request activity label Feb 15, 2024
@palisadoes
Copy link
Contributor

Closing due to inactivity

@palisadoes palisadoes closed this Feb 15, 2024
@manishjha-04
Copy link
Author

manishjha-04 commented Feb 15, 2024

Hi @palisadoes , @Cioppolo14 ,

I hope you're doing well. The PR was closed without review. Could you kindly share why it was closed prematurely? I'm eager to learn and improve.

@palisadoes
Copy link
Contributor

My mistake. I was using my phone and was looking at the wrong screen in making the decision.

Reopening

@palisadoes palisadoes reopened this Feb 15, 2024
@palisadoes
Copy link
Contributor

Due to work commitments this will probably not be reviewed until the weekend

@manishjha-04
Copy link
Author

Okay Sir , no issues! 😃

@github-actions github-actions bot removed the no-pr-activity No pull request activity label Feb 16, 2024
@palisadoes
Copy link
Contributor

NOTE Read very carefully

  1. We just merged this PR which upgraded the prettier package.
    1. Upgraded prettier from version 2.8,8 to 3.2.5. #1840
  2. It reformatted over 400 files. This will put your PR at risk of extensive merge conflicts.
  3. I suggest that before you merge your code to the latest upstream, or manually fix these merge conflicts that you:
    1. upgrade your prettier in your local branch to the same version
    2. run prettier

This will help to reduce the number of future merge conflicts for your PR.

@Cioppolo14
Copy link
Contributor

@manishjha-04 Can you resolve the conflicting files?

@manishjha-04
Copy link
Author

Sure would be resolving it soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants