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

Fix adding api routes to servers #1381

Merged
merged 4 commits into from
Oct 9, 2019
Merged

Fix adding api routes to servers #1381

merged 4 commits into from
Oct 9, 2019

Conversation

greenape
Copy link
Member

@greenape greenape commented Oct 9, 2019

Closes #1373

I have:

  • Formatted any Python files with black
  • Brought the branch up to date with master
  • Added any relevant Github labels
  • Added tests for any new additions
  • Added or updated any relevant documentation
  • Added an Architectural Decision Record (ADR), if appropriate
  • Added an MPLv2 License Header if appropriate
  • Updated the Changelog

Description

Fixes not being able to turn on a newly added api route for an existing server by correctly setting the permitted options on servers to all options, and adds a test to cover this case.

@greenape greenape added bug Something isn't working FlowAuth Issues related to FlowAuth ready-to-merge Label indicating a PR is OK to automerge labels Oct 9, 2019
@cypress
Copy link

cypress bot commented Oct 9, 2019



Test summary

55 0 0 0


Run details

Project FlowAuth
Status Passed
Commit 742f0cb
Started Oct 9, 2019 12:18 PM
Ended Oct 9, 2019 12:21 PM
Duration 02:56 💡
OS Linux Debian - 8.11
Browser Electron 61

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@codecov
Copy link

codecov bot commented Oct 9, 2019

Codecov Report

Merging #1381 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1381      +/-   ##
==========================================
+ Coverage   94.98%   95.02%   +0.03%     
==========================================
  Files         157      157              
  Lines        7551     7551              
  Branches      704      704              
==========================================
+ Hits         7172     7175       +3     
+ Misses        269      268       -1     
+ Partials      110      108       -2
Flag Coverage Δ
#flowapi_unit_tests 82.36% <ø> (ø) ⬆️
#flowauth_unit_tests 93.65% <ø> (ø) ⬆️
#flowclient_unit_tests 78.78% <ø> (ø) ⬆️
#flowetl_unit_tests 97.35% <ø> (ø) ⬆️
#flowkit_jwt_generator_unit_tests 100% <ø> (ø) ⬆️
#flowmachine_unit_tests 90.86% <ø> (ø) ⬆️
#integration_tests 68.48% <ø> (+0.09%) ⬆️
Impacted Files Coverage Δ
flowmachine/flowmachine/core/cache.py 95.78% <0%> (+1.57%) ⬆️

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 587a79f...742f0cb. Read the comment docs.

.get("#api-exp")
.click();
cy.get("#permissions").should("have.attr", "data-indeterminate", "true");
cy.get("[data-permission-id='" + route_name + "_get_result']")
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth creating a helper function for this check (with a meaningful name) to avoid the code repetition?

.click({
force: true
});
cy.contains(route_name).should("not.exist");
Copy link
Contributor

@maxalbert maxalbert Oct 9, 2019

Choose a reason for hiding this comment

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

Just for my understanding: what does this check do, exactly? Why should the route_name element not exist any more?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a convoluted way to click the dustbin icon next to it, which should delete it.

@@ -206,7 +214,7 @@ class PermissionDetails extends React.Component {
isPermissionChecked,
permissionIndeterminate
} = this.state;
const { classes, onClick, permitted } = this.props;
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of interest: was the presence of onClick a bug, or did you have to remove it because of any changes in this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not a bug, just an unused var.

Copy link
Contributor

@maxalbert maxalbert left a comment

Choose a reason for hiding this comment

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

Looks good, as far as I'm able to tell. A couple of minor inline comments/questions, but happy to merge. 👍

@maxalbert maxalbert removed the ready-to-merge Label indicating a PR is OK to automerge label Oct 9, 2019
@greenape greenape added the ready-to-merge Label indicating a PR is OK to automerge label Oct 9, 2019
@mergify mergify bot merged commit 5ec261c into master Oct 9, 2019
@mergify mergify bot deleted the fix-route-adding branch October 9, 2019 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working FlowAuth Issues related to FlowAuth ready-to-merge Label indicating a PR is OK to automerge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't add new API permissions to an existing server in FlowAuth
2 participants