Repository navigation
Conversation
…and song version rollback - Ship structured logs to Grafana Loki via Promtail sidecar and direct HTTP log shipper, with strict redaction of sensitive credentials (Closes AudioBitsStellar#380) - Audit and enhance PR template (.github/PULL_REQUEST_TEMPLATE.md) with prompts for test plan evidence, breaking changes, and linked issues (Closes AudioBitsStellar#386) - Add 'npm run test:changed' script using Jest '--changedSince=main' and document usage in README and CONTRIBUTING (Closes AudioBitsStellar#397) - Add song version rollback endpoint 'POST /api/song/:id/versions/:version/rollback' preserving revision history for owning artists (Closes AudioBitsStellar#441)
|
@pearl-26 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This branch has not been deployed
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.
Summary
This pull request resolves issues #380, #386, #397, and #441 in a single PR:
LOG_AGGREGATOR_URL), with strict automated redaction of sensitive credentials (passwords, tokens, secrets, API keys, and authorization headers)..github/PULL_REQUEST_TEMPLATE.mdto comprehensively prompt for issue linking, type of change / PR labels perCONTRIBUTING.md, explicit breaking-change disclosure, and detailed test plan verification.test:changedScript): Addednpm run test:changedscript utilizing Jest's--changedSince=mainfor fast local testing iteration while keeping the full test suite as CI default. Documented inREADME.mdandCONTRIBUTING.md.POST /api/song/:id/versions/:version/rollbackallowing owning artists to revert metadata to any prior revision by creating a new active version without mutating or deleting historical version records.Why
.github/PULL_REQUEST_TEMPLATE.mdlacked explicit prompts for breaking-change impact, automated test commands, PR classification labels, and linked issue keywords.SongVersionrecorded historical audio versions upon re-upload, but artists lacked an endpoint to roll back to a previous version if an upload or edit was unsatisfactory, while strictly preserving audit history.Implementation Details
#380: Log Shipping & Redaction
src/config/logger.ts:SENSITIVE_LOG_PATHScoveringpassword,token,accessToken,refreshToken,authorization,headers.authorization,apiKey,secret,jwtSecret,clientSecret,privateKey, and 2FA secrets.createHttpLogShipper(aggregatorUrl)with batching, auto-flush timeout, and fail-open HTTP/HTTPS dispatching to direct aggregator endpoints.docker-compose.yml: Addedloki(v3.0.0) andpromtail(v3.0.0) sidecar services underfull,monitoring, andobservabilityprofiles.monitoring/promtail.yml: Configured log scraping for docker container logs.monitoring/grafana/provisioning.yml: Added Loki datasource athttp://loki:3100.docs/logging-and-aggregation.md: Comprehensive setup runbook, LogQL examples, and architecture documentation.src/config/__tests__/logger.test.ts: Unit tests verifying credential redaction and log shipper dispatch.#386: PR Template Audit
.github/PULL_REQUEST_TEMPLATE.md:Fixes #/Closes #linked issue numbers.CONTRIBUTING.md.#397: Fast Iteration Test Script
package.json: Added"test:changed": "jest --changedSince=main".README.md&CONTRIBUTING.md: Documented usage for local testing workflows while maintainingnpm testas CI default.#441: Song Version Rollback
src/services/Song/SongVersionService.ts: AddedrollbackVersion(songId, targetVersionNumber, artistId, changeNote):history is never mutated or deleted).Songrecord and clears song cache inCacheService.src/controllers/SongController.ts: AddedrollbackVersioncontroller handler.src/routes/SongRoutes.ts:POST /api/song/:id/versions/:version/rollbackprotected withauthArtistMiddleware.PATCH /:id,DELETE /:id, lyrics, cover art, and version history) and added missing imports.docs/openapi.yaml: DocumentedPOST /api/song/{id}/versions/{version}/rollbackendpoint, responses, and parameters.src/services/__tests__/SongVersionService.test.ts&src/__tests__/SongRoutes.test.ts: Added unit and route integration tests.Testing & Verification
Executed Automated Tests
npx jest src/config/__tests__/logger.test.ts --forceExit(2/2 tests passed)
npx jest src/services/__tests__/SongVersionService.test.ts --forceExit(17/17 tests passed)
npx jest src/__tests__/SongRoutes.test.ts --forceExit(26/26 tests passed)
npx jest src/__tests__/SongRoutesOrder.test.ts --forceExit(4/4 tests passed)
npx eslint src/controllers/SongController.ts src/services/Song/SongVersionService.ts src/routes/SongRoutes.ts src/config/logger.ts src/services/SongService.ts src/config/__tests__/logger.test.ts src/services/__tests__/SongVersionService.test.ts src/__tests__/SongRoutes.test.ts(0 errors across changed files)
npx prettier --check src/controllers/SongController.ts src/services/Song/SongVersionService.ts src/routes/SongRoutes.ts src/config/logger.ts src/services/SongService.ts src/config/__tests__/logger.test.ts src/services/__tests__/SongVersionService.test.ts src/__tests__/SongRoutes.test.ts(All files match prettier standards)
npm run compose:check && npm run env:check(All docker compose files and required env variables verified consistent)
Scope / Risk
Issues Closed
Closes #380
Closes #386
Closes #397
Closes #441