-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Lazy grouping within IAppConfig #41755
Conversation
95c30d7
to
adf08fd
Compare
adf08fd
to
5c6e846
Compare
94d16bf
to
ab05155
Compare
ab05155
to
96e7878
Compare
96e7878
to
0e94b76
Compare
fa397a2
to
6b121f1
Compare
6b121f1
to
96decee
Compare
7e6d8a9
to
f6b1250
Compare
4e0783a
to
ecd9405
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.
Psalm found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
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.
Really not a fan of the caching strategy.
It sounds really risky to get database and cache out of sync easily with a long running task in OCC or request, etc.
As per chat however I like the general idea of having a lazy "block" and even more integrating the sensitive part directly.
Speaking of sensitive some apps use the ICrypto::encrypt()
and ICrypto::dectrypt()
. We could include that into the methods and help developers again to not have security optionally?
57dd3bd
to
eb3c873
Compare
try { | ||
$typeString = $this->convertTypeToString($type); | ||
} catch (AppConfigIncorrectTypeException $e) { | ||
$this->logger->warning('type stored in database is not correct', ['exception' => $e, 'type' => $type]); |
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.
This spams Unknown numeric type 0
very heavily for me.
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 am interested how you came to this as type should not be 0 in database
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.
Mostlikely from occ config:app:set -vvv ${dir##*/} enabled --value="no"
which I have in my set up script to force disable all apps as an option.
The point is more that there will be a lot of "dirty" instances already out there and spaming their logs with warnings when the admin can not know what to do about it is meh.
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 cannot reproduce this issue and think we can merge as it is right now.
By default, occ config:app:set
set value as mixed.
The only issue that I am seeing when using the occ config:app:set
is that during the upgrading process, between the files are changed and the upgrade process is run.
Maybe we can edit the database (adding type+lazy field) already in 28 so we don't have error about missing field during the upgrade steps
❌ Drone failures are related! |
d0c05cd
to
4bd0022
Compare
4bd0022
to
b93d9c7
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.
Okay otherwise
b93d9c7
to
c1ad25a
Compare
Signed-off-by: Maxence Lange <[email protected]>
Signed-off-by: Maxence Lange <[email protected]> d Signed-off-by: Maxence Lange <[email protected]>
Signed-off-by: Maxence Lange <[email protected]>
c1ad25a
to
94fe48c
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.
At least needs an issue in the guests app to make them aware of the breakage that is coming their way:
https://github.com/nextcloud/guests/blob/master/lib/AppConfigOverwrite.php
Just noticed we also have two different IAppConfig interfaces (one generic and one as a app framework service). The app framework service should probably also get adapted to cover the new API as currently it is just a wrapper for the deprecated methods: https://github.com/nextcloud/server/blob/215aef3cbdc1963be1bb6bca5218ee0a4b7f1665/lib/public/AppFramework/Services/IAppConfig.php |
Should we just deprecate it? we shouldn't have 2 similar interfaces like this? |
I still like the service approach to simplify and not need to pass in the app id which makes the api a bit easier for app developers and and more restrictive to not mess with other apps configs |
Ah, missed that bit. It's basically what I abstracted away in talk by using my own config class :D |
->addOption( | ||
'type', | ||
null, | ||
InputOption::VALUE_REQUIRED, | ||
'Value type [string, integer, float, boolean, array]', | ||
'string' | ||
) |
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.
This would be important for https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html#setting-a-single-configuration-value. @ArtificialOwl @sorbaugh please document this soon 🙏
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.
Array handling still needs to be documented. Particularly since it's diverged from system
: https://docs.nextcloud.com/server/latest/admin_manual/occ_command.html#setting-an-array-configuration-value
Added features to the
IAppConfig
:limitation
updateSensitive()
oc_appconfig
New fields in the
appconfig
table:occ
occ config:app:get
It adds the
--details
option to theconfig:app:get
:occ config:app:set
New options:
--lazy
,--no-lazy
to change the way to store/retrieve the config value,--sensitive
,--no-sensitive
to change the sensitivity of a config value,--type
to set/change the type of a value,--no-interaction
a confirmation from the admin is needed when editing the type/status of a config value.Note(s)
PR is big and adds huge edits. It should stays compatible with previous call to AppConfig.