-
Notifications
You must be signed in to change notification settings - Fork 33
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
Adds check empty file upload and tests added tests for file upload. #160
Conversation
Warning Rate limit exceeded@gnaaruag has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 53 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes primarily focus on enhancing file upload functionality by checking for empty file uploads, updating interceptor handling, expanding the file interface, and adding comprehensive tests. Additionally, the contribution guidelines have been significantly restructured for clarity. This ensures better resource management, security, data integrity, and developer guidance. Changes
Sequence Diagram(s)
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
packages/common/src/controllers/file-upload.controller.ts (1)
32-32
: Improve comment clarity.The comment on line 32 can be made clearer.
- // file.size comes from MultiPartFile Interface defined in file-upload.interface + // file.size is a property of the MultipartFile interface defined in file-upload.interface.ts
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- packages/common/src/controllers/file-upload.controller.ts (2 hunks)
- packages/common/src/interceptors/file-upload.interceptor.ts (1 hunks)
- packages/common/src/interfaces/file-upload.interface.ts (1 hunks)
- packages/common/test/app.e2e-spec.ts (2 hunks)
- sample/06-file-upload/test/app.e2e-spec.ts (2 hunks)
Additional comments not posted (10)
packages/common/src/interfaces/file-upload.interface.ts (1)
17-18
: LGTM!The new properties
size
andbuffer
are appropriate additions to theMultipartFile
interface to support the empty file check functionality.packages/common/src/interceptors/file-upload.interceptor.ts (1)
35-36
: LGTM!The change to set
request.raw
torequest
if it is falsy ensures a valid request body, which is a good practice.packages/common/test/app.e2e-spec.ts (3)
5-6
: LGTM!The new imports for
fs
andpath
are necessary for handling file operations in the test cases.
27-43
: LGTM!The new test case for uploading a file with content covers the expected functionality and includes a cleanup procedure to remove the uploaded file.
45-57
: LGTM!The new test case for checking empty file uploads effectively verifies that the system correctly handles and rejects empty file uploads.
sample/06-file-upload/test/app.e2e-spec.ts (3)
5-6
: LGTM!The new imports for
fs
andpath
are necessary for handling file operations in the test cases.
27-43
: LGTM!The new test case for uploading a file with content covers the expected functionality and includes a cleanup procedure to remove the uploaded file.
45-57
: LGTM!The new test case for checking empty file uploads effectively verifies that the system correctly handles and rejects empty file uploads.
packages/common/src/controllers/file-upload.controller.ts (2)
18-18
: LGTM!The constructor looks good and initializes the
filesService
properly.
32-38
: LGTM!The check for empty file uploads is a great addition to improve security and resource efficiency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
Outside diff range and nitpick comments (1)
CONTRIBUTING.md (1)
Line range hint
79-79
:
Fix the typo.Correct the typo in "realted" to "related".
- You can help review open PRs for best backend and devops realted code practices and help the contributors out. + You can help review open PRs for best backend and devops related code practices and help the contributors out.Tools
LanguageTool
[grammar] ~1-~1: This phrase is duplicated. You should probably use “Contributing Guide” only once.
Context: # Contributing Guide - Contributing Guide - [Repository St...(PHRASE_REPETITION)
Markdownlint
3-3: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
4-4: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
5-5: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
6-6: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
7-7: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
8-8: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
9-9: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
10-10: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
11-11: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
12-12: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
3-3: Column: 1
Hard tabs(MD010, no-hard-tabs)
4-4: Column: 1
Hard tabs(MD010, no-hard-tabs)
5-5: Column: 1
Hard tabs(MD010, no-hard-tabs)
6-6: Column: 1
Hard tabs(MD010, no-hard-tabs)
7-7: Column: 1
Hard tabs(MD010, no-hard-tabs)
8-8: Column: 1
Hard tabs(MD010, no-hard-tabs)
9-9: Column: 1
Hard tabs(MD010, no-hard-tabs)
10-10: Column: 1
Hard tabs(MD010, no-hard-tabs)
11-11: Column: 1
Hard tabs(MD010, no-hard-tabs)
12-12: Column: 1
Hard tabs(MD010, no-hard-tabs)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- CONTRIBUTING.md (2 hunks)
Additional context used
LanguageTool
CONTRIBUTING.md
[grammar] ~1-~1: This phrase is duplicated. You should probably use “Contributing Guide” only once.
Context: # Contributing Guide - Contributing Guide - [Repository St...(PHRASE_REPETITION)
[grammar] ~48-~48: Make sure that the noun ‘setup’ is correct. Did you mean the past participle “set up”?
Context: ...opment workflow Once the repository is setup your workflow will look like the follow...(BE_VB_OR_NN)
[style] ~51-~51: Consider shortening or rephrasing this to strengthen your wording.
Context: ...## For features/bug fixing 1. Initially make changes topackages/common/src
2. Once changes h...(MAKE_CHANGES)
[uncategorized] ~54-~54: Possible missing comma found.
Context: ... the dependencies. After setting up the dependencies runnpm link @samagra-x/stencil
(this...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~68-~68: Possible missing comma found.
Context: ...t Before commiting and submitting pull request follow the given steps 1. Lint your co...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~76-~76: This adjective is normally spelled with a hyphen.
Context: ... commit ## Ways to Contribute - As a first time contributor, navigating through the pro...(TIME_HYPHEN)
Markdownlint
CONTRIBUTING.md
3-3: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
4-4: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
5-5: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
6-6: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
7-7: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
8-8: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
9-9: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
10-10: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
11-11: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
12-12: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
3-3: Column: 1
Hard tabs(MD010, no-hard-tabs)
4-4: Column: 1
Hard tabs(MD010, no-hard-tabs)
5-5: Column: 1
Hard tabs(MD010, no-hard-tabs)
6-6: Column: 1
Hard tabs(MD010, no-hard-tabs)
7-7: Column: 1
Hard tabs(MD010, no-hard-tabs)
8-8: Column: 1
Hard tabs(MD010, no-hard-tabs)
9-9: Column: 1
Hard tabs(MD010, no-hard-tabs)
10-10: Column: 1
Hard tabs(MD010, no-hard-tabs)
11-11: Column: 1
Hard tabs(MD010, no-hard-tabs)
12-12: Column: 1
Hard tabs(MD010, no-hard-tabs)
Additional comments not posted (3)
CONTRIBUTING.md (3)
57-65
: LGTM!The instructions for writing and running tests are clear and correct.
71-71
: Fix the typo.Correct the typo in "commiting" to "committing".
- 1. Lint your code with `prettier` before your commit via `npm run lint` + 1. Lint your code with `prettier` before committing via `npm run lint`Likely invalid or redundant comment.
2-12
: Avoid duplicating the phrase "Contributing Guide".The phrase "Contributing Guide" is duplicated. Consider removing one instance.
- # Contributing Guide - - [Contributing Guide](#contributing-guide) + # Contributing GuideLikely invalid or redundant comment.
Tools
Markdownlint
3-3: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
4-4: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
5-5: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
6-6: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
7-7: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
8-8: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
9-9: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
10-10: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
11-11: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
12-12: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
3-3: Column: 1
Hard tabs(MD010, no-hard-tabs)
4-4: Column: 1
Hard tabs(MD010, no-hard-tabs)
5-5: Column: 1
Hard tabs(MD010, no-hard-tabs)
6-6: Column: 1
Hard tabs(MD010, no-hard-tabs)
7-7: Column: 1
Hard tabs(MD010, no-hard-tabs)
8-8: Column: 1
Hard tabs(MD010, no-hard-tabs)
9-9: Column: 1
Hard tabs(MD010, no-hard-tabs)
10-10: Column: 1
Hard tabs(MD010, no-hard-tabs)
11-11: Column: 1
Hard tabs(MD010, no-hard-tabs)
12-12: Column: 1
Hard tabs(MD010, no-hard-tabs)
CONTRIBUTING.md
Outdated
1. Fork the stencil repo | ||
2. Clone your fork into any folder of your choice via `git clone https://github.com/<USERNAME>/stencil.git` | ||
3. The `packages/common` folder corresponds to the npm package `@samagra-x/stencil` | ||
4. Any features additoins or bug fixes are to be done here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the typo.
Correct the typo in "additoins" to "additions".
- 4. Any features additoins or bug fixes are to be done here
+ 4. Any feature additions or bug fixes are to be done here
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
4. Any features additoins or bug fixes are to be done here | |
4. Any feature additions or bug fixes are to be done here |
CONTRIBUTING.md
Outdated
1. Lint your code with `prettier` before your commit via `npm run lint` | ||
2. Make sure all test suites are passing before you make your commit/pull request | ||
3. Use `npm run test` and `npm run test:e2e` and make sure all tests are passing before making your commit | ||
|
||
## Ways to Contribute | ||
|
||
- As a first time contributor, navigating through the project, it can be quite daunting for you. Please make sure to go through the [repository structure](#repository-structure) to understand the project a bit better, if you want to understand the project better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a hyphen for compound adjectives.
Add a hyphen in "first time" to form the compound adjective "first-time".
- As a first time contributor, navigating through the project, it can be quite daunting for you.
+ As a first-time contributor, navigating through the project can be quite daunting for you.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- As a first time contributor, navigating through the project, it can be quite daunting for you. Please make sure to go through the [repository structure](#repository-structure) to understand the project a bit better, if you want to understand the project better. | |
- As a first time contributor, navigating through the project, it can be quite daunting for you. | |
+ As a first-time contributor, navigating through the project can be quite daunting for you. |
Tools
LanguageTool
[uncategorized] ~76-~76: This adjective is normally spelled with a hyphen.
Context: ... commit ## Ways to Contribute - As a first time contributor, navigating through the pro...(TIME_HYPHEN)
CONTRIBUTING.md
Outdated
@@ -25,6 +32,45 @@ | |||
- `docs` this folder contains the documentation for the framework. This is a docusaurus app which can be started for easy reference. | |||
|
|||
|
|||
## Development Setup | |||
|
|||
To set up Stencil in your local development environment; follow the steps listed below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the grammar.
Ensure the noun 'setup' is used correctly. In this context, 'set up' is more appropriate.
- To set up Stencil in your local development environment; follow the steps listed below
+ To set up Stencil in your local development environment, follow the steps listed below:
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
To set up Stencil in your local development environment; follow the steps listed below | |
To set up Stencil in your local development environment, follow the steps listed below: |
CONTRIBUTING.md
Outdated
|
||
## Development workflow | ||
|
||
Once the repository is setup your workflow will look like the following. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the grammar.
Ensure the noun 'setup' is used correctly. In this context, 'set up' is more appropriate.
- Once the repository is setup your workflow will look like the following.
+ Once the repository is set up, your workflow will look like the following:
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Once the repository is setup your workflow will look like the following. | |
Once the repository is set up, your workflow will look like the following: |
Tools
LanguageTool
[grammar] ~48-~48: Make sure that the noun ‘setup’ is correct. Did you mean the past participle “set up”?
Context: ...opment workflow Once the repository is setup your workflow will look like the follow...(BE_VB_OR_NN)
CONTRIBUTING.md
Outdated
1. Initially make changes to `packages/common/src` | ||
2. Once changes have been made to the `src` folder you are supposed to build the package via `npm run build`. This is to be done inside the `packages/common` directory | ||
3. Once changes are made run `npm link` in the `packages/common` directory (this creates a [symlink](https://docs.npmjs.com/cli/v9/commands/npm-link) of your modified package in the node globals and the published package is overriden) | ||
4. Then navigate to the example app in `sample` which corresponds to the changes you have made run `npm install` to set up the dependencies. After setting up the dependencies run `npm link @samagra-x/stencil` (this lets the project know you want to use the modified package and not the published package) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comma for clarity.
Add a comma after "dependencies" for better readability.
- After setting up the dependencies run `npm link @samagra-x/stencil`
+ After setting up the dependencies, run `npm link @samagra-x/stencil`
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
4. Then navigate to the example app in `sample` which corresponds to the changes you have made run `npm install` to set up the dependencies. After setting up the dependencies run `npm link @samagra-x/stencil` (this lets the project know you want to use the modified package and not the published package) | |
4. Then navigate to the example app in `sample` which corresponds to the changes you have made run `npm install` to set up the dependencies. After setting up the dependencies, run `npm link @samagra-x/stencil` (this lets the project know you want to use the modified package and not the published package) |
Tools
LanguageTool
[uncategorized] ~54-~54: Possible missing comma found.
Context: ... the dependencies. After setting up the dependencies runnpm link @samagra-x/stencil
(this...(AI_HYDRA_LEO_MISSING_COMMA)
CONTRIBUTING.md
Outdated
|
||
### Pre-commit checklist | ||
|
||
Before commiting and submitting pull request follow the given steps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comma for clarity.
Add a comma after "request" for better readability.
- Before commiting and submitting pull request follow the given steps
+ Before committing and submitting a pull request, follow the given steps:
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Before commiting and submitting pull request follow the given steps | |
Before committing and submitting a pull request, follow the given steps: |
Tools
LanguageTool
[uncategorized] ~68-~68: Possible missing comma found.
Context: ...t Before commiting and submitting pull request follow the given steps 1. Lint your co...(AI_HYDRA_LEO_MISSING_COMMA)
CONTRIBUTING.md
Outdated
- [Contributing Guide](#contributing-guide) | ||
- [Repository Structure](#repository-structure) | ||
- [Development Setup](#development-setup) | ||
- [Development workflow](#development-workflow) | ||
- [For features/bug fixing](#for-featuresbug-fixing) | ||
- [Writing and running tests](#writing-and-running-tests) | ||
- [Pre-commit checklist](#pre-commit-checklist) | ||
- [Ways to Contribute](#ways-to-contribute) | ||
- [Community Issue Assignment Policy](#community-issue-assignment-policy) | ||
- [Guidelines](#guidelines) | ||
- [Resources](#resources) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix unordered list indentation and avoid hard tabs.
Use consistent indentation for unordered lists and replace hard tabs with spaces.
- - [Repository Structure](#repository-structure)
- - [Development Setup](#development-setup)
- - [Development workflow](#development-workflow)
- - [For features/bug fixing](#for-featuresbug-fixing)
- - [Writing and running tests](#writing-and-running-tests)
- - [Pre-commit checklist](#pre-commit-checklist)
- - [Ways to Contribute](#ways-to-contribute)
- - [Community Issue Assignment Policy](#community-issue-assignment-policy)
- - [Guidelines](#guidelines)
- - [Resources](#resources)
+ - [Repository Structure](#repository-structure)
+ - [Development Setup](#development-setup)
+ - [Development workflow](#development-workflow)
+ - [For features/bug fixing](#for-featuresbug-fixing)
+ - [Writing and running tests](#writing-and-running-tests)
+ - [Pre-commit checklist](#pre-commit-checklist)
+ - [Ways to Contribute](#ways-to-contribute)
+ - [Community Issue Assignment Policy](#community-issue-assignment-policy)
+ - [Guidelines](#guidelines)
+ - [Resources](#resources)
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- [Contributing Guide](#contributing-guide) | |
- [Repository Structure](#repository-structure) | |
- [Development Setup](#development-setup) | |
- [Development workflow](#development-workflow) | |
- [For features/bug fixing](#for-featuresbug-fixing) | |
- [Writing and running tests](#writing-and-running-tests) | |
- [Pre-commit checklist](#pre-commit-checklist) | |
- [Ways to Contribute](#ways-to-contribute) | |
- [Community Issue Assignment Policy](#community-issue-assignment-policy) | |
- [Guidelines](#guidelines) | |
- [Resources](#resources) | |
- [Contributing Guide](#contributing-guide) | |
- [Repository Structure](#repository-structure) | |
- [Development Setup](#development-setup) | |
- [Development workflow](#development-workflow) | |
- [For features/bug fixing](#for-featuresbug-fixing) | |
- [Writing and running tests](#writing-and-running-tests) | |
- [Pre-commit checklist](#pre-commit-checklist) | |
- [Ways to Contribute](#ways-to-contribute) | |
- [Community Issue Assignment Policy](#community-issue-assignment-policy) | |
- [Guidelines](#guidelines) | |
- [Resources](#resources) |
Tools
Markdownlint
3-3: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
4-4: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
5-5: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
6-6: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
7-7: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
8-8: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
9-9: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
10-10: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
11-11: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
12-12: Expected: 2; Actual: 1
Unordered list indentation(MD007, ul-indent)
3-3: Column: 1
Hard tabs(MD010, no-hard-tabs)
4-4: Column: 1
Hard tabs(MD010, no-hard-tabs)
5-5: Column: 1
Hard tabs(MD010, no-hard-tabs)
6-6: Column: 1
Hard tabs(MD010, no-hard-tabs)
7-7: Column: 1
Hard tabs(MD010, no-hard-tabs)
8-8: Column: 1
Hard tabs(MD010, no-hard-tabs)
9-9: Column: 1
Hard tabs(MD010, no-hard-tabs)
10-10: Column: 1
Hard tabs(MD010, no-hard-tabs)
11-11: Column: 1
Hard tabs(MD010, no-hard-tabs)
12-12: Column: 1
Hard tabs(MD010, no-hard-tabs)
This reverts commit 5cd6314.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/common/test/app.e2e-spec.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/common/test/app.e2e-spec.ts
Checklist
Make sure you have
@nestjs/swagger
decorators wherever requiredDescription
file-upload.controller.ts
inpackages/common/src
process.env.STORAGE_MODE
size
andbuffer
to theMultipartInterface
. (this allows us to have access to size of file and its Buffer contents; needed for empty file check)file-upload.interceptor
the linerequest.raw = request.raw || request;
allows for valid request body to pass throughSteps to test
to test manually
create a post request to
/file/upload-file
test with empty file and non empty file via
multipart/form-data
to run automated test
navigate to
samples/06-file-upload
and runnpm run test:e2e
fixes #156
fixes #149
Summary by CodeRabbit
New Features
Bug Fixes
request.raw
could be falsy.Documentation
CONTRIBUTING.md
with detailed guidelines and a pre-commit checklist.Tests