Skip to content

Commit

Permalink
Avoid sending unnecessary build error notifications
Browse files Browse the repository at this point in the history
Only send error notifications if the last build wasn't
already an error.
  • Loading branch information
slluis committed Apr 9, 2013
1 parent 64a5762 commit e500678
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cydin/Cydin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@
<Folder Include="WebService\" />
<Folder Include="Views\SiteAdmin\" />
<Folder Include="Views\Admin\" />
<Folder Include="Views\Admin\" />
<Folder Include="Views\SiteHome\" />
<Folder Include="Models\" />
</ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions Cydin/Models/SourceTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public class SourceTag

[DataMember]
public string Status { get; set; }

[DataMember]
public string LastStatus { get; set; }

[DataMember]
public string Url { get; set; }
Expand Down
9 changes: 8 additions & 1 deletion Cydin/Models/UserModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,15 @@ public void BindDownloadInfo (Release rel)

public void SetSourceTagStatus (SourceTag stag, string status)
{
bool statusChanged = stag.Status != status;
bool statusChanged = false;
stag.Status = status;

if (status != SourceTagStatus.Building && status != SourceTagStatus.Fetching && status != SourceTagStatus.Waiting) {
// A final status
statusChanged = stag.LastStatus != status;
stag.LastStatus = status;
}

stag.BuildDate = DateTime.Now;
db.UpdateObject (stag);

Expand Down
3 changes: 2 additions & 1 deletion Cydin/Views/Admin/ProjectsList.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
<%@ Import Namespace="Cydin.Builder" %>
<%@ Import Namespace="Cydin.Properties" %>
<%@ Import Namespace="Cydin.Models" %>
<%@ Import Namespace="System.Linq" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<body>

<table>
<tr><th>Project</th><th>Owner</th><th>Sources</th><th>Releases</th><th>Downloads</th></tr>
<% foreach (Project p in CurrentUserModel.GetProjects ()) { %>
<% foreach (Project p in CurrentUserModel.GetProjects ().OrderBy (p => p.Name)) { %>
<tr>
<td><%=Html.ActionLink (p.Name, "Index", "Project", new { id = p.Id }, null)%></td>
<td>
Expand Down
1 change: 1 addition & 0 deletions db/create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ CREATE TABLE `SourceTag` (
`DevStatus` int(11) NOT NULL DEFAULT '0',
`AddinId` varchar(300) DEFAULT NULL,
`BuildDate` datetime DEFAULT NULL,
`LastStatus` varchar(20) DEFAULT NULL,
PRIMARY KEY (`Id`),
KEY `new_fk_constraint_st_project` (`ProjectId`),
KEY `new_fk_constraint_st_source` (`SourceId`),
Expand Down

0 comments on commit e500678

Please sign in to comment.