Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelldi committed Oct 1, 2024
1 parent d6f842b commit 904b0eb
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 854 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ syntax = "proto3";

package aspire.v1;

option csharp_namespace = "Aspire.ResourceService.Proto.V1";

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

Expand Down Expand Up @@ -40,7 +42,7 @@ message ResourceCommand {

// Represents a request to execute a command.
// Sent by the dashboard to DashboardService.ExecuteResourceCommand.
// Constructed with data from a corresponding
// Constructed with data from a corresponding ResourceCommand.
message ResourceCommandRequest {
// Unique identifier for the command.
// Copied from the ResourceCommand that this request object is initialized from.
Expand Down Expand Up @@ -97,17 +99,6 @@ message EnvironmentVariable {
bool is_from_spec = 3;
}

message Endpoint {
string endpoint_url = 1;
string proxy_url = 2;
}

message Service {
string name = 1;
optional string allocated_address = 2;
optional int32 allocated_port = 3;
}

message Url {
// The name of the url
string name = 1;
Expand All @@ -130,6 +121,7 @@ message ResourceProperty {

// Models the full state of an resource (container, executable, project, etc) at a particular point in time.
message Resource {
reserved 8, 9, 10;
string name = 1;
string resource_type = 2;
string display_name = 3;
Expand All @@ -138,11 +130,6 @@ message Resource {
optional google.protobuf.Timestamp created_at = 6;
repeated EnvironmentVariable environment = 7;

// Deprecated and replaced with urls
optional int32 expected_endpoints_count = 8 [deprecated = true];
repeated Endpoint endpoints = 9 [deprecated = true];
repeated Service services = 10 [deprecated = true];

repeated ResourceCommand commands = 11;

// Properties holding data not modeled directly on the message.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Globalization;
using Aspire.V1;
using Aspire.ResourceService.Proto.V1;
using AspireSessionHost.Generated;
using Google.Protobuf.WellKnownTypes;
using ResourceProperty = AspireSessionHost.Generated.ResourceProperty;
Expand Down Expand Up @@ -50,7 +50,7 @@ internal static class ResourceExtensions
_ => ResourceStateStyle.Unknown
};

private static ResourceProperty ToModel(this Aspire.V1.ResourceProperty property) => new(
private static ResourceProperty ToModel(this Aspire.ResourceService.Proto.V1.ResourceProperty property) => new(
property.Name,
property.HasDisplayName ? property.DisplayName : null,
GetStringValue(property.Value)
Expand Down Expand Up @@ -81,7 +81,7 @@ internal static class ResourceExtensions
return value.ToString();
}

private static ResourceEnvironmentVariable ToModel(this Aspire.V1.EnvironmentVariable variable) => new(
private static ResourceEnvironmentVariable ToModel(this EnvironmentVariable variable) => new(
variable.Name,
variable.HasValue ? variable.Value : null
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Aspire.V1;
using Aspire.ResourceService.Proto.V1;
using AspireSessionHost.Generated;
using Grpc.Core;
using JetBrains.Collections.Viewable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Aspire.V1;
using Aspire.ResourceService.Proto.V1;
using AspireSessionHost.Generated;
using Grpc.Core;
using JetBrains.Lifetimes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Aspire.V1;
using Aspire.ResourceService.Proto.V1;
using Grpc.Core;
using Grpc.Net.Client.Configuration;
using Polly;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ class DummyMySqlConnectionString(project: Project, properties: List<RdConnection
get() = get(Property.Database)
set(value) = set(Property.Database, value)

@Suppress("MemberVisibilityCanBePrivate")
var username: String?
get() = get(Property.Username)
set(value) = set(Property.Username, value)

@Suppress("MemberVisibilityCanBePrivate")
var password: String?
get() = get(Property.Password)
set(value) = set(Property.Password, value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.jetbrains.rider.plugins.appender.database.jdbcToConnectionString.shar
import com.jetbrains.rider.plugins.appender.database.jdbcToConnectionString.shared.converters.ConverterBase
import com.jetbrains.rider.plugins.appender.database.jdbcToConnectionString.shared.jdbcUrls.JdbcUrl

class DummyMySqlConverter(private val project: Project) :
class DummyMySqlConverter(@Suppress("unused") private val project: Project) :
ConverterBase<DummyMySqlConnectionString, DummyMySqlJdbcUrl>() {

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class DummyMySqlJdbcUrl(properties: Collection<DriverPropertyInfo>) : JdbcUrl(pr
return false
}

@Suppress("MemberVisibilityCanBePrivate")
var serverName
get() = get(Property.Server)
set(value) = set(Property.Server, value)
Expand All @@ -53,10 +54,12 @@ class DummyMySqlJdbcUrl(properties: Collection<DriverPropertyInfo>) : JdbcUrl(pr
get() = get(Property.Database)
set(value) = set(Property.Database, value)

@Suppress("MemberVisibilityCanBePrivate")
var user
get() = get(Property.User)
set(value) = set(Property.User, value)

@Suppress("MemberVisibilityCanBePrivate")
var password
get() = get(Property.Password)
set(value) = set(Property.Password, value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ fun saveRunConfiguration(
runConfigurationName: String,
aspireHostLifetimeDefinition: LifetimeDefinition
) {
AspireHostRunManager.Companion.getInstance(project)
AspireHostRunManager
.getInstance(project)
.saveRunConfiguration(aspireHostProjectPath, aspireHostLifetimeDefinition, runConfigurationName)
}

Expand All @@ -97,7 +98,8 @@ suspend fun startSessionHostAndSubscribe(
.syncPublisher(AspireSessionHostListener.TOPIC)
.modelCreated(config.aspireHostProjectPath, sessionHostModel, config.aspireHostLifetime)

SessionHostManager.Companion.getInstance(project)
SessionHostManager
.getInstance(project)
.startSessionHost(config, protocol.wire.serverPort, sessionHostModel)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class AspireResource(
private set
var state: ResourceState?
private set
@Suppress("MemberVisibilityCanBePrivate")
var stateStyle: ResourceStateStyle?
private set
var urls: Array<ResourceUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ abstract class BaseProjectSessionProcessLauncher : SessionProcessLauncherExtensi
aspireHostProjectPath: Path?
): RunProfile

protected suspend fun getDotNetExecutable(
private suspend fun getDotNetExecutable(
sessionModel: SessionModel,
hostRunConfiguration: AspireHostConfiguration?,
addBrowserAction: Boolean,
Expand All @@ -171,7 +171,7 @@ abstract class BaseProjectSessionProcessLauncher : SessionProcessLauncherExtensi
return executable
}

protected fun getDotNetRuntime(executable: DotNetExecutable, project: Project): DotNetCoreRuntime? {
private fun getDotNetRuntime(executable: DotNetExecutable, project: Project): DotNetCoreRuntime? {
val runtime = DotNetRuntime.detectRuntimeForProject(
project,
RunnableProjectKinds.DotNetCore,
Expand All @@ -187,7 +187,7 @@ abstract class BaseProjectSessionProcessLauncher : SessionProcessLauncherExtensi
return runtime
}

protected suspend fun enableHotReload(
private suspend fun enableHotReload(
executable: DotNetExecutable,
sessionProjectPath: Path,
launchProfile: String?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:OptIn(ExperimentalCoroutinesApi::class)

package com.jetbrains.rider.aspire.sessionHost.wasmHost

import com.intellij.execution.CantRunException
Expand Down

0 comments on commit 904b0eb

Please sign in to comment.