Skip to content

Commit

Permalink
(#995) Remove Gitter usage
Browse files Browse the repository at this point in the history
Gitter was acquired by Element back in 2020:

https://matrix.org/blog/2020/09/30/welcoming-gitter-to-matrix/?ref=blog.gitter.im

And as a result, the Cake.Gitter addin no longer works.  Until there is
an alternative, we need to remove all usage of Gitter from Cake.Recipe.
  • Loading branch information
Jericho authored and gep13 committed May 2, 2024
1 parent 30f4aee commit 69b8c9b
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 85 deletions.
1 change: 0 additions & 1 deletion Source/Cake.Recipe/Content/addins.cake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#addin nuget:?package=Cake.Coverlet&version=2.5.4
#addin nuget:?package=Portable.BouncyCastle&version=1.8.5
#addin nuget:?package=Cake.Email&version=2.0.0&loaddependencies=true
#addin nuget:?package=Cake.Gitter&version=2.0.0
#addin nuget:?package=Cake.Incubator&version=7.0.0
#addin nuget:?package=Cake.Kudu&version=2.0.0
#addin nuget:?package=Cake.MicrosoftTeams&version=2.0.0
Expand Down
5 changes: 0 additions & 5 deletions Source/Cake.Recipe/Content/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ Teardown<BuildVersion>((context, buildVersion) =>
SendMessageToTwitter(string.Format(BuildParameters.TwitterMessage, messageArguments));
}
if (BuildParameters.CanPostToGitter && BuildParameters.ShouldPostToGitter)
{
SendMessageToGitterRoom(string.Format(BuildParameters.GitterMessage, messageArguments));
}
if (BuildParameters.CanPostToMicrosoftTeams && BuildParameters.ShouldPostToMicrosoftTeams)
{
SendMessageToMicrosoftTeams(string.Format(BuildParameters.MicrosoftTeamsMessage, messageArguments));
Expand Down
19 changes: 0 additions & 19 deletions Source/Cake.Recipe/Content/credentials.cake
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ public class EmailCredentials
}
}

public class GitterCredentials
{
public string Token { get; private set; }
public string RoomId { get; private set; }

public GitterCredentials(string token, string roomId)
{
Token = token;
RoomId = roomId;
}
}

public class SlackCredentials
{
public string Token { get; private set; }
Expand Down Expand Up @@ -175,13 +163,6 @@ public static MicrosoftTeamsCredentials GetMicrosoftTeamsCredentials(ICakeContex
context.EnvironmentVariable(Environment.MicrosoftTeamsWebHookUrlVariable));
}

public static GitterCredentials GetGitterCredentials(ICakeContext context)
{
return new GitterCredentials(
context.EnvironmentVariable(Environment.GitterTokenVariable),
context.EnvironmentVariable(Environment.GitterRoomIdVariable));
}

