Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Version 0.5.3 Release (#149)
Browse files Browse the repository at this point in the history
* Upgrade to GitHub-native Dependabot (#138)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Akka from 1.4.18 to 1.4.19 (#137)

Bumps [Akka](https://github.com/akkadotnet/akka.net) from 1.4.18 to 1.4.19.
- [Release notes](https://github.com/akkadotnet/akka.net/releases)
- [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md)
- [Commits](akkadotnet/akka.net@1.4.18...1.4.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Petabridge.Cmd.Cluster from 0.8.3 to 0.8.5 (#142)

Bumps Petabridge.Cmd.Cluster from 0.8.3 to 0.8.5.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Fix ListParser, closing square bracket and EOL isn't parsed correctly. (#147)

* Bump Akka from 1.4.19 to 1.4.21 (#146)

Bumps [Akka](https://github.com/akkadotnet/akka.net) from 1.4.19 to 1.4.21.
- [Release notes](https://github.com/akkadotnet/akka.net/releases)
- [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md)
- [Commits](akkadotnet/akka.net@1.4.19...1.4.21)

---
updated-dependencies:
- dependency-name: Akka
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump Petabridge.Cmd.Remote from 0.8.3 to 0.8.5 (#143)

Bumps Petabridge.Cmd.Remote from 0.8.3 to 0.8.5.

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump Microsoft.NET.Test.Sdk from 16.9.4 to 16.10.0 (#145)

Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.9.4 to 16.10.0.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](microsoft/vstest@v16.9.4...v16.10.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update RELEASE_NOTES.md for 0.5.3 release (#148)

* Update RELEASE_NOTES.md for 0.5.3 release

* Add Petabridge.cmd update to release note

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 17, 2021
2 parents fc90e34 + ff29ecd commit bae0792
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: Akka
versions:
- 1.4.16
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#### 0.5.3 June 17 2021 ####
* Upgraded to [Akka.NET v1.4.21](https://github.com/akkadotnet/akka.net/releases/tag/1.4.21)
* Upgraded [Petabridge.cmd to 0.8.5](https://github.com/petabridge/petabridge.cmd/releases/tag/0.8.5)
* [Fixed: CLUSTER_SEED environment variable with square brackets isn't parsed properly](https://github.com/petabridge/akkadotnet-bootstrap/pull/147)

#### 0.5.2 April 09 2021 ####
* [Fixed: Quoting CLUSTER_SEEDS list randomly breaks Akka.Cluster formation](https://github.com/petabridge/akkadotnet-bootstrap/issues/134)
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Petabridge.Cmd.Cluster" Version="0.8.3" />
<PackageReference Include="Petabridge.Cmd.Remote" Version="0.8.3" />
<PackageReference Include="Petabridge.Cmd.Cluster" Version="0.8.5" />
<PackageReference Include="Petabridge.Cmd.Remote" Version="0.8.5" />
</ItemGroup>

<ItemGroup>
Expand Down
67 changes: 67 additions & 0 deletions src/Akka.Bootstrap.Docker.Tests/DockerBootstrapSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,73 @@ public void ShouldStartIfValidSeedNodesIfSupplied_Hardcoded(string seedNodes, st
}
}

[Theory]
[InlineData("[]", new string[0])]
[InlineData(
"[akka.tcp://MySys@localhost:9140]",
new[]{"akka.tcp://MySys@localhost:9140"})]
[InlineData(
"[akka.tcp://MySys@localhost:9140, akka.tcp://MySys@localhost:9141]",
new[]{"akka.tcp://MySys@localhost:9140",
"akka.tcp://MySys@localhost:9141"})]
[InlineData(
"[akka.tcp://MySys@localhost:9140, akka.tcp://MySys@localhost:9141, akka.tcp://MySys@localhost:9142]",
new[]{"akka.tcp://MySys@localhost:9140",
"akka.tcp://MySys@localhost:9141",
"akka.tcp://MySys@localhost:9142"})]
// The whole line is quoted
[InlineData(
"[\"akka.tcp://MySys@localhost:9140, akka.tcp://MySys@localhost:9141, akka.tcp://MySys@localhost:9142\"]",
new[]{"akka.tcp://MySys@localhost:9140",
"akka.tcp://MySys@localhost:9141",
"akka.tcp://MySys@localhost:9142"})]
// The whole line is quoted with arbitrary whitespaces
[InlineData(
"[ \"akka.tcp://MySys@localhost:9140, akka.tcp://MySys@localhost:9141, akka.tcp://MySys@localhost:9142 \" ]",
new[]{"akka.tcp://MySys@localhost:9140",
"akka.tcp://MySys@localhost:9141",
"akka.tcp://MySys@localhost:9142"})]
// Every item is quoted
[InlineData(
"[\"akka.tcp://MySys@localhost:9140\", \"akka.tcp://MySys@localhost:9141\", \"akka.tcp://MySys@localhost:9142\"]",
new[]{"akka.tcp://MySys@localhost:9140",
"akka.tcp://MySys@localhost:9141",
"akka.tcp://MySys@localhost:9142"})]
// Only one item is quoted
[InlineData(
"[\"akka.tcp://MySys@localhost:9140\", akka.tcp://MySys@localhost:9141, akka.tcp://MySys@localhost:9142]",
new[]{"akka.tcp://MySys@localhost:9140",
"akka.tcp://MySys@localhost:9141",
"akka.tcp://MySys@localhost:9142"})]
// Only one item is quoted
[InlineData(
"[akka.tcp://MySys@localhost:9140, \"akka.tcp://MySys@localhost:9141\", akka.tcp://MySys@localhost:9142]",
new[]{"akka.tcp://MySys@localhost:9140",
"akka.tcp://MySys@localhost:9141",
"akka.tcp://MySys@localhost:9142"})]
// Only one item is quoted
[InlineData(
"[akka.tcp://MySys@localhost:9140, akka.tcp://MySys@localhost:9141, \"akka.tcp://MySys@localhost:9142\"]",
new[]{"akka.tcp://MySys@localhost:9140",
"akka.tcp://MySys@localhost:9141",
"akka.tcp://MySys@localhost:9142"})]
public void ShouldStartIfValidSeedNodesIfSuppliedInArrayFormat(string seedNodes, string[] expected)
{
try
{
Environment.SetEnvironmentVariable("CLUSTER_SEEDS", seedNodes, EnvironmentVariableTarget.Process);
var myConfig = ConfigurationFactory.Empty.BootstrapFromDocker();
myConfig.HasPath("akka.cluster.seed-nodes").Should().BeTrue();
var seeds = myConfig.GetStringList("akka.cluster.seed-nodes").Select(x => x.Trim());
seeds.Should().BeEquivalentTo(expected);
}
finally
{
// clean the environment variable up afterwards
Environment.SetEnvironmentVariable("CLUSTER_SEEDS", null);
}
}

[Fact]
public void ShouldStartIfValidSeedNodesIsSuppliedInIndexedFormat()
{
Expand Down
21 changes: 19 additions & 2 deletions src/Akka.Bootstrap.Docker/EnvironmentVariableConfigLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,29 @@ private static IEnumerable<EnvironmentVariableConfigEntrySource> GetEnvironmentV
if (isList)
{
value = value.Trim();
var values = new ListParser().Parse(value).ToArray();

string[] values;
try
{
values = new ListParser().Parse(value).ToArray();
}
catch (Exception e)
{
throw new ConfigurationException($"Failed to parse list value [{value}]", e);
}

if (values.Length == 1)
{
// if the parser only returns a single value,
// we might have a quoted environment variable
values = new ListParser().Parse(values[0]).ToArray();
try
{
values = new ListParser().Parse(values[0]).ToArray();
}
catch (Exception e)
{
throw new ConfigurationException($"Failed to parse list value [{values[0]}]", e);
}
}

// always assume that string needs to be quoted
Expand Down
3 changes: 2 additions & 1 deletion src/Akka.Bootstrap.Docker/ListParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private void ParseToken()
_state = TokenizerState.AfterComma;
// consume it and go on
Consume();
ConsumeConsecutiveWhiteSpaces();
break;
}

Expand All @@ -133,7 +134,7 @@ private void ParseToken()
Consume();
ConsumeConsecutiveWhiteSpaces();
Peek(out eol);
if (!eol || _state != TokenizerState.AfterComma || _state != TokenizerState.EndOfString)
if (!eol || (_state != TokenizerState.AfterComma && _state != TokenizerState.EndOfString))
throw new ConfigurationException(
$"Closing square brackets can only appear once at the end of the environment variable value. Position: [{bracketPosition}]");
break;
Expand Down
4 changes: 2 additions & 2 deletions src/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.4.1</XunitVersion>
<TestSdkVersion>16.9.4</TestSdkVersion>
<TestSdkVersion>16.10.0</TestSdkVersion>
<NetCoreTestVersion>netcoreapp3.1</NetCoreTestVersion>
<NetStandardVersion>netstandard2.0</NetStandardVersion>
<NetFrameworkTestVersion>net461</NetFrameworkTestVersion>
<AkkaVersion>1.4.18</AkkaVersion>
<AkkaVersion>1.4.21</AkkaVersion>
<SourceLinkVersion>1.0.0</SourceLinkVersion>
</PropertyGroup>
</Project>

0 comments on commit bae0792

Please sign in to comment.