-
Notifications
You must be signed in to change notification settings - Fork 198
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
Allow Mockgun to apply schema modifications #198
Open
Ahuge
wants to merge
3
commits into
shotgunsoftware:master
Choose a base branch
from
Ahuge:feature/ah/mockgun_set_schema
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This works opposite to the get_schemas function
We implement the create and update using a new internal helper called `_set_property`. This new method will recursively search the passed current property dictionary and attempt to find all keys matching the key you pass in and update it's value to the value you have passed in. If it cannot find the value in the current dictionary but it does find a "properties" dictionary, it will add a new entry in the "properties" dictionary. This "properties" dictionary appears to only exist on the root of the properties dictionary. A `schema_field_update` does a deep copy of the properties before updating them whereas the `schema_field_create` method starts from a base schema_field dictionary and updates it with what you pass in. This does not deal with setting "editable" values in each of these keys. We are assuming, in Mockgun, that you are allowed to change anything in the schema. Perhaps someone from the team at Shotgun will have some clear logic that will allow us to implement that.
Ahuge
force-pushed
the
feature/ah/mockgun_set_schema
branch
from
May 21, 2019 20:00
b85a3e3
to
43c519e
Compare
houndci-bot
reviewed
May 21, 2019
houndci-bot
reviewed
May 21, 2019
Ahuge
force-pushed
the
feature/ah/mockgun_set_schema
branch
from
May 21, 2019 20:17
bc26495
to
43c519e
Compare
Bump? |
Hi Sorry we've not got back to you yet on this. We really appreciate you submitting it, but its going to be a little while before we can get to properly looking at this. |
Sounds good thanks for the update |
Just leaving my +1 here for this pull request, as this would help me as well at the moment. 🙂 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is designed to add additional schema support for Mockgun allowing me to alter the schema and save out the schema modifications
I do this by implementing the
schema_field_create/update/delete
methodsI have also updated the SchemaFactory with new methods to allow writing out a schema from memory.
This is my second PR to shotgunsoftware the last one had issues with a missing
tests/config
file...This one will have the same issue until I figure out what is needed with that in #197
Thanks