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

api: reorganize policy generation API #196

Merged
merged 1 commit into from
Apr 9, 2020

Conversation

kyrofa
Copy link
Member

@kyrofa kyrofa commented Apr 8, 2020

Extract policy generation API from api's __init__.py and move into verb. Nothing else uses it, and the verb includes a lot of related API on its own.

Extract policy generation API from api's __init__.py and move into
verb as nothing else uses it.

Signed-off-by: Kyle Fazzari <[email protected]>
@codecov
Copy link

codecov bot commented Apr 8, 2020

Codecov Report

Merging #196 into master will decrease coverage by 1.62%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #196      +/-   ##
==========================================
- Coverage   54.96%   53.34%   -1.63%     
==========================================
  Files          18       18              
  Lines         584      583       -1     
  Branches       52       52              
==========================================
- Hits          321      311      -10     
- Misses        249      258       +9     
  Partials       14       14              
Flag Coverage Δ
#unittests 53.34% <0.00%> (-1.63%) ⬇️
Impacted Files Coverage Δ
sros2/sros2/api/__init__.py 50.00% <ø> (-5.00%) ⬇️
sros2/sros2/verb/generate_policy.py 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1984821...af253ed. Read the comment docs.

if request_services:
self.add_permission(
profile, 'service', 'request', 'ALLOW', request_services, node_name)

with open(args.POLICY_FILE_PATH, 'w') as stream:
dump_policy(policy, stream)
return 0


def _get_node_names(*, node, include_hidden_nodes=False):
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think these are more generally useful. They're very specific to this verb. Other packages will consume node names/namespaces on their own.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed

@kyrofa kyrofa requested a review from artivis April 9, 2020 01:36
Copy link

@artivis artivis left a comment

Choose a reason for hiding this comment

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

lgtm

@kyrofa kyrofa merged commit 4a212b3 into ros2:master Apr 9, 2020
@kyrofa kyrofa deleted the feature/api-clean-policy-generation branch April 9, 2020 15:30
@mikaelarguedas mikaelarguedas mentioned this pull request Jun 5, 2020
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.

3 participants