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

Added ability to use suffixes with a controller that has been already registered without suffixes. #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ebensonwwg
Copy link

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2020

Codecov Report

Merging #23 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #23   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           40        53   +13     
=========================================
+ Hits            40        53   +13     
Impacted Files Coverage Δ
falcon_apispec/falcon_plugin.py 100.00% <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 a5e665e...346f65b. Read the comment docs.

@alysivji
Copy link
Owner

alysivji commented Jul 3, 2020

Thanks for making this PR!

It's July 4th long weekend, won't be able to review until next weekend. Appreciate your understanding.

@ebensonwwg
Copy link
Author

Hope you enjoyed the long weekend. I appreciate your update and look forward to your comments and merge this weekend.

Comment on lines +99 to +100
# should be passed twice so the suffix is registered
# path should be called n + 1 times where n is the number of suffixes
Copy link
Owner

Choose a reason for hiding this comment

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

Unless people read this README, they are not going to know about this convention.

Is there a better way to register resources? Would prefer to do it once versus n+1 times. Also, is there is a reason it's n+1?

Copy link
Author

Choose a reason for hiding this comment

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

Hi, Unfortunately not, due to how the ApiSpec plugin works. It calls each resource once, meaning if you use a controller twice only one path will be chosen.

Copy link
Author

Choose a reason for hiding this comment

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

@alysivji Any updates?

Copy link
Owner

Choose a reason for hiding this comment

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

Calling something n+1 times is a sign of bad design. What if y'all add a new suffix but forgot to add the line? Having a manual process is a recipe for disaster.

There has to be a way of fixing it I would need to look into how the path_helper works... why can't we loop n+1 times inside there to get the information you need?

I have commitments until August 4th. I can definitely help out after then.

Copy link
Author

Choose a reason for hiding this comment

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

@alysivji Status?

README.md Outdated Show resolved Hide resolved
@ebensonwwg
Copy link
Author

ebensonwwg commented Jul 12, 2020 via email

Signed-off-by: Eric Benson <eric.benson@grainger.com>
@jeff-li
Copy link

jeff-li commented Sep 22, 2020

Thanks for creating this PR! Is there any update regarding when this can be merged?

@alysivji
Copy link
Owner

Thanks for the ping. This slipped off my radar as other priorities came up.

I'm not a fan of the n+1 calls required for this feature to work properly. Adding a different abstraction on top or maybe doing a loop inside of the helper function would improve design.

I would need to take a closer look at what apispec is doing. I can take a look this weekend / early October (have some time devoted to Open Source during Hacktober) to see if I can come up with a better API.

@jeff-li
Copy link

jeff-li commented Oct 8, 2020

thanks!

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.

4 participants