Skip to content
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

Add API for accessing expected Pulp actions #128

Closed
wants to merge 1 commit into from

Conversation

negillett
Copy link
Member

This commit adds a new API which generates a list of the associations
and unassociations expected to be performed by Pulp for each repo in
each UBI configuration.

Fixes #119

This commit adds a new API which generates a list of the associations
and unassociations expected to be performed by Pulp for each repo in
each UBI configuration.

Fixes release-engineering#119
@negillett
Copy link
Member Author

run tests

Copy link
Member

@rbikar rbikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this way of implementation would be very difficult to use in client apps.
Imagine how this will be used in Pub. Also please check DELIVERY-7357 and DELIVERY-7379 which will use this API. See my inline comment for some thoughts.

As this is 1st public API for ubipop, what I miss here is update of readme, docs with examples, examples dir with simple example of usage of this API.
I guess it's not obvious how caller should use this lib. What I mean is that UbiPopulate class will become public and there are no docs how to use it. Also classes that are not intended for public usage should be at least prefixed with underscore.

{
"repo ID": {
"associations": (
AssociateActionModules,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How caller should know what he should do with this?
In ubipop it does:
self._executor.submit(*action.get_action(self.pulp))
where action is one item of e.g. AssociateActionModules.

I was thinking about really simple mapping (maybe encapsulated to some class, json can get too complicated for caller) that should be returned to caller and caller will handle actions by its own means:
e.g. in general terms what API should return is:
list of associations: src and dest repo_id, unit_type, [identifier of unit]
list of unassociations: repo_id, unit_type, [identifier of unit]

Does that make some sense?

Also there is a question how to handle actions on mdd as they need to be done in certain order.
At least it needs to be documented.

@negillett
Copy link
Member Author

negillett commented Sep 10, 2019

I think that this way of implementation would be very difficult to use in client apps.

Okay, I can encapsulate associations and unassociations and leave out mdd_*.

As this is 1st public API for ubipop, what I miss here is update of readme, docs with examples,
examples dir with simple example of usage of this API.

I can add example and documentation for this new API as well.

[...] What I mean is that UbiPopulate class will become public and there are no docs how to use it.
Also classes that are not intended for public usage should be at least prefixed with underscore.

You're asking for documentation on the whole of UbiPopulate and the privatization of existing classes/methods to be included in the fix for #119? If so, I disagree. I feel those things should be done for a separate issue with the goal of making UbiPopulate public.

@rbikar
Copy link
Member

rbikar commented Sep 11, 2019

@nathanegillett
Yeah, you're right, docs for UbiPopulate and other related things are not specified in this issue. So please file a new issue for this (docs + little refactor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Public interface for getting expected actions on pulp
2 participants