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

Connector dataset dropdown #2162

Merged

Conversation

allisonking
Copy link
Contributor

@allisonking allisonking commented Jan 6, 2023

Closes #2114

Code Changes

  • Adds a dataset dropdown next to the existing yaml editor
  • Allows the dataset dropdown to link a dataset to a connector config
  • Additional confirmation button for overwriting datasets in the yaml editor
  • Fix copy (system yaml --> dataset YAML)
  • Cypress tests

Steps to Confirm

  • nox -s test_env
  • Configure a connector dataset

Pre-Merge Checklist

Description Of Changes

Using the dropdown

Screen.Recording.2023-01-10.at.7.01.39.PM.mov

Using the yaml editor

Screen.Recording.2023-01-10.at.7.04.22.PM.mov

@allisonking allisonking changed the base branch from main to unified-fides-resources January 6, 2023 23:20
@allisonking allisonking marked this pull request as ready for review January 11, 2023 00:05
@allisonking
Copy link
Contributor Author

Failing test seems unrelated?

@pattisdr
Copy link
Contributor

yep this is unrelated @allisonking, I saw this on my last unified-fides-resources PR but I don't think it's on main. After we merge your branch in, I'll get unified-fides-resources up-to-date with main and investigate there.

Copy link
Contributor

@pattisdr pattisdr left a comment

Choose a reason for hiding this comment

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

This feels a little buggy to me in places. This branch isn't up-to-date with unified-fides-resources that has the improved upsert validation, but that is handy here so it's easy to see where we might add better error handling:

  1. Start from scratch, delete datasetconfigs, connectionconfigs, and ctl_datasets. Refresh. It makes sense that there's no dropdown to connect my first connection config to an existing dataset, but the save button stacked on the cancel button looks off

Screen Shot 2023-01-11 at 12 39 39 PM

2) Copy and paste a dataset (mysql is a good one) that doesn't have an `organization_fides_key` or `data_qualifier` in it. You could also send in a bad data category. We get failed requests but the UI looks like we never submitted a request at all. (In the background a ctl_dataset has been created, but the ops datasetconfig was not created)
error_handling_patch_datasetconfig.mov
  1. Editing an existing dataset that was good to something invalid (add bad data category) also puts the UI in a weird state

Screen Shot 2023-01-11 at 12 57 39 PM

  1. When saving existing dataset yaml you've added a helpful confirmation that you're about to overwrite a dataset. This is not necessarily true if the user is also editing the fides_key.
    Below, the only edit I made was to change postgres_example_test_dataset fides_key to updated_fides_key. This will create a new ctl_dataset titled updated_fides_key, and link it to the DatasetConfig.

Screen Shot 2023-01-11 at 1 03 11 PM

  1. When configuring an existing dataset in the connector workflow, it took me awhile to figure out how to edit directly. I needed to unselect the current dataset.

@allisonking
Copy link
Contributor Author

Thanks for the thorough testing @pattisdr ! 🙏

  1. This should be fixed. It's a little weird code-wise, but the new designs don't have a cancel button anymore so I don't think we have to worry too much about it since it'll go away soon.
    image

2 and 3. I'm having trouble reproducing these—I just merged in unified-fides-resources which like you said throws the proper errors now, so I wonder if that's letting me see good errors instead of getting stuck in weird states? Can you let me know if you're still seeing these problems, and if so, with what dataset? (I tried out mysql_example_test_dataset.yml which seemed to work ok)

  1. Good catch, should be fixed!
  2. Yeah, this was the decision we came to when we were trying to decide on behavior without design. The good news is this will go away with the new design that's currently in the works

@pattisdr
Copy link
Contributor

pattisdr commented Jan 12, 2023

2 and 3. I'm having trouble reproducing these—I just merged in unified-fides-resources which like you said throws the proper errors now, so I wonder if that's letting me see good errors instead of getting stuck in weird states? Can you let me know if you're still seeing these problems, and if so, with what dataset? (I tried out mysql_example_test_dataset.yml which seemed to work ok)

OK after some more digging I found what bad request is causing this: it's if a GET http://localhost:3000/api/v1/dataset throws an error because it's returning a bad dataset. It's harder to create a bad dataset after you've merged in unified-fides-resources.

To reproduce, you could force the backend to throw an error, for example:

  1. Go to src/fides/api/ctl/routes/crud.py
  2. In the list endpoint async def ls:, raise an exception first thing Exception()

This mimics what would happen if a user had a bad dataset already saved.

@allisonking
Copy link
Contributor Author

Thanks for such thorough testing! Should be ready for another review now 🤞

@pattisdr
Copy link
Contributor

wonderful, testing now!

Copy link
Contributor

@pattisdr pattisdr left a comment

Choose a reason for hiding this comment

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

OK this UI is feeling pretty good now and holding up under a lot of scenarios I'm testing. Thanks for your nice changes here! There's just a couple of things I saw on this last round but I think it's about ready to go.

@pattisdr
Copy link
Contributor

@allisonking one more thing I just thought of I forgot to test: creating saas connectors. One big difference with saas connectors is that we create them from a template. After the user enters their connector parameters and clicks save, the connection config, dataset config, and dataset are all created in the background for them.

There's a small thing where it's hard to save the dataset when you create multiple saas connectors.

  • Create a mailchimp connector
  • Enter connector parameters (just fake data is fine)
  • On configure dataset click save in the dropdown
  • Create a segment connector
  • Enter connector parameters
  • On configure dataset, the segment dataset is not in the dropdown. I can click "Save" here, but it's confusing because there's only "Select" in the dropdown. I can't edit the yaml either: by toggling to another dataset, then back to Select, you can edit the yaml. I suspect the "Select" is tied to the actual dataset here behind the scenes.
Screen.Recording.2023-01-12.at.12.35.55.PM.mov

This allows us to invalidate the cache on datasets from within the datastore connection slice.
@allisonking
Copy link
Contributor Author

Oh man, that's a good catch I never would have looked for. This should fix it. The change really should have only been the one line (to add "Datasets" to the list of resources in the cache to be invalidated when a new saas connector is created), but due to some tech debt I had to combine the relevant redux slices to use the same base API first.

Copy link
Contributor

@pattisdr pattisdr left a comment

Choose a reason for hiding this comment

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

Alright this looks really good to me @allisonking thanks for your hard work here 🏆 Failing test is unrelated like we discussed and I'll look into this after you merge this branch into unified-fides-resources.

@allisonking allisonking merged commit f4bdefb into unified-fides-resources Jan 12, 2023
@allisonking allisonking deleted the aking/2114/connector-dataset-dropdown branch January 12, 2023 20:33
@pattisdr pattisdr mentioned this pull request Jan 17, 2023
15 tasks
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.

Remove the connector configuration dataset YAML upload form
2 participants