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

Fix seq trailing slash, respect cancellation token, make SeqOptions.ApiKey nullable #1304

Merged
merged 13 commits into from
Jun 27, 2022

Conversation

MrSmoke
Copy link
Contributor

@MrSmoke MrSmoke commented Jun 23, 2022

What this PR does / why we need it:

  • Fixes a bug where the Seq publisher does not handle trailing slashes
  • Fixed Seq publisher not respecting the cancellation token
  • Throw exception on null/empty endpoint in SeqOptions
  • SeqOptions.ApiKey is now nullable to handle cases where no api key is required
  • Fixed seq_publisher_registration_should.add_healthcheck_when_properly_configured options configured incorrectly

Which issue(s) this PR fixes:
#1171

Special notes for your reviewer:

Does this PR introduce a user-facing change?:
No

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Unit tests passing
  • End-to-end tests passing
  • Extended the documentation
  • Provided sample for the feature

@@ -6,7 +6,7 @@ public class SeqOptions
{
public string Endpoint { get; set; } = null!;

public string ApiKey { get; set; } = null!;
public string? ApiKey { get; set; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look at the official API client for seq and it seems that the ApiKey can be null so it probably makes sense for it to be null here too?

https://github.com/datalust/seq-api/blob/dev/src/Seq.Api/Client/SeqApiClient.cs#L75=

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@@ -9,12 +9,11 @@ public void add_healthcheck_when_properly_configured()
services
.AddHealthChecks()
.AddSeqPublisher(setup =>
new SeqOptions()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 funny test fix

@sungam3r sungam3r changed the title Fix seq trailing slash Fix seq trailing slash, respect cancellation token, make SeqOptions.ApiKey nullable Jun 26, 2022
Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants