Skip to content

Conversation

@tlater-famedly
Copy link
Contributor

We've needed to figure out what famedly-sync is seeing a few times while debugging in customer environments now; this is a quick solution that helps get this more easily.

Short of a full command to do various searches in famedly-sync (which would basically just reimplement ldapsearch) I think this is a pretty good way to patch up that use case a bit.

@tlater-famedly tlater-famedly marked this pull request as ready for review April 25, 2025 09:15
@tlater-famedly tlater-famedly requested a review from a team as a code owner April 25, 2025 09:15
@codecov
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.40%. Comparing base (f4ba334) to head (dad0687).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #139   +/-   ##
=======================================
  Coverage   88.40%   88.40%           
=======================================
  Files          10       10           
  Lines        1785     1785           
=======================================
  Hits         1578     1578           
  Misses        207      207           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4ba334...dad0687. Read the comment docs.

jannden
jannden previously approved these changes Apr 25, 2025
Copy link
Contributor

@jannden jannden left a comment

Choose a reason for hiding this comment

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

Looks fine

Copy link
Contributor

Choose a reason for hiding this comment

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

what is ./contrib/?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a directory with some random bonus scripts that are useful. It's pretty common in FOSS projects; often plugins and other related things not part of the main codebase make it in there, too.

fi

grep_from_yaml() {
grep "$1" "$config" | cut -f 2 -d ':' | tr -d '" '
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly the simple approach doesn't work very well in practice; various attributes used in DNs and filters often contain spaces and :. tr-ing and cut-ing all of them breaks.

We'd need to do a more thorough yaml parse to not run into this, sadly non-greedy matches are hard to do with just POSIX utilities.

We've needed to figure out what famedly-sync is seeing a few times
while debugging in customer environments now; this is a quick solution
that helps get this more easily.

Short of a full command to do various searches in famedly-sync (which
would basically just reimplement `ldapsearch`) I think this is a
pretty good way to patch up that use case a bit.
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.

4 participants