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 using branch=main - not working as expected #602

Open
dlangille opened this issue Nov 1, 2024 · 1 comment
Open

Comments

@dlangille
Copy link
Contributor

dlangille commented Nov 1, 2024

          Let's see if these changes do the thing.

They aren't. They're getting

Commit : 5058ebb5ef38136b5c956ba02758297b51ed2f48
Subject: sysutils/lnav: Mark broken on main

The following is a list of the ports which had errors:

https://dvl.freshports.org/sysutils/lnav/?branch=main

That gives a 404 not found (readers following along at home, that hostname will not resolve for you).

Looking in the database logs, /ports/branches/head/sysutils/lnav' is being referenced.

It should be using /ports/head/sysutils/lnav instead

[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.

Originally posted by @dlangille in #564 (comment)

@dlangille
Copy link
Contributor Author

Fixed with revision 6098 on modules. Not yet in prod. Now on dev. Let's wait for another sanity test failure.

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

No branches or pull requests

1 participant