-
Notifications
You must be signed in to change notification settings - Fork 15
Implement "remove maintainer" button #558
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
Merged
Merged
Conversation
This file contains hidden or 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
Collaborator
Contributor
Author
|
@fricklerhandwerk fixed in 1bb618f. |
Collaborator
|
Nice! The issue doesn't say it precisely (that was an oversight on my end), but let's make maintainers removable in the untriaged state as well. Petty good other than that. |
Contributor
Author
|
Done in 7ff1b12 |
Contributor
Author
|
@fricklerhandwerk I'll let you click accept before merging this one. |
fricklerhandwerk
approved these changes
May 26, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Closes #417. Supersedes #554.
This PR implements the "remove maintainer" button for draft issues. In order to make that easier, we introduced a proper maintainer component (everything was handled directly, inlined, in maintainers_list before) and a notion of selectable maintainer, as it exists already for packages. In order to have things consistent between packages and maintainers, we refactored a bit the former: instead of duplicating the code into a normal component and a
selectable_xxxone, the same component handles both with a boolean parameter. Inclusion tags for the selectable version are still provided for convenience.As discussed in the matrix channel, the edits are implemented as a diff action: removing a maintainer stores somewhere a "remove" edit in the base, and that is taken into account to regenerate the list of maintainers of the cached suggestion. The main motivation is that the base set of maintainers might evolve with time (that is, with updates to Nixpkgs), so we want to be able to re-apply the edits on a new maintainer basis.
Because of the diff nature of editing maintainers, we didn't go for the same logic used for packages, where "removing" a package corresponds to unticking a checkbox. It's adapted to packages because we just store the data as "a set of packages"; ticking or unticking boxes include or uninclude stuff. But since we want to store diffs, we would have to recompute said diff on the backend from two sets of maintainers (and it's not trivial to handle, because "removing" a maintainer can also mean "unadding" a maintainer).
Instead, the "trash" icon is an actual button that is handled by a separate POST endpoint whose job is to toggle the presence of the maintainer in the list. It then answers an updated
selectable_maintainercomponent which is the same as before but with some boolean flag set, which shows an undo button and the strike-through style. Each time a maintainer is edited, the list of maintainers of the cached suggestion is regenerated. Sincecreate_gh_issuetakes this list as the source of truth, no further modifications are required: publishing an issue takes the edits into account by definition.TODO
Left for future work (as this PR is already growing big)