Skip to content

Aggregate Roots

The DevOps / GitOps Platform owns 15 aggregate roots distributed across its six bounded contexts. Each aggregate is the consistency boundary for its data, owns its invariants, and emits domain events in the canonical envelope. Names follow the naming conventions. Persistence is via NHibernate (ConnectSoft.Extensions.PersistenceModel.NHibernate) onto Azure SQL/PostgreSQL unless noted.

Target Architecture — Final-State Design

Field lists are representative of the final-state model; every aggregate carries the cross-cutting tenantId, projectId, and audit fields from the shared kernel.


Repository

  • Purpose — Represents an Azure DevOps Git repository provisioned for a project/module; the durable handle to source.
  • FieldsrepositoryId, tenantId, projectId, moduleId, name, provider, remoteUrl, defaultBranch, visibility, status, createdAt.
  • EntitiesRepositorySetting (policy/config entries), WebhookRegistration.
  • Value ObjectsRepositoryProvider (AzureDevOps | GitHub), Visibility, RemoteUrl.
  • Invariants — name unique per (tenantId, projectId); default branch must exist before commits are accepted; provider is immutable after provisioning.
  • Domain EventsRepositoryProvisioned.
  • RepositoryRepositoryRepository.
  • Persistence — Azure SQL; the Git tree itself lives in Azure DevOps (source of truth).

Branch

  • Purpose — A named branch within a repository, with its base commit and policy bindings.
  • FieldsbranchId, repositoryId, tenantId, name, fromCommitSha, isProtected, status, createdAt.
  • EntitiesBranchPolicyBinding.
  • Value ObjectsBranchName, CommitSha.
  • Invariants — name unique per repository; protected branches require PR + passing checks to update; base commit must exist.
  • Domain EventsBranchCreated.
  • RepositoryBranchRepository.
  • Persistence — Azure SQL; branch refs reconciled with Azure DevOps.

Commit

  • Purpose — A commit authored from generated artifacts, with lineage back to the source artifact.
  • FieldscommitId, repositoryId, tenantId, branch, sha, message, artifactId, authoredBy, treeHash, createdAt.
  • EntitiesFileChange (path + operation).
  • Value ObjectsCommitSha, TreeHash, ArtifactReference.
  • Invariants — message non-empty; at least one file change; sha immutable once committed; artifactId required for lineage.
  • Domain EventsCommitCreated.
  • RepositoryCommitRepository.
  • Persistence — Azure SQL metadata; content in Azure DevOps Git.

PullRequest

  • Purpose — A review and merge workflow between a source and target branch, gated by checks and policy.
  • FieldspullRequestId, repositoryId, tenantId, number, sourceBranch, targetBranch, title, description, status, policyEvaluation, mergeCommitSha, createdAt, mergedAt.
  • EntitiesPullRequestCheck, PullRequestReview, PullRequestComment.
  • Value ObjectsBranchName, PullRequestStatus (Open | Merged | Abandoned), PolicyEvaluation.
  • Invariants — source ≠ target; cannot merge while required checks are pending/failed; merge requires passing policy; status transitions are monotonic.
  • Domain EventsPullRequestOpened, PullRequestMerged.
  • RepositoryPullRequestRepository.
  • Persistence — Azure SQL; merge state reconciled with Azure DevOps.

PipelineDefinition

  • Purpose — A generated YAML CI/CD definition for a module, aligned to ConnectSoft.AzurePipelines templates.
  • FieldspipelineId, repositoryId, tenantId, moduleId, moduleType, definitionPath, templateVersion, targetFeed, status, generatedAt.
  • EntitiesPipelineStage, PipelineVariable.
  • Value ObjectsModuleType, FeedReference, TemplateVersion.
  • Invariants — definition path unique per repository; template version must be a known published version; regeneration supersedes prior definition.
  • Domain EventsPipelineGenerated.
  • RepositoryPipelineDefinitionRepository.
  • Persistence — Azure SQL; YAML committed to the repository.

PipelineRun

  • Purpose — A single execution of a pipeline definition on Azure DevOps.
  • FieldspipelineRunId, pipelineId, tenantId, branch, buildNumber, reason, status, startedAt, finishedAt.
  • EntitiesStageRun, JobRun.
  • Value ObjectsRunReason (ci | manual | release), RunStatus.
  • Invariants — must reference an existing pipeline definition; finishedAt only set in terminal status; status transitions follow Started → InProgress → (Succeeded | Failed | Canceled).
  • Domain EventsPipelineRunStarted.
  • RepositoryPipelineRunRepository.
  • Persistence — Azure SQL; logs streamed to Blob.

BuildResult

  • Purpose — The normalized outcome of a pipeline run — status, test results, coverage, and produced artifacts.
  • FieldsbuildResultId, pipelineRunId, tenantId, moduleId, status, testsPassed, testsFailed, coverage, artifacts, logsUri, completedAt.
  • EntitiesArtifactItem, TestSummary.
  • Value ObjectsBuildStatus, CoveragePercentage, BlobReference.
  • Invariants — one build result per pipeline run; status derived from underlying jobs; artifacts immutable once recorded.
  • Domain EventsBuildCompleted.
  • RepositoryBuildResultRepository.
  • Persistence — Azure SQL metadata; logs/artifacts in Blob.

