-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
nixos/syncthing: turn into RFC42 style settings #233386
Conversation
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 looks ad-hoc, fragile, and inefficient. I don't like it.
why inefficient? it fixes the check and does skip running the service, also the tristates in the options actually make more sense then having a default value which could be tied to a specific version. IMHO this is the most correct way this can be achieved without extending the freeform types. |
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 think this is the best possible fix proposed so far.
Though this fix is going to break the people who expected/use those defaults, isn't it? |
I don't think so. Syncthing retains settings between reboots, and those users will just continue have the same settings, but they will be defined imperatively from now on. |
those default only were there for like 2 weeks and they will still be there afterwards for the people having them now. |
How does syncthing handle |
it should ignore them because they are invalid. Since I couldn't find anything in the docs I just tested this manually: I first took the default config and looked at the value options.limitBandwidthInLan: which is false. I dumped the config, changed the value to null, PUT the new config, was still false. then I changed it to true, PUT it, was true afterwards, after PUTing null again it was still true. So this seems like the perfect behavior for us We should probably take care when introducing options in settings.options which could take null as a valid value. but right now thats not the case. We could also filter the nix null values before converting them to JSON |
We'll revisit this when there's no emergency. Reverted for now. |
alright, have added a revert of the revert here so we can continue after branch off |
That sounds great. To further improve this, we can filter those null values prior to generating the script.
I was, and still optimistic we can reach an agreement until the branch off - we are all responsive and engaged. Hence my response is a polite 👎. Also, there was a lot more to be said. For instance, I think that my PR might have also fixed the issue for @RaitoBezarius - as it makes the script iterate each attribute in |
I apologize for this @doronbehar but we were extremely close to the merge window when those changes got pulled in, with a subpar review, breaking the rule on breaking changes, without proper test coverage for While I do appreciate your efforts and the fact you were very engaged & responsive. We were not able to get out of the trouble with the multiples opened fixes which takes time to test and for which there is no consensus on what is the right thing. The most important thing for a release is not to ship things that were tested by one person after breakage saying "it works on my machine" but that we take the time to find the right fix and the right semantics for what we want, especially to avoid over-breakages by piling up on fixes which apparently covers up for the previous issues / cornercases. Do not put it on @ncfavier ; I would have merged the revert before the branch-off if no reasonable solution was not found at that moment, to be completely fair with you. And do not put it on yourselves, that's the nixpkgs game, our goal is to stabilize the release, if those fixes would create more issues somehow: you would have been dragged into some unpleasant situation ; now you can take the time to figure out this during unstable, if it fixes new bugs that should be backported according to policies, those changes can end up in stable. I think it's a good thing. |
You have a point. Though I am rather sure the solution would have worked for you. Still, giving this more time to get cooked in unstable won't hurt anyone :) 👍. |
I am certain too, but I am an advanced NixOS user, I don't care about me :P. I have to care about the others. :) |
68c64ea
to
826c256
Compare
I think this PR can be marked as ready for review, since the |
@infinisil may I ask for your opinion? I'm not sure how to best implement RFC 42 here; the proposed solutions leave me deeply unsatisfied and I can't seem to articulate why or suggest alternatives. Particular points I'm iffy about:
|
Just to write down my thought process and different tradeoffs I thought about while implementing these changes:
since Ideally I want people to dump their current config and just put that into settings to make it declarative.
this is similar to the previous issue, but I don't see a quick solution. If we turn folders into a freeForm people could define Also the current settings has a default which ideally would need to keep in sync with upstream if the default changes there.
I looked into |
Part 2 of RFC 42 encourages adding extra options beside @Lassulus it shouldn't be a problem if these extra options are implemented in terms of
I think Most likely this is also the reason upstream why the So I think ideally this should be fixed in upstream so that we don't need the |
( |
@ncfavier Yeah I'd discourage priority-based behavior in general |
BTW I'd really like to get this merged so that I can get #230196 going as well... |
I'm currently traveling so a bit limited on time. Not sure what the current consensus is. I guess the cleanedConfig "hack" is still the best way to handle the config. We could think about having folders and devices outside of settings, but not sure what the upside of that would be? I like having all the declarative settings inside one option and the documentation renders the same no matter where we have it. I didn't understand the point of configuring settings in terms of their aliases, since doing something like this:
would override setting fsWatcherDelayS always with the default value of watchDelay. so we would need to change watchDelay into an
which would cause a infinite recursion? Or we could just override fsWatcherDelay with watchDelay if the later is configured everytime with:
but here I don't like the silent ignoring of fsWatcherDelayS |
Me too, but if others will insist, perhaps we can force the user to use (in this example) I'll be able to live with the above suggestion, but I still think it's not too bad to ask our users to change some of these settings in order to conform to upstream's terminology - making us and the NixOS modules' users' maintenance burden easier |
Rebased, and solved merge conflicts after #239427 , hopefully without mistakes. |
a8ed42d
to
504f289
Compare
@ofborg test syncthing-no-settings |
also remove empty values from the config
504f289
to
eef9190
Compare
So what is the status of this? |
well I tried to bump some people but basically we are in review hell since @nbp still seems unhappy with the solution? not sure exactly how to proceed. But the current solution still seems like the best we can come up with. having devices and folders outside of settings would be misleading since they end up in settings anyway. and discoverability should be the same since documentation is generated either way? I would be very happy if we could merge this and fix stuff later if it comes up. but even the last regressions before the channel bump were mainly because syncthing-init ran in weird circumstances where it should not. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
How about making the type of |
Ah we tried that already but the default value of settings gets overriden by the default values of the sub options |
since communication with @ncfavier seems kinda stuck (please don't take it as an offence) and there are no other voices against merging this, I will self merge this. We are already like 1/3 of the time to a new release and there seems no forward movement and the closer we come to a release the bigger the fallout we have to fix last minute if something unexpected happens (again?) |
Description of changes
alternative to #233377
fix #232679
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)