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

sanity test failures should mention branch if on quarterly #564

Open
dlangille opened this issue May 6, 2024 · 5 comments
Open

sanity test failures should mention branch if on quarterly #564

dlangille opened this issue May 6, 2024 · 5 comments
Assignees

Comments

@dlangille
Copy link
Contributor

e.g.

----- Original message -----
From: FreshPorts Sanity Daemon
To: you
Subject: FreshPorts sanity checking
Date: Monday, May 06, 2024 4:21 PM

Committer foo would have been notified of errors if they were opted in.

This message was generated by the FreshPorts Daemon.

You recently made this commit, which FreshPorts FreshPorts had trouble 
processing:

MessageID: 2a7abdbccbf9460e6c411c1d67fec4b0e373e8c4
Subject  : 
The following is a list of the ports which had errors:

https://example.org/foo/bar


The exact errors appear below.

foo/bar:

This command (FreshPorts code 1):

/usr/local/bin/sudo /usr/sbin/jexec freshports /make-port.sh /usr/ports
sysutils/slurm-wlm
2>/tmp/FreshPorts.foo.bar.make-error.2024.5.6.20.21.19.75179

produced this error:

Error message is: make: "/usr/ports/foo/bar/Makefile" line
146: Malformed conditional (${ARCH} == powerpc64le)
make: Fatal errors encountered -- cannot continue
Make results are : make: stopped in /usr/ports/foo/bar



You are receiving this message as you are a FreeBSD
committer who has opted into this service.  Please
see https://www.freshports.org/committer-opt-in.php
for more information.

-- 
FreshPorts Daemon
@dlangille
Copy link
Contributor Author

So.. funny thing.. I created a branch for this.... however, the code is [still] in subversion and that makes this branch useless for that.

@dlangille
Copy link
Contributor Author

Looking at xml_munge_git.pm::handle_update_end(), the data we want is in $Updates{branch_git}

@dlangille
Copy link
Contributor Author

Let's see if these changes do the thing.

[11:33 dvl-ingress01 dvl ~/modules] % svn di
Index: committer_opt_in.pm
===================================================================
--- committer_opt_in.pm	(revision 6067)
+++ committer_opt_in.pm	(working copy)
@@ -9,15 +9,19 @@
 
 use FreshPorts::email;
 use FreshPorts::config;
+use FreshPorts::constants;
 use strict;
 
 use Text::Wrap;
 
-$FreshPorts::CommitterOptIn::CommitMessageID  = '';
-$FreshPorts::CommitterOptIn::CommitMessageLog = '';
+$FreshPorts::CommitterOptIn::CommitMessageID      = '';
+$FreshPorts::CommitterOptIn::CommitBranch         = '';
+$FreshPorts::CommitterOptIn::CommitMessageLog     = '';
 $FreshPorts::CommitterOptIn::CommitMessageSubject = '';
-$FreshPorts::CommitterOptIn::Errors           = '';
+$FreshPorts::CommitterOptIn::Errors               = '';
 
+my $CommitBranch;
+
 my %PortList;
 
 sub RecordErrorDetails {
@@ -47,11 +51,16 @@
 	$FreshPorts::CommitterOptIn::CommitMessageSubject .= shift;
 }
 
+# all the Record* functions above append - branch does not.
+sub RecordCommitBranch {
+	$FreshPorts::CommitterOptIn::CommitBranch = shift;
+}
+
 sub CommitterHasOptedIn($;$) {
-	my $committer	= shift;
-	my $dbh			= shift;
+	my $committer = shift;
+	my $dbh       = shift;
 
-	my $OptedIn = 0;
+	my $OptedIn   = 0;
 	my $myrow;
 
 	my $sql = "select committer
@@ -92,8 +101,7 @@
 
 	my $Body = "This message was generated by the FreshPorts Daemon.
 
-You recently made this commit, which FreshPorts FreshPorts had trouble 
-processing:
+You recently made this commit, which FreshPorts had trouble processing:
 
 MessageID: $FreshPorts::CommitterOptIn::CommitMessageID
 ";
@@ -108,12 +116,17 @@
 ";
 	}
 
-	$Body .= "The following is a list of the ports which had errors:
+	$Body .= "\nThe following is a list of the ports which had errors:
 
 ";
 
 	while (my ($Port, $Error) = each %PortList) {
-		$Body .= $FreshPorts::Config::FreshPortsURL . $Port . "/\n";
+		$Body .= $FreshPorts::Config::FreshPortsURL . $Port;
+		# specify the branch, if not HEAD
+		if ($FreshPorts::CommitterOptIn::CommitBranch ne $FreshPorts::Constants::HEAD) {
+			$Body .= '?branch=' . $FreshPorts::CommitterOptIn::CommitBranch;
+		}
+		$Body .= "/\n";
 	}
 
 	$Body .= "\n\nThe exact errors appear below.\n\n";
Index: xml_munge_git.pm
===================================================================
--- xml_munge_git.pm	(revision 6089)
+++ xml_munge_git.pm	(working copy)
@@ -360,6 +360,7 @@
 	#
 	# Record the information which is used during Error Notification.
 	#
+	FreshPorts::CommitterOptIn::RecordCommitMessageID ($Updates{branch_git});
 	FreshPorts::CommitterOptIn::RecordCommitMessageID ($Updates{commit_hash});
 	FreshPorts::CommitterOptIn::RecordCommitMessageLog($Updates{log});
 
@@ -419,7 +420,7 @@
 		if (scalar(keys %CommitLogPorts)) {
 			print "adding that commit date to the daily summary refresh list\n";
 
-		    my $commit_date = sprintf "%04u-%02u-%02u", $Updates{dateyear}, $Updates{datemonth}, $Updates{dateday};
+			my $commit_date = sprintf "%04u-%02u-%02u", $Updates{dateyear}, $Updates{datemonth}, $Updates{dateday};
 
 			FreshPorts::Cache::DailySummaryDateAdd($commit_date, $self->{dbh})
 		} else {
@@ -982,6 +983,10 @@
 	my $committer       = $Updates{committer};
 	my $description     = $Updates{log};
 	my $revision        = $Updates{revision};
+
+	# declare, assign, and never use. Trying to avoid this error by delcaring it:
+	# Name "FreshPorts::XML_Munge_git::rest" used only once: possible typo at xml_munge_git.pm line 990.
+	my $rest;
    
 	# sometimes the committer field looks like: scheidell (ports committer)
 	# this takes the stuff before the first blank and we assume that is the committer id.

@dlangille
Copy link
Contributor Author

Committed revision 6090.

@dlangille
Copy link
Contributor Author

Let's run with this for a while on dvl & dev.

@dlangille dlangille self-assigned this Sep 29, 2024
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

When branches are created from issues, their pull requests are automatically linked.

1 participant