ReleasePlan

  • Purpose — The plan to ship a specific build to a target environment with a deployment strategy.
  • FieldsreleaseId, tenantId, projectId, moduleId, buildResultId, version, targetEnvironment, strategy, requiredApprovals, status, plannedAt.
  • EntitiesReleaseArtifact, ReleaseStep.
  • Value ObjectsSemanticVersion, EnvironmentName, DeploymentStrategy (RollingUpdate | BlueGreen | Canary).
  • Invariants — references a successful build; version unique per (moduleId, environment); cannot promote until approvals satisfied; strategy valid for target environment.
  • Domain EventsReleasePlanned.
  • RepositoryReleasePlanRepository.
  • Persistence — Azure SQL.

ReleaseApproval

  • Purpose — A recorded approval decision gating a release, enforcing governance and segregation of duties.
  • FieldsapprovalId, releaseId, tenantId, approver, decision, comment, policyResult, decidedAt.
  • EntitiesPolicyCheckResult.
  • Value ObjectsApprovalDecision (Approved | Rejected), ApproverIdentity.
  • Invariants — approver must differ from the planning identity (segregation of duties); decision immutable once recorded; policy must have been evaluated before decision.
  • Domain EventsReleaseApproved.
  • RepositoryReleaseApprovalRepository.
  • Persistence — Azure SQL; surfaced to the Governance Platform audit log.

DeploymentManifest

  • Purpose — The rendered, versioned manifest describing what to deploy and how (Helm/Kustomize values or Pulumi deployment outputs).
  • FieldsmanifestId, releaseId, tenantId, environment, manifestType, contentUri, checksum, version, renderedAt.
  • EntitiesManifestResource.
  • Value ObjectsManifestType (Helm | Kustomize | PulumiOutput), Checksum, BlobReference.
  • Invariants — checksum matches stored content; manifest is immutable once rendered; tied to exactly one release.
  • Domain EventsDeploymentManifestRendered.
  • RepositoryDeploymentManifestRepository.
  • Persistence — Azure SQL metadata; manifest content in Blob and committed to the GitOps repository.

EnvironmentPromotion

  • Purpose — The act of promoting a release from one environment to the next in the path.
  • FieldspromotionId, releaseId, tenantId, fromEnvironment, toEnvironment, strategy, status, promotedBy, promotedAt.
  • EntitiesPromotionStep, HealthGateResult.
  • Value ObjectsEnvironmentName, PromotionStatus.
  • Invariants — environments must follow the configured path (dev → test → staging → prod); promotion requires ReleaseApproved; health gates must pass before completion.
  • Domain EventsDeploymentPromoted.
  • RepositoryEnvironmentPromotionRepository.
  • Persistence — Azure SQL.

PackagePublication

  • Purpose — A NuGet package version published to an Azure Artifacts feed.
  • FieldspublicationId, tenantId, buildResultId, packageId, version, feed, status, publishedAt.
  • EntitiesPackageDependency.
  • Value ObjectsSemanticVersion, FeedReference, PackageId.
  • Invariants(packageId, version, feed) unique; published versions are immutable; references a successful build.
  • Domain EventsPackagePublished.
  • RepositoryPackagePublicationRepository.
  • Persistence — Azure SQL metadata; binaries in Azure Artifacts.

ContainerImage

  • Purpose — A container image built from a module and pushed to Azure Container Registry.
  • FieldsimageId, tenantId, buildResultId, repositoryName, tag, digest, registry, status, builtAt.
  • EntitiesImageLayer, ImageScanResult.
  • Value ObjectsImageDigest, ImageTag, RegistryReference.
  • Invariants — digest unique per registry; tag maps to exactly one digest at publish time; image must pass vulnerability scan before promotion.
  • Domain EventsContainerImageBuilt.
  • RepositoryContainerImageRepository.
  • Persistence — Azure SQL metadata; image layers in ACR.

InfrastructurePlan

  • Purpose — A Pulumi (.NET/C#) infrastructure program and its preview/apply state for an environment stack.
  • FieldsinfrastructurePlanId, tenantId, projectId, environment, engine, stack, program, previewSummary, status, appliedAt.
  • EntitiesResourceChange, StackOutput.
  • Value ObjectsIaCEngine (Pulumi; Bicep legacy), StackName, ChangeSummary.
  • Invariants — engine defaults to Pulumi; apply requires a successful preview; one active apply per stack at a time (lock); drift detection runs before re-apply.
  • Domain EventsInfrastructureProvisioned.
  • RepositoryInfrastructurePlanRepository.
  • Persistence — Azure SQL metadata; Pulumi state in the Pulumi backend (managed/self-hosted) referenced by the plan.

Implementation Notes

IaC is Pulumi authored as .NET/C# programs. Bicep is supported only as a legacy alternative for pre-existing stacks (ConnectSoft.AzureInfrastructure); new infrastructure is authored in Pulumi.

GitOpsSyncState

  • Purpose — The reconciliation state between Git desired state and the running environment.
  • FieldssyncStateId, tenantId, projectId, environment, desiredCommitSha, appliedCommitSha, syncStatus, driftDetected, lastSyncedAt.
  • EntitiesReconciledResource, DriftRecord.
  • Value ObjectsCommitSha, SyncStatus (Synced | OutOfSync | Reconciling | Degraded).
  • Invariants — sync is convergent (repeatable to the same result); appliedCommitSha advances only toward desiredCommitSha; drift triggers reconciliation.
  • Domain EventsGitOpsSynced.
  • RepositoryGitOpsSyncStateRepository.
  • Persistence — Azure SQL; desired state in the GitOps repository.

Pillar Alignment

  • Traceability — every aggregate carries artifactId/buildResultId/releaseId links forming an unbroken chain.
  • GovernanceReleaseApproval and EnvironmentPromotion encode policy and segregation of duties.
  • Multi-tenant scaletenantId + projectId partition every aggregate's store.