Table of Contents

Class ProjectService

Namespace
Ando.Server.Services
Assembly
Ando.Server.dll

Implementation of project management operations.

public class ProjectService : IProjectService
Inheritance
ProjectService
Implements
Inherited Members

Constructors

ProjectService(AndoDbContext, IEncryptionService, IRequiredSecretsDetector, IProfileDetector, ILogger<ProjectService>)

public ProjectService(AndoDbContext db, IEncryptionService encryption, IRequiredSecretsDetector secretsDetector, IProfileDetector profileDetector, ILogger<ProjectService> logger)

Parameters

db AndoDbContext
encryption IEncryptionService
secretsDetector IRequiredSecretsDetector
profileDetector IProfileDetector
logger ILogger<ProjectService>

Methods

CreateProjectAsync(int, long, string, string, string, long?)

Creates a new project.

public Task<Project> CreateProjectAsync(int ownerId, long gitHubRepoId, string repoFullName, string repoUrl, string defaultBranch, long? installationId = null)

Parameters

ownerId int
gitHubRepoId long
repoFullName string
repoUrl string
defaultBranch string
installationId long?

Returns

Task<Project>

DeleteProjectAsync(int)

Deletes a project and all associated data.

public Task<bool> DeleteProjectAsync(int projectId)

Parameters

projectId int

Returns

Task<bool>

DeleteSecretAsync(int, string)

Deletes a secret from a project.

public Task<bool> DeleteSecretAsync(int projectId, string name)

Parameters

projectId int
name string

Returns

Task<bool>

DetectAndUpdateProfilesAsync(int)

Updates the available profiles list for a project by detecting them from the build script.

public Task<IReadOnlyList<string>> DetectAndUpdateProfilesAsync(int projectId)

Parameters

projectId int

Project ID.

Returns

Task<IReadOnlyList<string>>

The list of detected available profiles.

DetectAndUpdateRequiredSecretsAsync(int)

Updates the required secrets list for a project by detecting them from the build script.

public Task<IReadOnlyList<string>> DetectAndUpdateRequiredSecretsAsync(int projectId)

Parameters

projectId int

Project ID.

Returns

Task<IReadOnlyList<string>>

The list of detected required secrets.

GetProjectAsync(int)

Gets a project by ID.

public Task<Project?> GetProjectAsync(int projectId)

Parameters

projectId int

Returns

Task<Project>

GetProjectForUserAsync(int, int)

Gets a project by ID, verifying ownership.

public Task<Project?> GetProjectForUserAsync(int projectId, int userId)

Parameters

projectId int
userId int

Returns

Task<Project>

GetProjectsForUserAsync(int)

Gets all projects for a user.

public Task<IReadOnlyList<Project>> GetProjectsForUserAsync(int userId)

Parameters

userId int

Returns

Task<IReadOnlyList<Project>>

GetSecretNamesAsync(int)

Gets secret names (not values) for a project.

public Task<IReadOnlyList<string>> GetSecretNamesAsync(int projectId)

Parameters

projectId int

Returns

Task<IReadOnlyList<string>>

SetSecretAsync(int, string, string)

Sets or updates a secret for a project.

public Task SetSecretAsync(int projectId, string name, string value)

Parameters

projectId int
name string
value string

Returns

Task

UpdateProjectSettingsAsync(int, string, bool, int, string?, string?, bool, string?)

Updates project settings. Note: RequiredSecrets and AvailableProfiles are auto-detected from build.csando and not set manually.

public Task<bool> UpdateProjectSettingsAsync(int projectId, string branchFilter, bool enablePrBuilds, int timeoutMinutes, string? dockerImage, string? profile, bool notifyOnFailure, string? notificationEmail)

Parameters

projectId int
branchFilter string
enablePrBuilds bool
timeoutMinutes int
dockerImage string
profile string
notifyOnFailure bool
notificationEmail string

Returns

Task<bool>