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

Integrate beta version of sbvr-types supporting WebResource #592

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ramirogm
Copy link

Change-type: minor
Signed-off-by: Ramiro Gonzalez ramiro.gonzalez@balena.io

@ramirogm ramirogm force-pushed the web-resource-2 branch 3 times, most recently from 78cbf2d to 59ff08a Compare November 21, 2022 18:17
@ramirogm
Copy link
Author

@balena-ci re-test

@ramirogm
Copy link
Author

@balena-ci re-test

@ramirogm ramirogm force-pushed the web-resource-2 branch 3 times, most recently from ece34b0 to d4411f4 Compare November 30, 2022 17:51
@ramirogm
Copy link
Author

ramirogm commented Dec 6, 2022

@nitishagar Can you review this PR? It integrates your changes with sbvr-types

Copy link
Contributor

@fisehara fisehara left a comment

Choose a reason for hiding this comment

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

I'm wondering if we can easily register / use the multiform and multer only for resources that actually have these properties defined.

Please add test cases in pinejs. Here we have the ability to test pineJs within a docker-compose test setup.

src/config-loader/config-loader.ts Outdated Show resolved Hide resolved
);
}
} else {
maxFileSize = 1024 * 1024 * 1024 * 2; // 2GB
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is 2GiB the default maxFileSize?

Copy link
Author

@ramirogm ramirogm Dec 20, 2022

Choose a reason for hiding this comment

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

@fisehara It looks like a sane default to avoid processing extra big files while allowing somebody to upload an image or "tarball"

src/server-glue/server.ts Show resolved Hide resolved
Copy link
Contributor

@nitishagar nitishagar left a comment

Choose a reason for hiding this comment

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

Sorry - I had reviewed the same day, but review wasn't submitted 😵‍💫

src/sbvr-api/uri-parser.ts Show resolved Hide resolved
src/server-glue/webresource-handler.ts Outdated Show resolved Hide resolved
src/server-glue/webresource-handler.ts Outdated Show resolved Hide resolved
src/server-glue/webresource-handler.ts Outdated Show resolved Hide resolved
@ramirogm ramirogm marked this pull request as ready for review December 21, 2022 11:22
@@ -72,6 +75,10 @@ export const init = async <T extends string>(
}
await Promise.all(promises);

if (process.env.PINEJS_STORAGE_ENGINE === 'S3') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use the configLoader.Config instead of env-var? cc. @Page-

@@ -73,5 +76,41 @@ describe('01 basic constrain tests', function () {
'It is necessary that each student that has a semester credits, has a semester credits that is greater than or equal to 4 and is less than or equal to 16.',
);
});

Copy link
Contributor

Choose a reason for hiding this comment

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

I know it's verbose, but please move this test to a new 0x-webresource.test.ts as it's testing a complete new finctionality.

This test file should contain all kinds of SBVR rules / constraints that can be defined. The WebResource is not a constrain as is but a more complex functionality

Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to copy the fixtures in the same way and please move the resources folder into the test-case named fixtures folder.

Copy link
Contributor

@fisehara fisehara left a comment

Choose a reason for hiding this comment

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

Just some hints:

  • we use supertest for testing the endpoints, which should be usable and axios is not necessary for testing
  • Page has luckily build a great package to read, parse and default environment variables, we should start using it by default :)

I'm lacking understanding if all error cases / fail conditions are handled, and just want to trigger to think about failing library functions, initialisations of loaded packages.

test/01-constrain.test.ts Outdated Show resolved Hide resolved
test/01-constrain.test.ts Outdated Show resolved Hide resolved
test/01-constrain.test.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/server-glue/module.ts Outdated Show resolved Hide resolved
src/server-glue/module.ts Outdated Show resolved Hide resolved
src/server-glue/webresource-handler.ts Outdated Show resolved Hide resolved
src/server-glue/webresource-handler.ts Outdated Show resolved Hide resolved
src/server-glue/webresource-handler.ts Outdated Show resolved Hide resolved
@ramirogm
Copy link
Author

@balena-ci re-test

Update to @balena/open-multer-s3, better large files test

Change-type: patch
Signed-off-by: Ramiro Gonzalez <ramiro.gonzalez@balena.io>
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.

None yet

3 participants