Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel

Re: [rt-users] MergeUsers extension for RT problem.

 

 

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded


smithj4 at bnl

Oct 2, 2009, 9:14 AM

Post #1 of 4 (421 views)
Permalink
Re: [rt-users] MergeUsers extension for RT problem.

On Fri, 2009-10-02 at 11:36 -0400, Kevin Falcone wrote:
> You're going to need to poke in the db, because I haven't seen this
> reported before. Also, the rt-update-merged-users script is ONLY
> needed if you've upgraded from a 3.6 instance using an old MergeUsers
> extension (there are now bidirectional informational messages).
>
> You can use select id from Attributes where Name = 'MergedUsers' and
> ObjectId in (447,485) and then run the
> /opt/rt3/sbing/rt-attributes-viewer with the attribute id to see what
> is stored there.

Hi Kevin,

I originally posted this to the users list, but I discovered the cause
of my problem when I looked at the code, and I have a proposed patch, so
I am following up on the devel list.

I was considering using the MergeUser functionality to merge user
accounts created with the WebExternalAuto method and our ExternalAuth,
which have blank email addresses, with the accounts created through
email interaction with RT. Since one of the accounts didn't have an
email address, it appeared blank. My proposed patch displays the
account name (which should always be present) and email address if that
is present.

The patch also adds the reverse link, when viewing the user others have
been merged into, their names now link to their modify user page.

While testing this, it seemed a little flaky. Are there still some
issues or bugs with Real & Effective merged users?

~Jason


On Thu, 2009-10-01 at 16:48 -0400, Jason A. Smith wrote:
> I am setting up a new RT server, version 3.8.5 and tried
> RT-Extension-MergeUsers, version 0.03 available from CPAN.
>
> It seems to work as expected, except for one problem. When viewing the
> target user of the merge, I see a comment like:
>
> (485) merged into this user
>
> But under in the "Merge user" box, it doesn't display the merged
> username correctly, it just says:
>
> The following users have been merged into this user:
>
> and then the Unmerge button.
>
>
> When viewing the merged user data, I see the complementary comment:
>
> Merged into smithj4[at]bnl.gov (447)
>
> and in the "Merge user" box I see more complete info:
>
> This user has been merged with smithj4[at]bnl.gov;
>
>
> I also tried manually running the rt-update-merged-users script, but it
> doesn't seem to fix it, and just reports:
>
> 447 already has 485 in the merge list
> DONE.
>
>
> Is this a bug or something missing/wrong with my setup?
>
> ~Jason
>
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales[at]bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
--
/------------------------------------------------------------------\
| Jason A. Smith Email: smithj4[at]bnl.gov |
| Atlas Computing Facility, Bldg. 510M Phone: +1-631-344-4226 |
| Brookhaven National Lab, P.O. Box 5000 Fax: +1-631-344-7616 |
| Upton, NY 11973-5000, U.S.A. |
\------------------------------------------------------------------/
Attachments: RT-Extension-MergeUsers-0.03_username_display.patch (1.83 KB)
  smime.p7s (3.81 KB)


falcone at bestpractical

Oct 2, 2009, 5:36 PM

Post #2 of 4 (388 views)
Permalink
Re: [rt-users] MergeUsers extension for RT problem. [In reply to]

On Fri, Oct 02, 2009 at 12:14:40PM -0400, Jason A. Smith wrote:
> I was considering using the MergeUser functionality to merge user
> accounts created with the WebExternalAuto method and our ExternalAuth,
> which have blank email addresses, with the accounts created through
> email interaction with RT. Since one of the accounts didn't have an
> email address, it appeared blank. My proposed patch displays the
> account name (which should always be present) and email address if that
> is present.

I modified this slightly and pushed the logic back into the lib so it
could be used in the messages from UnMerge also. See
a1eb2b4e76f4c95fd4341abad22c168605579590 when it reaches github when
I'm back online.

> The patch also adds the reverse link, when viewing the user others have
> been merged into, their names now link to their modify user page.

I didn't take this because the extension should actually load the
primary user, even when you load a merged user by Id (and this is the
behavior I observed while testing).

If you can show me that it does something different, I'm willing to
reconsider.

> While testing this, it seemed a little flaky. Are there still some
> issues or bugs with Real & Effective merged users?

I wasn't aware of any, but I did tweak something with the cache that
may have been bugging you (I noticed it while testing your patch).
I also cleaned up some warnings and rolled 0.04_01

You should find RT-Extension-MergeUsers-0.04_01 on a cpan mirror near
you sometime over the weekend.

-kevin


smithj4 at bnl

Oct 5, 2009, 8:46 AM

Post #3 of 4 (375 views)
Permalink
Re: [rt-users] MergeUsers extension for RT problem. [In reply to]

On Fri, 2009-10-02 at 20:36 -0400, Kevin Falcone wrote:
> On Fri, Oct 02, 2009 at 12:14:40PM -0400, Jason A. Smith wrote:
> > I was considering using the MergeUser functionality to merge user
> > accounts created with the WebExternalAuto method and our ExternalAuth,
> > which have blank email addresses, with the accounts created through
> > email interaction with RT. Since one of the accounts didn't have an
> > email address, it appeared blank. My proposed patch displays the
> > account name (which should always be present) and email address if that
> > is present.
>
> I modified this slightly and pushed the logic back into the lib so it
> could be used in the messages from UnMerge also. See
> a1eb2b4e76f4c95fd4341abad22c168605579590 when it reaches github when
> I'm back online.

I downloaded 0.04_01 from CPAN and it seems to work fine with users that
have no email address, Thanks.

> > The patch also adds the reverse link, when viewing the user others have
> > been merged into, their names now link to their modify user page.
>
> I didn't take this because the extension should actually load the
> primary user, even when you load a merged user by Id (and this is the
> behavior I observed while testing).

Ok, I understand. So is there any way to see the user data from the
merged user then? Or is this data now irrelevant, except for the name &
email address which are shown in the merge box, since they are now
effectively the user they were merged into in terms of privileges?

> If you can show me that it does something different, I'm willing to
> reconsider.
>
> > While testing this, it seemed a little flaky. Are there still some
> > issues or bugs with Real & Effective merged users?
>
> I wasn't aware of any, but I did tweak something with the cache that
> may have been bugging you (I noticed it while testing your patch).
> I also cleaned up some warnings and rolled 0.04_01

I tested this, and after a merge and unmerge, I still see some odd
behavior. For example, I merge user 11388 into user 9304, then unmerge
them. Now, sometimes, when displaying the Admin Modify.html page for
user 11388 I am really seeing the page for 9304, like it is still seeing
and displaying the effective user from the previous merge. This effect
seems to go away after several minutes so I wonder if it has something
to do with old merge data stored in cache somewhere.

> You should find RT-Extension-MergeUsers-0.04_01 on a cpan mirror near
> you sometime over the weekend.
>
> -kevin
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
--
/------------------------------------------------------------------\
| Jason A. Smith Email: smithj4[at]bnl.gov |
| Atlas Computing Facility, Bldg. 510M Phone: +1-631-344-4226 |
| Brookhaven National Lab, P.O. Box 5000 Fax: +1-631-344-7616 |
| Upton, NY 11973-5000, U.S.A. |
\------------------------------------------------------------------/
Attachments: smime.p7s (3.81 KB)


falcone at bestpractical

Oct 6, 2009, 3:46 PM

Post #4 of 4 (366 views)
Permalink
Re: [rt-users] MergeUsers extension for RT problem. [In reply to]

On Mon, Oct 05, 2009 at 11:46:00AM -0400, Jason A. Smith wrote:
> On Fri, 2009-10-02 at 20:36 -0400, Kevin Falcone wrote:
> > On Fri, Oct 02, 2009 at 12:14:40PM -0400, Jason A. Smith wrote:

> > > The patch also adds the reverse link, when viewing the user others have
> > > been merged into, their names now link to their modify user page.
> >
> > I didn't take this because the extension should actually load the
> > primary user, even when you load a merged user by Id (and this is the
> > behavior I observed while testing).
>
> Ok, I understand. So is there any way to see the user data from the
> merged user then? Or is this data now irrelevant, except for the name &
> email address which are shown in the merge box, since they are now
> effectively the user they were merged into in terms of privileges?

I am not the original author, but thats how it has always appeared to
work. There is an API for getting the original user object (otherwise
you wouldn't be able to unmerge the user), but that isn't available
from the UI.

When RT tries to load the 'merged' user, it will always end up with
the merged-into user. If you need to merge history of the users, you
probably want Ruslan's RT-Extension-MergeUsersHistory script.

> > > While testing this, it seemed a little flaky. Are there still some
> > > issues or bugs with Real & Effective merged users?
> >
> > I wasn't aware of any, but I did tweak something with the cache that
> > may have been bugging you (I noticed it while testing your patch).
> > I also cleaned up some warnings and rolled 0.04_01
>
> I tested this, and after a merge and unmerge, I still see some odd
> behavior. For example, I merge user 11388 into user 9304, then unmerge
> them. Now, sometimes, when displaying the Admin Modify.html page for
> user 11388 I am really seeing the page for 9304, like it is still seeing
> and displaying the effective user from the previous merge. This effect
> seems to go away after several minutes so I wonder if it has something
> to do with old merge data stored in cache somewhere.

There is a cache, but part of the bugfixes for 0.04_01 was cleaning
the cache on an unmerge. It may need further purging if you can
identify a replication process. Be aware that if you had
merged/unmerged these users with 0.03 they may not have been fully
unmerged and you may need to do what I recommended earlier and go look
in the Attributes table.

-kevin

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.