Add Aspire component

Abierto
#125 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp
Área
tooling

Línea de trabajo

Start with the AppHost.Program.cs and ServiceDefaults.Extensions.cs examples in the issue, then review the linked .NET Aspire overview and the existing client integration in this repository. Done means an Aspire component can provide the Flagsmith URL and EnvironmentKey, register FlagsmithClient through DI, and support the database reference and wait behavior described in the issue.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

It would be amazing, if we can have Flagsmith Aspire component.
I can provide some help in development of this aspire component.

Why?

  • There are such requests from the community dotnet/aspire#1570
  • It's the easiest way to start using Flagsmith with .NET
  • Improves Flagsmith adoption across community
  • Adds support for automatic DI registration

How it should look like

// AppHost.Program.cs

var builder = DistributedApplication.CreateBuilder(args);

var flagsmith = builder.AddFlagsmith();

var apiService = builder.AddProject<My_WebApi>("apiservice")
	.WithEnvironment(flagsmith); // Pupulates URL and EnvironmentKey
// ServiceDefaults.Extensions.cs

public static TBuilder AddServiceDefaults<TBuilder>(this TBuilder builder) where TBuilder : IHostApplicationBuilder
{
      builder.AddFlagsmithClient(); // Registers FlagsmithClient into DI with URL and EnvironmentKey
}

Example of configuration with database

// AppHost.Program.cs

var builder = DistributedApplication.CreateBuilder(args);

var postgresServer = builder.AddPostgres("postgresserver")
	// Mount the SQL scripts directory into the container.
	// Init script would create a flagsmith database, becuase Aspire doesn't create DB by default yet.
	.WithContainerName("postgresserver")
	.WithBindMount("../Postgres", "/docker-entrypoint-initdb.d");

var flagsmithDatabase = postgresServer.AddDatabase("flagsmithDatabase", databaseName: "flagsmithdb");

var flagsmith = builder.AddFlagsmith()
	.WithReference(flagsmithDatabase) // Populates DATABASE_URL
	.WaitFor(flagsmithDatabase)

var apiService = builder.AddProject<My_WebApi>("apiservice")
	.WithEnvironment(flagsmith);
Lenguaje dominante
C#
Estrellas
20
Forks
17
Merge medio
21 h 47 min
PR fusionados (30 d)
8

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Flagsmith/flagsmith-dotnet-client

Todos los issues de Flagsmith/flagsmith-dotnet-client

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.