-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: Persist assert_integrity feature #1032
Open
daogrady
wants to merge
9
commits into
main
Choose a base branch
from
fix/persist-assert_integrity
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f7935d4
Persist assert_integrity feature
daogrady 64d4571
Carry over changes
daogrady 14eaeb1
Merge branch 'main' into fix/persist-assert_integrity
daogrady 6b70038
Shorten
daogrady 29eb6d1
Make more robust towards existing feature blocks
daogrady b43acd3
Add test
daogrady b3db6fd
Add todo
daogrady 8d2fb6d
Finalise test
daogrady 19c35b1
Merge branch 'main' into fix/persist-assert_integrity
daogrady File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We could already prepare for other supported feature flags in a generic way, because once another feature flag will be added, this should be done anyway. Something like
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.
I actually started with a generic implementation that would take an arbitrary path into the
cds.env
, prepare all parent objects in package.json based on the type of whatcds.env
dictated and finally copied over all appropriate values. And before I knew it, I had a 200 loc function, that somewhat paled in comparison to this 5 line solution for the problem at hand. 😃I therefore suggest to keep it simple as long as we are dealing with only one value and generalise it later, if we need to carry over more settings.
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.
I see. However, I am not really happy with just fixing the passthrough for this one feature. I can imagine other feature flags which are important for a proper build, such as: naming modes (quoted or plain names?), standard database function mappings, …
@stewsk @johannes-vogel @chgeo we have the issue that build relevant options are not per default copied over to the postgres deployer app (found in
gen/pg
) do you have some idea how to properly copy over build relevant options (which are those?) to the deployer app? If we don't do that, anmbt build && cf deploy
will lose all SQL relevant features defined in the app which e.g. has been the case forcds.features.assert_integrity
in #1020There 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.
I don't think that there's a dedicated section for deployment relevant things. They are spread over different sections.
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.
Would it then in your opinion be sufficient to have a kind of allow-list approach, where we selectively copy over known build relevant options?
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.
I don't know if an allow list makes sense if we do not know the options. How is that solved for the hana deployer?
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.
during build for HANA the actual db artifacts are already created with all features found in the cds env. Upon a deployment the
hdi
artifacts already have the desired features baked in. In contrast to that, for postgres, only a inferred CSN is generated during build. Which does not contain any DB specific transformations, hence lacking the DB features set in thecds env
. Upon deployment, thegen/pg/csn.json
is transformed to the actual SQL schema. If the deployment is initiated in thegen/pg/
folder, the root appcds env
is ignored in favor of the thecds env
of the deployer app (gen/pg/package.json
) which is empty, invalidating all features set in the apps root.