public static SlackCredentials GetSlackCredentials(ICakeContext context)
{
return new SlackCredentials(
Expand Down
6 changes: 0 additions & 6 deletions Source/Cake.Recipe/Content/environment.cake
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
public static class Environment
{
public static string GithubTokenVariable { get; private set; }
public static string GitterTokenVariable { get; private set; }
public static string GitterRoomIdVariable { get; private set; }
public static string SlackTokenVariable { get; private set; }
public static string SlackChannelVariable { get; private set; }
public static string TwitterConsumerKeyVariable { get; private set; }
Expand All @@ -25,8 +23,6 @@ public static class Environment

public static void SetVariableNames(
string githubTokenVariable = null,
string gitterTokenVariable = null,
string gitterRoomIdVariable = null,
string slackTokenVariable = null,
string slackChannelVariable = null,
string twitterConsumerKeyVariable = null,
Expand All @@ -48,8 +44,6 @@ public static class Environment
string wyamDeployBranchVariable = null)
{
GithubTokenVariable = githubTokenVariable ?? "GITHUB_PAT";
GitterTokenVariable = gitterTokenVariable ?? "GITTER_TOKEN";
GitterRoomIdVariable = gitterRoomIdVariable ?? "GITTER_ROOM_ID";
SlackTokenVariable = slackTokenVariable ?? "SLACK_TOKEN";
SlackChannelVariable = slackChannelVariable ?? "SLACK_CHANNEL";
TwitterConsumerKeyVariable = twitterConsumerKeyVariable ?? "TWITTER_CONSUMER_KEY";
Expand Down
29 changes: 0 additions & 29 deletions Source/Cake.Recipe/Content/gitter.cake

This file was deleted.

24 changes: 0 additions & 24 deletions Source/Cake.Recipe/Content/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public enum BranchType

public static class BuildParameters
{
private static string _gitterMessage;
private static string _microsoftTeamsMessage;
private static string _twitterMessage;
private static bool _shouldUseDeterministicBuilds;
Expand Down Expand Up @@ -60,12 +59,6 @@ public static class BuildParameters
get { return "Version {0} of the {1} Addin has just been released, this will be available here https://www.nuget.org/packages/{1}, once package indexing is complete."; }
}

public static string GitterMessage
{
get { return _gitterMessage ?? "@/all " + StandardMessage; }
set { _gitterMessage = value; }
}

public static string MicrosoftTeamsMessage
{
get { return _microsoftTeamsMessage ?? StandardMessage; }
Expand All @@ -81,7 +74,6 @@ public static class BuildParameters
public static GitHubCredentials GitHub { get; private set; }
public static MicrosoftTeamsCredentials MicrosoftTeams { get; private set; }
public static EmailCredentials Email { get; private set; }
public static GitterCredentials Gitter { get; private set; }
public static SlackCredentials Slack { get; private set; }
public static TwitterCredentials Twitter { get; private set; }
public static AppVeyorCredentials AppVeyor { get; private set; }
Expand All @@ -108,7 +100,6 @@ public static class BuildParameters
public static int TransifexPullPercentage { get; private set; }

public static bool ShouldBuildNugetSourcePackage { get; private set; }
public static bool ShouldPostToGitter { get; private set; }
public static bool ShouldPostToSlack { get; private set; }
public static bool ShouldPostToTwitter { get; private set; }
public static bool ShouldPostToMicrosoftTeams { get; private set; }
Expand Down Expand Up @@ -180,15 +171,6 @@ public static class BuildParameters
}
}

public static bool CanPostToGitter
{
get
{
return !string.IsNullOrEmpty(BuildParameters.Gitter.Token) &&
!string.IsNullOrEmpty(BuildParameters.Gitter.RoomId);
}
}

public static bool CanPostToSlack
{
get
Expand Down Expand Up @@ -287,7 +269,6 @@ public static class BuildParameters
context.Information("BranchType: {0}", BranchType);
context.Information("TreatWarningsAsErrors: {0}", TreatWarningsAsErrors);
context.Information("ShouldSendEmail: {0}", ShouldSendEmail);
context.Information("ShouldPostToGitter: {0}", ShouldPostToGitter);
context.Information("ShouldPostToSlack: {0}", ShouldPostToSlack);
context.Information("ShouldPostToTwitter: {0}", ShouldPostToTwitter);
context.Information("ShouldPostToMicrosoftTeams: {0}", ShouldPostToMicrosoftTeams);
Expand Down Expand Up @@ -353,7 +334,6 @@ public static class BuildParameters
string repositoryName = null,
string appVeyorAccountName = null,
string appVeyorProjectSlug = null,
bool shouldPostToGitter = true,
bool shouldPostToSlack = true,
bool shouldPostToTwitter = true,
bool shouldPostToMicrosoftTeams = false,
Expand All @@ -380,7 +360,6 @@ public static class BuildParameters
bool? transifexEnabled = null,
TransifexMode transifexPullMode = TransifexMode.OnlyTranslated,
int transifexPullPercentage = 60,
string gitterMessage = null,
string microsoftTeamsMessage = null,
string twitterMessage = null,
DirectoryPath wyamRootDirectoryPath = null,
Expand Down Expand Up @@ -445,7 +424,6 @@ public static class BuildParameters
TransifexPullMode = transifexPullMode;
TransifexPullPercentage = transifexPullPercentage;

GitterMessage = gitterMessage;
MicrosoftTeamsMessage = microsoftTeamsMessage;
TwitterMessage = twitterMessage;

Expand All @@ -459,7 +437,6 @@ public static class BuildParameters
WebLinkRoot = webLinkRoot ?? RepositoryName;
WebBaseEditUrl = webBaseEditUrl ?? string.Format("https://github.com/{0}/{1}/tree/{2}/docs/input/", repositoryOwner, RepositoryName, developBranchName);

ShouldPostToGitter = shouldPostToGitter;
ShouldPostToSlack = shouldPostToSlack;
ShouldPostToTwitter = shouldPostToTwitter;
ShouldPostToMicrosoftTeams = shouldPostToMicrosoftTeams;
Expand Down Expand Up @@ -606,7 +583,6 @@ public static class BuildParameters
GitHub = GetGitHubCredentials(context);
MicrosoftTeams = GetMicrosoftTeamsCredentials(context);
Email = GetEmailCredentials(context);
Gitter = GetGitterCredentials(context);
Slack = GetSlackCredentials(context);
Twitter = GetTwitterCredentials(context);
AppVeyor = GetAppVeyorCredentials(context);
Expand Down
1 change: 0 additions & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ BuildParameters.SetParameters(context: Context,
shouldRunCoveralls: false,
shouldRunCodecov: false,
shouldRunDotNetCorePack: true,
gitterMessage: "@/all " + standardNotificationMessage,
twitterMessage: standardNotificationMessage);

BuildParameters.PrintParameters(Context);
Expand Down

0 comments on commit 69b8c9b

Please sign in to comment.