-
Notifications
You must be signed in to change notification settings - Fork 11
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
Multipart form data #329
Multipart form data #329
Conversation
792ae43
to
319ce56
Compare
319ce56
to
7fce5ab
Compare
@@ -332,19 +330,19 @@ | |||
|
|||
if (appLogic == null) | |||
{ | |||
_logger.LogError($"Could not determine if {dataType} requires app logic for application {org}/{app}"); | |||
_logger.LogError("Could not determine if {dataType} requires app logic for application {org}/{app}", dataType, org, app); |
Check failure
Code scanning / CodeQL
Log entries created from user input High
user-provided value
This log entry depends on a
user-provided value
@@ -332,19 +330,19 @@ | |||
|
|||
if (appLogic == null) | |||
{ | |||
_logger.LogError($"Could not determine if {dataType} requires app logic for application {org}/{app}"); | |||
_logger.LogError("Could not determine if {dataType} requires app logic for application {org}/{app}", dataType, org, app); |
Check failure
Code scanning / CodeQL
Log entries created from user input High
user-provided value
@@ -332,19 +330,19 @@ | |||
|
|||
if (appLogic == null) | |||
{ | |||
_logger.LogError($"Could not determine if {dataType} requires app logic for application {org}/{app}"); | |||
_logger.LogError("Could not determine if {dataType} requires app logic for application {org}/{app}", dataType, org, app); |
Check failure
Code scanning / CodeQL
Log entries created from user input High
user-provided value
catch (Exception e) | ||
{ | ||
logger.LogError(e, "Unable to determine changed fields"); | ||
return null; | ||
} |
Check notice
Code scanning / CodeQL
Generic catch clause Note
7fce5ab
to
03b4317
Compare
03b4317
to
cf256d0
Compare
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.
Nice work!
src/Altinn.App.Core/Features/DataProcessing/NullDataProcessor.cs
Outdated
Show resolved
Hide resolved
src/Altinn.App.Core/Infrastructure/Clients/Storage/DataClient.cs
Outdated
Show resolved
Hide resolved
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.
Fikset noen av kommentarene
src/Altinn.App.Core/Infrastructure/Clients/Storage/DataClient.cs
Outdated
Show resolved
Hide resolved
8869639
to
b1b1357
Compare
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.
One last thing I missed, but looks good. Lets get this from review to test 🙁
Also ignore CS1998 in apps (warning when not awaiting anything in async hooks)
Co-authored-by: Vemund Gaukstad <[email protected]>
1d9c021
to
edd91bd
Compare
Also add a Dockerfile for running tests on linux
Can we add some test for the bad requests. Like that the first part not having name=dataModel and so on? |
I tried this against frontend v4/main now, and it's not quite there. Should be the same with v3, as I haven't tested with the form data rewrite in frontend yet.
|
For some reason backend returns 303 See Other when datamodel updates are availible. This is a redirect code and crashed the tests as no Location header was set.
test/Altinn.App.Api.Tests/Controllers/InstancesController_PostNewInstance.cs
Fixed
Show fixed
Hide fixed
Tested again now, and it's all working against v4/main as far as I can tell! 🙌 |
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.
Have a look at the code smells/codeql warnings, and try to add the last few percentages of testscoverage and we should be good to go as far as I can see
Co-authored-by: Vemund Gaukstad <[email protected]>
SonarCloud Quality Gate failed. 0 Bugs 67.7% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Instance virutalInstance = new Instance() { InstanceOwner = owner }; | ||
await _dataProcessor.ProcessDataRead(virutalInstance, null, appModel); | ||
Instance virtualInstance = new Instance() { InstanceOwner = owner }; | ||
await ProcessAllDataWrite(virtualInstance, appModel); |
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.
@tjololo This was not good!!!
Happens to be OK, as ProcessAllDataWrite
actually calls processDataRead
😊
* Revert Multipart form data #329 on PUT endpoint * Add JsonPatch and create a new PATCH endpoint for updating form data * Fix a few SonarCloud warnings * Start work on new validation Improve GetJsonPath(Expression) and fix some sonarcloud issues Improve test coverage Full validation rewrite complete and existing tests work Probably still some issues and test coverage was spoty so more tests needs to be written. Make IInstanceValidator obsolete Add DataType as input to validators Fix a few issues to prepare for tests of expressions Add more tests * Fix sonar cloud issues * Rename to get more consistent naming * Clanup DataType/TaskId to allow * Also comment out KeyedService fetching * Fix more sonarcloud issues * Registrer new validators in DI container * Remove dead code * Adjust interface and add a few tests * Add object? previousData to IDataProcessor * Cleanup and more tests * OptionsSource doesn't really need a label to work. In recent fronted versions, this label can also be an expression, so parsing fails when this is expected to be a string. * Removing the requirement for a 'pageRef' property on Summary components. Frontend doesn't use this anymore, and disallows rendering Summary components with it. * Allowing attachments to be deleted (attachments don't have AppLogic) * ValidationIssue.Severity is an int in json Improve handeling of errors in PATCH endpoint code style fixes * Initialize lists for concistency in frontend after patch also add tests * Fix issues with list initialization and prettify tests * Add test to verify that PATCH initializes arrays (as xml serialization does) * Read json configuration file for api tests * Set empty strings to null in patch endpoint xml serializing does always preserve empty string when using attributes and [XmlText]. * Apply suggestions from code review Co-authored-by: Vemund Gaukstad <[email protected]> * Remove caching logic for CanTaskBeEnded * Improve description on validationsource * Rename ShouldRun to HasRelevantChanges fix style issues * Fix dataProcessorRewriter * Add genericDataProcessor * Fix a few codestyle issues * Making some validator sources match those used on the frontend * Fix tests after validator source name change * Adding support for explicit repeating group components (new in frontend v4) --------- Co-authored-by: Ole Martin Handeland <[email protected]> Co-authored-by: Vemund Gaukstad <[email protected]>
Work in process
Builds on #328, so temporary the target branch is different
Related Issue(s)
Verification
Documentation