elastic / connectors

Source code for all Elastic connectors, developed by the Search team at Elastic, and home of our Python connector development framework
https://www.elastic.co/guide/en/enterprise-search/master/index.html
Other
71 stars 126 forks source link

[Network Drive] fix duplicate ids in access control sync #2832

Closed moxarth-elastic closed 5 days ago

moxarth-elastic commented 1 week ago

Closes https://github.com/elastic/connectors/issues/2821

Network Drive connector is currently indexing the access control docs (user docs) with group ids and causes duplicate ids for documents within that group. So, this PR now assigning the user id instead of group id.

Checklists

Pre-Review Checklist

Release Note

Fixing the overwriting issue for access control docs.

moxarth-elastic commented 1 week ago

I don't think this is changing anything, is it? I don't see any logical change, just some syntax changes.

Actually there is a logical change i.e. rid at this line https://github.com/elastic/connectors/blob/e1f8f80eac01bcbb0b5ef7cb1e9c2850bd6e127f/connectors/sources/network_drive.py#L721 was initialised and overwritten in the for loop and that was causing this problem. So, we removed it and made this change https://github.com/elastic/connectors/blob/e1f8f80eac01bcbb0b5ef7cb1e9c2850bd6e127f/connectors/sources/network_drive.py#L727

there's no test change. Please make sure that any fix is illustrated with a test.

Sure, we'll add a test case for the changes.

seanstory commented 1 week ago

Ah! Thanks, didn't see that rid was defined already a few lines above the diff. Thanks for clarifying. 👍

github-actions[bot] commented 5 days ago

💔 Failed to create backport PR(s)

Status Branch Result
8.x https://github.com/elastic/connectors/pull/2845
8.15 Commit could not be cherrypicked due to conflicts

Successful backport PRs will be merged automatically after passing CI.

To backport manually run: backport --pr 2832 --autoMerge --autoMergeMethod squash

seanstory commented 4 days ago

@moxarth-elastic can you please manually backport to the 8.15 branch?

moxarth-elastic commented 3 days ago

@moxarth-elastic can you please manually backport to the 8.15 branch?

@seanstory here is the backport PR: https://github.com/elastic/connectors/pull/2848, please take a look.