-
Notifications
You must be signed in to change notification settings - Fork 585
Allow both repo-level configs and user+repo level configs #6990
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
base: main
Are you sure you want to change the base?
Conversation
Please format the commits to adhere to our commit guidelines here: https://github.com/jj-vcs/jj/blob/main/docs/contributing.md#commit-guidelines and add a motivation to each commit. This is also missing tests and a changelog entry since the second commit even introduces a new command. |
I know, that's why it's a draft commit. Just want to make sure the concept is approved before I add finishing touches. |
e115b70
to
78f20ea
Compare
The idea sounds generally good to me. We might also want a similar mechanism for the zip file problem. Since the I have no idea about TUI. I personally would want to just see the diff and accept/reject. |
I'm not familiar with "the zip file problem". Could you link to the issue?
I'm not opposed to that. I chose this method because it was the same directory that the repo config was stored. I would request, however, that we submit this first and worry about that later, since this is explicitly not making the security any worse than it already is.
I do agree, as a user, that that's what I would want, but that's also relatively easy to achieve with the TUI. I think, however, that from a security perspective, a binary accept / reject choice is not great, because it might feel like you have to make a choice between new features and security. With a binary choice, if there's one particular line that you are concerned about and so you reject it, that means you have to reject every future change to the repo config. |
I don't think we have a link, but it's a familiar problem from other VCSs (familiar to VCS developers). The problem is what to do about repo-level configs in |
Makes sense. So I assume the solution would be to store it out of the repo, and require users to run |
I think Yuya's proposal was to record trusted config contents somewhere in I'm not sure if it's safe to trust configs at the key-value level or only at coarser granularity. Could there be some case where you say that you trust |
AFAICT, the attack surfaces are, in order of danger:
This is my analysis of the danger:
I think that it's possible to make one harmful thing and one alias to it, but I don't think it's possible to make two things that are independently safe but together harmful (it's technically possible with two arbitrary commands that execute files in the repo, but if they're doing that then they can already achieve this). |
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.
Here's a bunch of actual review comments.
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.
In my opinion this shouldn't belong in the VCS.
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 quite strongly disagree with this. If you leave it up to the user to review the config and copy it, it's far less secure due to psychology:
- The user can run
ln -s
to create a symlink instead of copying the config, thus never even reviewing changes - The user is far more likely to review the diff if you actually force a diff open for them than if you tell them "please review and copy if you trust it" - most users will not be bothered to open a diff
What makes you say this shouldn't be in the VCS?
This can be used to add shared configuration across a repository. For example, all users should have the same `jj fix` within a given repository. See https://chromium-review.googlesource.com/c/chromium/src/+/6703030 for an example
78f20ea
to
507083f
Compare
Fixes #3684
This adds the following workflow to jj to support repo-level workflows:
jj config update-repo
"jj config update-repo
adds a TUI requesting the user to approve the diffChecklist
If applicable:
CHANGELOG.md
README.md
,docs/
,demos/
)cli/src/config-schema.json
)