Migrate diagnostics persistence to Groundwork#660
Draft
sfmskywalker wants to merge 26 commits into
Draft
Conversation
c2a5fdf to
00673a6
Compare
|
|
||
| private async Task<DiagnosticsProviderLease> CreateMongoDbAsync(string databaseName, CancellationToken cancellationToken) | ||
| { | ||
| var client = new MongoClient(_mongoDb.GetConnectionString()); |
| } | ||
|
|
||
| private static string RepositoryPath(string relativePath, [CallerFilePath] string sourceFile = "") => | ||
| Path.GetFullPath(Path.Combine(Path.GetDirectoryName(sourceFile)!, "../../../../..", relativePath)); |
|
|
||
| private async Task<DiagnosticsProviderLease> CreateSqliteAsync(string databaseName, CancellationToken cancellationToken) | ||
| { | ||
| var path = Path.Combine(Path.GetTempPath(), $"{databaseName}.db"); |
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 34806143 | Triggered | Generic Password | f26210a | tests/Elsa/Diagnostics/OpenTelemetry/Persistence/Groundwork/Tests/OpenTelemetryGroundworkStorageSchemaTests.cs | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Comment on lines
+219
to
+224
| foreach (var attribute in attributes) | ||
| { | ||
| var value = Required(attribute, "attribute"); | ||
| if (value.Key is null || !result.TryAdd(value.Key, value.Value)) | ||
| throw new CatalogPayloadException("The OpenTelemetry catalog contains an invalid or duplicate attribute key."); | ||
| } |
Comment on lines
+552
to
+564
| foreach (var value in values) | ||
| { | ||
| var record = map(value); | ||
| if (result.TryGetValue(record.RecordId, out var existing)) | ||
| { | ||
| if (!RecordEquals(existing, record)) | ||
| throw new ArgumentException( | ||
| $"OpenTelemetry record id '{record.RecordId}' identifies conflicting payloads in one batch.", | ||
| nameof(values)); | ||
| continue; | ||
| } | ||
| result.Add(record.RecordId, record); | ||
| } |
Comment on lines
+406
to
+411
| foreach (var attribute in attributes) | ||
| { | ||
| var value = Required(attribute, "attribute"); | ||
| if (value.Key is null || !result.TryAdd(value.Key, value.Value)) | ||
| throw new RecordPayloadException("The OpenTelemetry record contains an invalid or duplicate attribute key."); | ||
| } |
Comment on lines
+12
to
+14
| private readonly string _databasePath = Path.Combine( | ||
| Path.GetTempPath(), | ||
| $"elsa-open-telemetry-{Guid.NewGuid():N}.db"); |
Comment on lines
+36
to
+38
| private readonly string _databasePath = Path.Combine( | ||
| Path.GetTempPath(), | ||
| $"elsa-diagnostics-operations-{Guid.NewGuid():N}.db"); |
Comment on lines
+147
to
+149
| private readonly string _databasePath = Path.Combine( | ||
| Path.GetTempPath(), | ||
| $"elsa-structured-logs-{Guid.NewGuid():N}.db"); |
Comment on lines
+169
to
+172
| catch (Exception exception) | ||
| { | ||
| throw TranslateFailure("write", context, exception); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References #642.
This draft carries the ratified Spec Kit work unit for replacing Structured Logs and OpenTelemetry EF Core persistence with Groundwork while diagnostics core contracts remain provider-neutral.
Reviewed checkpoints now on the branch
0.0.1-preview.41Current verification
Elsa.Server.slnxbuild: 0 errorsWhy this remains draft
The remaining OpenTelemetry catalog and case-insensitive query surface depends on Groundwork #70 and #71. After consuming those releases, this work unit still must complete production registration, four-provider conformance, EF-oracle/performance evidence, and deletion of the diagnostics EF implementation/package/migrations. Issue #642 remains open until those gates pass.