Rename audit actions. Update upgrade versions - #8871
Conversation
WalkthroughThe database metadata version changes to ChangesDatabase upgrade
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@studio/src/main/resources/crafter/studio/database/upgrade/5.0.x/5.0.0.23-to-5.0.0.24.sql`:
- Around line 17-23: Update the migration alongside the existing audit operation
changes to also update activity_stream.action for all four legacy-to-new
mappings: APPROVE to APPROVE_PUBLISH_PACKAGE, PUBLISHED to
PUBLISH_ITEM_LIST_COMPLETE, INITIAL_PUBLISH to INITIAL_PUBLISH_COMPLETE, and
PUBLISH_ALL to PUBLISH_ALL_COMPLETE.
- Around line 17-23: The audit migration must distinguish publish records by
package type instead of globally converting PUBLISHED. Update the migration
statements using the package ID and package type to map initial-publish,
publish-all, and item-list packages to their correct audit operations, and also
migrate the corresponding activity_stream.action values from INITIAL_PUBLISH,
PUBLISH_ALL, and PUBLISHED.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 74945dfa-5c85-48cf-a484-a674cb3603ea
📒 Files selected for processing (3)
studio/src/main/resources/crafter/studio/database/createDDL.sqlstudio/src/main/resources/crafter/studio/database/upgrade/5.0.x/5.0.0.23-to-5.0.0.24.sqlstudio/src/main/resources/crafter/studio/upgrade/pipelines.yaml
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
studio/src/main/resources/crafter/studio/database/upgrade/5.0.x/5.0.0.23-to-5.0.0.24.sql (1)
19-19:⚠️ Potential issue | 🟠 MajorPreserve package-specific audit operations.
Line [19] maps every legacy
audit.operation = 'PUBLISHED'row toPUBLISH_ITEM_LIST_COMPLETE. The 5.0.0.23 publisher also storedPUBLISHEDfor initial-publish and publish-all packages. This migration assigns the wrong operation to those audit rows. Use package ID and package type to select the correct destination operation. The activity-stream updates do not repair the audit rows.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@studio/src/main/resources/crafter/studio/database/upgrade/5.0.x/5.0.0.23-to-5.0.0.24.sql` at line 19, Replace the blanket audit operation update with package-aware migration logic: use each audit row’s package ID and package type to map legacy PUBLISHED entries to the correct destination operation, preserving distinct initial-publish and publish-all operations while retaining PUBLISH_ITEM_LIST_COMPLETE for item-list publishes. Ensure all affected audit rows are updated without relying on the activity-stream migration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In
`@studio/src/main/resources/crafter/studio/database/upgrade/5.0.x/5.0.0.23-to-5.0.0.24.sql`:
- Line 19: Replace the blanket audit operation update with package-aware
migration logic: use each audit row’s package ID and package type to map legacy
PUBLISHED entries to the correct destination operation, preserving distinct
initial-publish and publish-all operations while retaining
PUBLISH_ITEM_LIST_COMPLETE for item-list publishes. Ensure all affected audit
rows are updated without relying on the activity-stream migration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 79b8c422-8ab8-4193-93de-dbab9e296d2f
📒 Files selected for processing (3)
studio/src/main/resources/crafter/studio/database/createDDL.sqlstudio/src/main/resources/crafter/studio/database/upgrade/5.0.x/5.0.0.23-to-5.0.0.24.sqlstudio/src/main/resources/crafter/studio/upgrade/pipelines.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
- studio/src/main/resources/crafter/studio/database/createDDL.sql
- studio/src/main/resources/crafter/studio/upgrade/pipelines.yaml
#8804
Rename audit actions. Update upgrade versions
Summary by CodeRabbit