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

Modify list_groups_by_object to allow for non-recursive listing #124

Merged
merged 1 commit into from
Mar 26, 2013

Conversation

krkeegan
Copy link
Collaborator

list_groups_by_object identifies all of the groups that an object is a member of. Currently, if an object is a member of a child group, the child and parent group will be returned in the list.

This change allows for only the groups which the object is a direct member of to be returned.

No code in MH currently uses this function, so altering it shouldn't have any impact. Additionally, only an additional argument was added, so any user code relying on this function should still work properly even with only a single argument.

list_groups_by_object identifies all of the groups that an object is a member of.  Currently, if an object is a member of a child group, the child and parent group will be returned in the list.

This change allows for only the groups which the object is a direct member of to be returned.
@mstovenour
Copy link
Collaborator

I'm a little worried about this approach. It is dangerous to assume that no one uses that function in their user code. Unfortunately we have no way to know for sure. There are two approaches that we could consider when design changes like this are needed:

  1. Go ahead with the non-backwards compatible change (like you did here), but modify the "major" revision number of MH signifying a break in backwards compatibility and make a clear concise list of all the functions that have been changed and the new behaviors. This will allow users to 1st know that their code will break and 2nd give them a clue as to how to change their code for the new release.
  2. Make the change backward compatible.

@krkeegan
Copy link
Collaborator Author

Isn't this backwards compatible? If a user passes only 1 variable it should
work like it did before.
On Mar 15, 2013 5:40 AM, "Michael Stovenour" notifications@github.com
wrote:

I'm a little worried about this approach. It is dangerous to assume that
no one uses that function in their user code. Unfortunately we have no way
to know for sure. There are two approaches that we could consider when
design changes like this are needed:

  1. Go ahead with the non-backwards compatible change (like you did here),
    but modify the "major" revision number of MH signifying a break in
    backwards compatibility and make a clear concise list of all the functions
    that have been changed and the new behaviors. This will allow users to 1st
    know that their code will break and 2nd give them a clue as to how to
    change their code for the new release.
  2. Make the change backward compatible.


Reply to this email directly or view it on GitHubhttps://github.com//pull/124#issuecomment-14958238
.

@krkeegan
Copy link
Collaborator Author

OK, I just checked, calling list_groups_by_object with only 1 argument causes $no_child_members to be undef, which is exactly the value it had before.

What am I missing, how is this not backward compatible?

@mstovenour
Copy link
Collaborator

Kevin, I apologize for speaking before I thoroughly reviewed the code. I keyed on your comment that “No code in MH currently uses this function” and didn’t look close enough at the actual code; or read the remaining part of that sentence. J I agree that it is backward compatible.

@krkeegan
Copy link
Collaborator Author

Ahh, yes that may have been misleading. I was merely trying to note that I had exhausted all testing of known uses of the routine.

Thanks for double checking.

krkeegan added a commit that referenced this pull request Mar 26, 2013
Modify list_groups_by_object to allow for non-recursive listing
@krkeegan krkeegan merged commit 4442cd8 into hollie:master Mar 26, 2013
@hollie hollie mentioned this pull request Jun 15, 2013
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.

2 participants