This repository has been archived by the owner on Feb 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Write protection in the pipeline not fully functional #228
Comments
We should probably handle this together with #223 |
+1 for (1). having middleware operating on the req/res is quite common in the js world. |
+1 for (1). without building a complex and costly machinery, this is almost impossible to do anyway. |
+1 for (1) for the reasons already stated |
koraa
added a commit
that referenced
this issue
May 2, 2019
feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above.
koraa
added a commit
that referenced
this issue
May 3, 2019
feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above.
koraa
added a commit
that referenced
this issue
May 7, 2019
feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above.
koraa
added a commit
that referenced
this issue
May 9, 2019
feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above. feat: Simplify pipeline error handling Can not longer clear errors
tripodsan
pushed a commit
that referenced
this issue
May 10, 2019
BREAKING CHANGE: return value from pipeline functions are no longer merged into the context feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above. feat: Simplify pipeline error handling Can not longer clear errors
koraa
added a commit
that referenced
this issue
May 10, 2019
BREAKING CHANGE: return value from pipeline functions are no longer merged into the context Co-authored-by: Tobias Bocanegra <tripod@adobe.com> NOTE: Most of the functional changes live in src/pipeline.js; most other changes are just refactoring the rest of the code base to utilize the changes there. feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 This specific change necessitated the bulk of the changes to the code bases; most of the code that was refactored relied on parameter merging before. feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above.
koraa
added a commit
that referenced
this issue
May 10, 2019
BREAKING CHANGE: return value from pipeline functions are no longer merged into the context Co-authored-by: Tobias Bocanegra <tripod@adobe.com> NOTE: Most of the functional changes live in src/pipeline.js; most other changes are just refactoring the rest of the code base to utilize the changes there. feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 This specific change necessitated the bulk of the changes to the code bases; most of the code that was refactored relied on parameter merging before. feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above.
koraa
added a commit
that referenced
this issue
May 10, 2019
BREAKING CHANGE: return value from pipeline functions are no longer merged into the context NOTE: Most of the functional changes live in src/pipeline.js; most other changes are just refactoring the rest of the code base to utilize the changes there. feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 This specific change necessitated the bulk of the changes to the code bases; most of the code that was refactored relied on parameter merging before. feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above. Co-authored-by: Tobias Bocanegra <tripod@adobe.com>
tripodsan
added a commit
that referenced
this issue
May 14, 2019
BREAKING CHANGE: return value from pipeline functions are no longer merged into the context NOTE: Most of the functional changes live in src/pipeline.js; most other changes are just refactoring the rest of the code base to utilize the changes there. feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 This specific change necessitated the bulk of the changes to the code bases; most of the code that was refactored relied on parameter merging before. feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above. Co-authored-by: Tobias Bocanegra <tripod@adobe.com>
tripodsan
added a commit
that referenced
this issue
May 14, 2019
BREAKING CHANGE: return value from pipeline functions are no longer merged into the context NOTE: Most of the functional changes live in src/pipeline.js; most other changes are just refactoring the rest of the code base to utilize the changes there. feat: Drop write protection in pipeline fixes #228 feat: Get rid of parameter merging fixes #223 This specific change necessitated the bulk of the changes to the code bases; most of the code that was refactored relied on parameter merging before. feat: Fuller error reporting in pipeline Specifically, all errors are now reported by printing an error message the stack trace with additional information identifying the specific pipeline step. On the http level a 500 status code is transmitted. fix: Get rid of bail() calls Bail calls basically hid the stack trace from the devs because they would just print an error message and send a 500 status code. By removing them and throwing exceptions instead we can make full use of the improved error reporting above. Co-authored-by: Tobias Bocanegra <tripod@adobe.com>
adobe-bot
pushed a commit
that referenced
this issue
May 16, 2019
# [2.0.0](v1.12.1...v2.0.0) (2019-05-16) ### Bug Fixes * **pipe:** Do not filter out non-functions before running the pipeline ([083d902](083d902)) ### Features * **pipe:** Simplify pipeline step executor ([2cbfe58](2cbfe58)), closes [#228](#228) [#223](#223) ### BREAKING CHANGES * **pipe:** return value from pipeline functions are no longer merged into the context NOTE: Most of the functional changes live in src/pipeline.js; most other changes are just refactoring the rest of the code base to utilize the changes there.
🎉 This issue has been resolved in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The Pipeline class implements write protection, so pipeline steps cannot modify their arguments.
In order to do this, the lodash.merge function is applied to the current data before each pipeline step. This way pipeline steps/.every() steps can modify the current data, but it won't have an actual effect since they are modifying a copy.
This approach has some drawbacks:
(pipeline_steps * datasize)
, which can be quite a lotI can see some ways to remedy this:
(2)
we could introduce a deepClone function of our own based on traits; this function would throw for unknown types instead of just not clone them. Devs could react to those exceptions by simply adding an implementation for the typeEven though I would enjoy adding some more traits, I think the best way to go is to use (1); we are (unfortunately) in a language that does not natively support
const
attributes, so emulating them somehow is admittetly very hard. Solution 2 and 3 would both put a lot of extra work on third party devs if they want to use pipelines with their custom types.Allowing modification is the usual thing to do in js…
The text was updated successfully, but these errors were encountered: