-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Provide a replacement for forge-insert-assigned-issues
(among others)
#676
Comments
I haven't updated the documentation yet, but will do so soon. I have removed the functions that insert a particular selection of topics. There are now many more filtering options and you can use more than one filter at once. As a result it isn't feasible anymore, to provide a dedicated inserter function for each filter (combination). See #673 for how to set a filter. |
Ah, thanks, I failed to see the other issue. It seems to me that it's not possible anymore to create multiple sections in the (setq forge-status-buffer-default-topic-filters
`(,(forge--topics-spec :type 'topic :active t :state 'open :order 'newest)
,(forge--topics-spec :type 'issue :active t :state 'open :order 'newest :assignee "mynick"))) but it didn't work. Thanks. |
I had faint hope that users wouldn't miss these functions after getting used to the new quicker and more flexible filtering, which is why I initially didn't provide instructions on how to bring them back. Now that I have looked into it again, and made some minor tweaks (f09d222), you can define this command like so: (defun forge-insert-assigned-issues ()
"Insert a list of issues that are assigned to you.
Mostly honor the buffer's filtering spec, overriding
only the `assignee' slot."
(when-let (((forge-db t))
(repo (forge-get-repository :tracked?))
(user (ghub--username repo))
(spec (clone forge--buffer-topics-spec)))
(oset spec assignee user)
(forge-insert-issues spec "Assigned issues"))) To re-implement related removed functions, see the commit that removed them de31e7c (which made I imagine you want this feature because you are approximately in this situation: You contribute to a project with many issues and contributors, and most of the time you are only interested in the topics that have been assigned to you. However, occasionally you to look at the new topics, e.g., to determine which you have to take responsibility for. If that were my situation, I would |
This allows wrapping these functions, while overriding certain aspects, to define additional section inserters that apply additional filtering. In `forge--insert-topics' use the heading as the "value", which is necessary to tell different sections apart. See #676. Usage example: (defun forge-insert-assigned-issues () "Insert a list of issues that are assigned to you. Mostly honor the buffer's filtering spec, overriding only the `assignee' slot." (when-let (((forge-db t)) (repo (forge-get-repository :tracked?)) (user (ghub--username repo)) (spec (clone forge--buffer-topics-spec))) (oset spec assignee user) (forge-insert-issues spec "Assigned issues"))) (magit-add-section-hook 'magit-status-sections-hook #'forge-insert-assigned-issues #'forge-insert-issues t)
Thank you very much for the extra details. You're right that the project I contribute to has many issues and contributors. More often than not, the issues are created without an assignee and I have to review them and choose what I will work on next, so in my case it makes sense to just leave the default almost as is (just adjusting the Either way, I noticed that you've added some code to make things easier to add new sections. That's also much appreciated. Thanks. |
Overall I like the idea of how the new filtering mechanism works, though I wonder if it is possible to filter out some items (e.g. PRs) based on some words/pattern within the title? while on monorepos not all PRs are relevant to me and would be nice to exclude these or those opened by automated tools to reduce noise. |
I plan to add more filters and search, but not before the release and I probably won't jump to do it right after the release either. But its definitely something I want to do eventually. |
I've added a new function (defun my-forge-insert-assigned-issues ()
"Insert a list of issues that are assigned to you.
Mostly honor the buffer's filtering spec, overriding only the `type' and
`assignee' slots."
;; Move any work you are tempted to do here ...
(forge-insert-topics 'assigned-issues "Assigned issues"
(lambda (repo)
;;; ... to here instead. For example ----,
(and-let* ((me (ghub--username repo))) ;<-'
(forge--topics-spec :type 'issue :active t :assignee me)))))
(magit-add-section-hook 'magit-status-sections-hook
#'my-forge-insert-assigned-issues
#'forge-insert-issues) |
Hi,
I have the following definition on my
init.el
:This is now giving me a warning message:
It started today after I upgraded my packages; I'm using forge
20240623.1337
(which arguably is not expected to be as stable, but I thought I'd file this bug anyway). I believe there should be an update to the docs explaining how to replace these retired functions.Thanks!
The text was updated successfully, but these errors were encountered: