Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item14340: Remove debugging.
Comment out the debugging.   Probably the bug was in the map table
search which was coded to require that all 3 parts match - name, email
and userid.  Reverted that change and added an entry to the Git User Map
topic.

Bump the version.
  • Loading branch information
gac410 committed Apr 12, 2017
1 parent 78daee2 commit c51ccc5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/Foswiki/Plugins/FoswikiOrgPlugin.pm
Expand Up @@ -9,8 +9,8 @@ use Foswiki::Func;

use constant TRACE => 1;

our $VERSION = '1.05';
our $RELEASE = '13 Mar 2017';
our $VERSION = '1.06';
our $RELEASE = '11 Apr 2017';
our $SHORTDESCRIPTION =
'Adds github WebHook and other utility functions for foswiki.org';
our $NO_PREFS_IN_TOPIC = 1;
Expand Down
24 changes: 10 additions & 14 deletions lib/Foswiki/Plugins/FoswikiOrgPlugin/Core.pm
Expand Up @@ -81,7 +81,6 @@ sub _githubPush {
_sendResponse( $response, 403,
'ERROR: (403) Invalid REST invocation: X-Hub-Signature does not match payload signature, request forbidden'
);
use Data::Dumper;
Foswiki::Plugins::FoswikiOrgPlugin::writeDebug(
Data::Dumper::Dumper( \$query ) );
return undef;
Expand All @@ -103,7 +102,6 @@ sub _processValidatedPayload {
_sendResponse( $response, 400,
'ERROR: (400) Invalid REST invocation: Unable to decode JSON from the POSTDATA, request rejected.'
);
use Data::Dumper;
Foswiki::Plugins::FoswikiOrgPlugin::writeDebug(
Data::Dumper::Dumper( \$query ) );
return undef;
Expand All @@ -121,7 +119,6 @@ sub _processValidatedPayload {
_sendResponse( $response, 400,
'ERROR: (400) Invalid REST invocation: No git \'ref\' found in message, Unable to determine branch. request rejected..'
);
use Data::Dumper;
Foswiki::Plugins::FoswikiOrgPlugin::writeDebug(
Data::Dumper::Dumper( \$query ) );
return undef;
Expand Down Expand Up @@ -239,19 +236,18 @@ sub _searchMapTable {
( undef, my $maptable ) = Foswiki::Func::readTopic( $web, $topic );
my @map = $maptable =~ m/^\|\s*(.*?)$/msg;

print STDERR "Map Table " . Data::Dumper::Dumper( \@map );
#print STDERR "Map Table " . Data::Dumper::Dumper( \@map );

foreach my $row (@map) {

my ( $name, $email, $username, $wikiname ) = split( /\s*\|\s*/, $row );

if (
( $_[0]->{name} && $_[0]->{name} eq $name )
|| ( $_[0]->{username}
&& $_[0]->{username} eq $username )
|| ( $_[0]->{email}
&& $_[0]->{email} eq $email )
)
if ( $_[0]->{name}
&& $_[0]->{name} eq $name
&& $_[0]->{username}
&& $_[0]->{username} eq $username
&& $_[0]->{email}
&& $_[0]->{email} eq $email )
{
my $cUID =
$Foswiki::Plugins::SESSION->{users}
Expand Down Expand Up @@ -355,7 +351,7 @@ sub _findcUID {

# Just try what we have for WikiName,
Foswiki::Plugins::FoswikiOrgPlugin::writeDebug(
"_findcUID: No email match for, using $tryName ");
"_findcUID: No email match for $_[0]->{email}, using $tryName ");
return $Foswiki::Plugins::SESSION->{users}->getCanonicalUserID($tryName);

}
Expand Down Expand Up @@ -428,8 +424,8 @@ sub _updateTask {
}

#DEBUG:
print STDERR Data::Dumper::Dumper( \$commit->{'author'} );
print STDERR Data::Dumper::Dumper( \$commit->{'committer'} );
#print STDERR Data::Dumper::Dumper( \$commit->{'author'} );
#print STDERR Data::Dumper::Dumper( \$commit->{'committer'} );

my $cUID =
_findcUID( $commit->{'author'} )
Expand Down

0 comments on commit c51ccc5

Please sign in to comment.