-
Notifications
You must be signed in to change notification settings - Fork 775
Add WithRedisInsight #5227
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
Add WithRedisInsight #5227
Conversation
|
To pass all tests we need to import |
|
@eerhardt could you please import |
|
|
||
| await pipeline.ExecuteAsync(async (ctx) => | ||
| { | ||
| var response = await client.PostAsync(apiUrl, content, ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only way we can configure Redis Insight? I'm a bit concerned about sending HTTP requests from the AppHost. Can we instead write a file to a bind mount, like other places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFIK there is no way to configure Redis Insight from file. There is some open issue about this redis/RedisInsight#2785.
I could'nt find any better way.
| var testConnectionResponse = await client.GetAsync(getDatabasesApiUrl, cts.Token) | ||
| .ConfigureAwait(false); | ||
| response.EnsureSuccessStatusCode(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fails then it would be useful to throw an exception with the url that failed.
|
Should this be added to the aspire/playground/TestShop/TestShop.AppHost/Program.cs Lines 12 to 15 in 6f0e998
|
I have pushed the image to the netaspireci.azurecr.io registry, but I don't believe the test will pass because we don't have Docker Desktop installed on the CI machines. |
| } | ||
| var connectionFilePath = Path.Combine(connectionFileDirectoryPath, "RedisInsight_connections.json"); | ||
|
|
||
| using (var stream = new FileStream(connectionFilePath, FileMode.OpenOrCreate)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to write this out to a file? Can't we just keep it in memory and then send it via HTTP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that first and it did not work but I'm not sure that I did that right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with @eerhardt. Not sure why this needs to be a file. You just need a MemoryStream.
What can I do for that? |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Yes. I will work on this. |
Co-authored-by: David Fowler <[email protected]>
Co-authored-by: David Fowler <[email protected]>
| MaxRetryAttempts = 10, | ||
| }).Build(); | ||
|
|
||
| await pipeline.ExecuteAsync(async (ct) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to remove this now right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For removing this i think we should use waitfor for Redis Insight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidfowl Redis Insight doesn't log anything useful for using WaitForText so I just used ResourceNotificationService to ensure the resource is running.
Co-authored-by: David Fowler <[email protected]>
Do you want us to use
There is another API to accept the eula: I will use this API to accept the eula. |
| using (var stream = new MemoryStream()) | ||
| { | ||
| using var writer = new Utf8JsonWriter(stream); | ||
|
|
||
| writer.WriteStartObject(); | ||
|
|
||
| writer.WritePropertyName("agreements"); | ||
| writer.WriteStartObject(); | ||
| writer.WriteBoolean("eula", true); | ||
| writer.WriteBoolean("analytics", false); | ||
| writer.WriteBoolean("notifications", false); | ||
| writer.WriteBoolean("encryption", false); | ||
| writer.WriteEndObject(); | ||
|
|
||
| writer.WriteEndObject(); | ||
|
|
||
| await writer.FlushAsync(ct).ConfigureAwait(false); | ||
| stream.Seek(0, SeekOrigin.Begin); | ||
| string json = Encoding.UTF8.GetString(stream.ToArray()); | ||
| var content = new StringContent(json, Encoding.UTF8, "application/json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to write a follow up @Alirexaa, this can be simplified using JsonContent and JsonObject.


Description
In this PR, I Added Redis Insight, a Developer GUI for Redis, by Redis.
by using
WithRedisInsightthe RedisInsight instance starts and imports the Redis connection to this instance via HTTP call.only some unit tests need to include this PR.
Fixes #5165
Checklist
<remarks />and<code />elements on your triple slash comments?WithRedisInsightin Redis docs docs-aspire#1474Microsoft Reviewers: Open in CodeFlow