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

feat(cli): allow export-roles to be beautified #1724

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

EBoisseauSierra
Copy link
Contributor

Description

Expose json.dump(indent=*) to the fab export-roles --indent=* CLI command.

ADDITIONAL INFORMATION

@codecov
Copy link

codecov bot commented Oct 25, 2021

Codecov Report

Merging #1724 (ba7da50) into master (3a6b45b) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1724      +/-   ##
==========================================
+ Coverage   77.04%   77.06%   +0.01%     
==========================================
  Files          56       56              
  Lines        8219     8226       +7     
==========================================
+ Hits         6332     6339       +7     
  Misses       1887     1887              
Flag Coverage Δ
python 77.06% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flask_appbuilder/cli.py 58.37% <100.00%> (+1.36%) ⬆️
flask_appbuilder/security/manager.py 75.88% <100.00%> (ø)
flask_appbuilder/security/mongoengine/manager.py 66.15% <100.00%> (ø)
flask_appbuilder/security/sqla/manager.py 71.38% <100.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 3a6b45b...ba7da50. Read the comment docs.

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>
Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>
@EBoisseauSierra EBoisseauSierra marked this pull request as ready for review February 10, 2022 09:57
@EBoisseauSierra
Copy link
Contributor Author

@dpgaspar : this is now ready for review!

FYI, the missing bits were:

  • handling --indent=-1 “edge case” (as “-1” is interpreted as a string) — note that we might want to extract the try block in a dedicated method; I'd welcome your input there,
  • declaring the new kwarg in all three flask_appbuilder/security/manager.py, flask_appbuilder/security/mongoengine/manager.py, and flask_appbuilder/security/sqla/manager.py,
  • mock json.dumps (and not dump),
  • assert one kwarg out of ≥1 is used.

as `None` is already defined through `Optional` — cf.
https://docs.python.org/3/library/typing.html#typing.Optional

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>
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.

2 participants