Skip to content

Commit

Permalink
Add SEO Description to avoid warning (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradystroud authored Jun 10, 2024
1 parent 7bf25ee commit 982dbc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
5 changes: 5 additions & 0 deletions SSW.Rules.AzFuncs/Domain/FrontMatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class FrontMatter
public string Type { get; set; }

[YamlMember(Alias = "archivedreason", ApplyNamingConventions = false)]

public string ArchivedReason { get; set; }

public string Title { get; set; }
Expand All @@ -17,6 +18,10 @@ public class FrontMatter
public List<string> Related { get; set; }
public List<string> Redirects { get; set; }

[YamlMember(Alias = "SeoDescription", ApplyNamingConventions = false)]
public string SeoDescription { get; set; }


public FrontMatter()
{
Authors = new List<Author>();
Expand Down
14 changes: 2 additions & 12 deletions SSW.Rules.AzFuncs/Functions/Widget/UpdateLatestRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public async Task<HttpResponseData> Run(
StartPage = 1
};

_logger.LogInformation("Getting pull requests");

var pullRequests =
await gitHubClient.PullRequest.GetAllForRepository(repositoryOwner, repositoryName, request,
apiOptions);
Expand All @@ -47,7 +45,6 @@ await gitHubClient.PullRequest.GetAllForRepository(repositoryOwner, repositoryNa
throw new Exception("No Pull Requests found");
}

_logger.LogInformation("Getting sync history hash");
var syncHistoryHash = await context.SyncHistory.GetAll();
var existingCommitHashes = new HashSet<string>(syncHistoryHash.Select(sh => sh.CommitHash));
HttpClient httpClient = new HttpClient();
Expand All @@ -60,18 +57,11 @@ await gitHubClient.PullRequest.GetAllForRepository(repositoryOwner, repositoryNa
_logger.LogInformation($"Scanning PR {pr.Number}");
if (existingCommitHashes.Contains(pr.MergeCommitSha)) break;
if (!pr.Merged) continue;
_logger.LogInformation($"PR {pr.Number} - changed files {pr.ChangedFiles}");
_logger.LogInformation($"Too big? {pr.ChangedFiles > 100}");
if (pr.ChangedFiles > 100) // Skips big PRs as these will fail
{
_logger.LogInformation($"Skipping PR {pr.Number}");
continue;
};

var files = await gitHubClient.PullRequest.Files(repositoryOwner, repositoryName, pr.Number);
if (files.Count > 100) // Skips big PRs as these will fail
if (files.Count > 100) // Skips big PRs as these will fail https://github.com/SSWConsulting/SSW.Rules/issues/1367
{
_logger.LogInformation($"Skipping PR {pr.Number} (2nd check)");
_logger.LogInformation($"Skipping PR {pr.Number} because there are too many files changed");
continue;
};

Expand Down

0 comments on commit 982dbc5

Please sign in to comment.