Pagure Dist Git Interactions With Fedora Notifications
Fedora Messaging Notifier is a family of systems to manage end-user notifications triggered by Fedora Messaging and it provides a single place for all applications using Fedora Messaging to notify users of events.
Possible Interactions
The following are a set of documented interactions possible between Pagure Dist Git and Fedora Notifications.
Artifact Details
Fedora Notifications receives information about the permissions related to a certain asset (which can be a package) from Pagure Dist Git. It receives information about the assets (which can be a package) that a user or a group has access to.
Fedora Notifications provide its users with artifact details via an HTTP GET endpoint that it retrieves from Pagure Dist Git. For more information, please check the function definition provided here.
The inputs required by the Fedora Notifications service to perform this operation are name patterns of artifacts to be returned, name of the users whose artifacts are to be returned, and name of the groups whose artifacts are to be returned.
This endpoint makes use of a FastAPI dependency called
get_distgit_proxy
, more information related to which can be found here.
The PagureAsyncProxy
class
The URL of the existing Pagure Dist Git production deployment is referenced here to instantiate an object of type
PagureAsyncProxy
class. For more information, please check the method definition provided here.The method definition for determining the next page parameters is provided here. This is extensively used for recursively navigating through the Pagure Dist Git API results.
The method definition for retrieving project details is provided here. This is dependent on the values provided for the
namespace
,pattern
,username
andowner
parameters.The method definition for retrieving project details associated with a certain user is provided here. This is dependent on the values provided for the
username
parameter.The method definition for retrieving project details associated with a certain project is provided here. This is dependent on the values for the
name
parameter.The method definition for retrieving user details associated with a certain project is provided here. This is dependent on the values provided for the
project_path
parameter.The method definition for retrieving group details associated with a certain project is provided here. This is dependent on the values provided for the
project_path
parameter.
Changes proposed
In order to switch out Pagure Dist Git for an alternative that provides a relatively compatible API pattern, the following changes must be made in the placed mentioned below.
Necessary
The Pagure Dist Git URL production deployment URL would have to change to point towards the production deployment URL of the alternative. This method definition is where the URL is formatted to point towards the API.
The method
get_api_url
has to be redefined depending on what the URL pattern is for the alternative place where we move Pagure Dist Git assets to. Here is the method definition of where the changes need to be made.
Unnecessary
The
APIClient
class that is inherited by thePagureAsyncProxy
class is agnostic to the place where the assets are hosted so changing over from Pagure Dist Git to an alternative would not necessitate a reworking while checking for compatibilities is strongly recommended. The method definition can be found here.