-
Notifications
You must be signed in to change notification settings - Fork 71
Add support to expose the Issues API #1100
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
Changes from all commits
806fedc
470ec18
4be905e
9e2dec0
2a89a6d
0ec7511
157e930
29a1d8f
957e3f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ use crate::{ | |
| l10n::web::l10n_service, | ||
| manager::web::{manager_service, manager_stream}, | ||
| software::web::{software_service, software_stream}, | ||
| web::common::{progress_stream, service_status_stream}, | ||
| web::common::{issues_stream, progress_stream, service_status_stream}, | ||
| }; | ||
| use axum::Router; | ||
|
|
||
|
|
@@ -114,6 +114,24 @@ async fn run_events_monitor(dbus: zbus::Connection, events: EventsSender) -> Res | |
| ) | ||
| .await?, | ||
| ); | ||
| stream.insert( | ||
| "software-issues", | ||
| issues_stream( | ||
| dbus.clone(), | ||
| "org.opensuse.Agama.Software1", | ||
| "/org/opensuse/Agama/Software1", | ||
| ) | ||
| .await?, | ||
| ); | ||
| stream.insert( | ||
| "software-product-issues", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar here. I would either expect some id in issue report that can be used to make it specific or at least use just
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not using those IDs for anything, so they aren't relevant. I decided to, somehow, match the D-Bus structure ( However, if we use it as an ID, we could get rid of the WithIssues("software/issues")instead of WithIssues("software/issues", "/org/opensuse/Agama/Software1"In that case, I would adjust the events-related types to something like: pub type Scope = String;
pub type EventsSender = Sender<(Scope, Event)>;
pub type EventsReceiver = Receiver<(Scope, Event)>;Does it make sense?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the other hand, keeping the scope out of the event introduces some small inconsistencies, like being able to send a I have been also thinking about using something like: pub enum Event {
Locale(LocaleEvent),
Software(SoftwareEvent),
};And then each service defines its event types: pub enum LocaleEvent {
LocaleChanged { locale: String },
IssuesChanged(IssuesChangedEvent),
ProgressChanged(ProgressChangedEvent)
}In this case, the scope is implicit. I would like to think a little bit about that (and other options we could think of). For now, I will just update the IDs to make them look better and more consistent.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense to me to think a bit about it and what is more important document decision, so we will be consistent.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a note about the second proposal: if you can emit a |
||
| issues_stream( | ||
| dbus.clone(), | ||
| "org.opensuse.Agama.Software1", | ||
| "/org/opensuse/Agama/Software1/Product", | ||
| ) | ||
| .await?, | ||
| ); | ||
|
|
||
| tokio::pin!(stream); | ||
| let e = events.clone(); | ||
|
|
||
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.
to be honest I am not sure if I expect subtree under issue or other way
/software/issues. Probably later makes more sense to me. Or having general/issuescall. Would it be possible?