-
Notifications
You must be signed in to change notification settings - Fork 74
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: separate urn with non-nested-pattern for now #5383
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
fides Run #10452
Run Properties:
|
Project |
fides
|
Run status |
Passed #10452
|
Run duration | 00m 36s |
Commit |
68d419a874 ℹ️: Merge 52021b633d69bb02a929c94c4e44b741fb24bac8 into 7038f614920aa503e0494dd64290...
|
Committer | Jason Gill |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
4
|
Upgrade your plan to view test results. |
d23329b
to
a199567
Compare
889c5e7
to
daa7330
Compare
b437e1b
to
4b37cfc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reproduced the issue and confirmed that it's fix in this branch. The code looks good. left a minor question below. approved!
const collectionIndex = dataset?.collections.indexOf(collection!); | ||
const collectionIndex = useMemo( | ||
() => dataset?.collections.indexOf(collection), | ||
// eslint-disable-next-line react-hooks/exhaustive-deps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm curious, did it cause an issue trying to add the deps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing a test to fail and I believe it's because the supplied collection was no longer matching anything in the dataset
after a save. Since we're now requiring both dataset
and collection
to be available from the start, we want to snag this index and then stop worrying about it once either gets updated. Including the dependencies recreates the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if I were to rewrite this, I'd pass in the index
rather than the collection
but this seemed like the less risky fix.
@@ -29,3 +29,5 @@ export const FIELD = { | |||
"Arrays of Data Category resources, identified by fides_key, that apply to this field.", | |||
}, | |||
}; | |||
|
|||
export const URN_SEPARATOR = "/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice quick solution changing the separator to something different.
Although this makes me wonder, could we expect to have "/" as a part of the name too? 😂
Anyways, we shouldn't have accepted dots as part of the name either, and kirk is working on a fix for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's party why I made this a constant we can update. We can come back and tweak if it's still a problem for other data.
@@ -260,46 +261,48 @@ const FieldsDetailPage: NextPage = () => { | |||
DatasetField | undefined | |||
>(); | |||
|
|||
const breadcrumbs = useMemo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good optimization!
isOpen={isEditingCollection} | ||
onClose={() => setIsEditingCollection(false)} | ||
/> | ||
{dataset && selectedCollectionForEditing && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, avoiding needing to use the ! or handling undefined values further down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should avoid !
always. It's usually an indication for a potential bug, as was the case here.
@gilluminate While testing I found another bug that would be very easy to fix, can we include it here? The bug is that in the table view if you try to add a category by adding the plus icon, it will navigate down to the nested field level. In src/pages/dataset/[datasetId]/[collectionName]/index.tsx the data categories column is missing this option: It won't cause an issue here src/pages/dataset/[datasetId]/[collectionName]/[subfieldUrn].tsx but we could add it for consistency too. |
4b37cfc
to
0cfcbcb
Compare
fides Run #10454
Run Properties:
|
Project |
fides
|
Run status |
Passed #10454
|
Run duration | 00m 38s |
Commit |
e55d71f66e: FIX: separate urn with non-nested-pattern for now (#5383)
|
Committer | Jason Gill |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
4
|
Upgrade your plan to view test results. |
Co-authored-by: Lucano Vera <lucanovera@ethyca.com>
Closes HJ-36
Description Of Changes
This is a bit of a bandaid fix to handle nested fields on the frontend. We are specifying something other than
.
used in nested field names for the URN so that we can distinguish those. More robust fixes are happening on both the BE and FE in separate tickets.Code Changes
Steps to Confirm
example_dataset_issue_hj36
existsexample_table
example_nested_field
example_failure_nested_field.1
with description "Fail to save data category changes on nested field with '.' in name" should now be able to add/remove categories.example_failure_nested_field.1
row and make sure you can still "Save"example_dataset_issue_hj36
does not existexample_dataset_issue_hj36
datasetPre-Merge Checklist
CHANGELOG.md