Skip to content

Rename audit actions. Update upgrade versions - #8871

Merged
sumerjabri merged 1 commit into
craftersoftware:developfrom
jmendeza:feature/8804
Aug 6, 2026
Merged

Rename audit actions. Update upgrade versions#8871
sumerjabri merged 1 commit into
craftersoftware:developfrom
jmendeza:feature/8804

Conversation

@jmendeza

@jmendeza jmendeza commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

#8804
Rename audit actions. Update upgrade versions

Summary by CodeRabbit

  • Chores
    • Updated the database metadata version to 5.0.0.24.
    • Added an upgrade path from version 5.0.0.23 to 5.0.0.24.
    • Added migration support for updated audit operation names.
    • Added upgrade routing for versions 4.5.0.5 and 4.5.1.2.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The database metadata version changes to 5.0.0.24. A migration renames four audit and activity stream operations. Upgrade pipelines route legacy versions and execute the new migration.

Changes

Database upgrade

Layer / File(s) Summary
Database version and audit migration
studio/src/main/resources/crafter/studio/database/createDDL.sql, studio/src/main/resources/crafter/studio/database/upgrade/5.0.x/5.0.0.23-to-5.0.0.24.sql
The metadata version changes to 5.0.0.24. The migration renames four values in audit.operation and activity_stream.action.
Upgrade pipeline routing
studio/src/main/resources/crafter/studio/upgrade/pipelines.yaml
Versions 4.5.0.5 and 4.5.1.2 target 5.0-t. The pipeline runs the 5.0.0.23-to-5.0.0.24 database migration.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the two main changes: renaming audit actions and updating upgrade versions.
Description check ✅ Passed The description includes the issue reference and a concise summary of the changes, as required by the template.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 350b42c and ea490c6.

📒 Files selected for processing (3)
  • studio/src/main/resources/crafter/studio/database/createDDL.sql
  • studio/src/main/resources/crafter/studio/database/upgrade/5.0.x/5.0.0.23-to-5.0.0.24.sql
  • studio/src/main/resources/crafter/studio/upgrade/pipelines.yaml

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ 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 | 🟠 Major

Preserve package-specific audit operations.

Line [19] maps every legacy audit.operation = 'PUBLISHED' row to PUBLISH_ITEM_LIST_COMPLETE. The 5.0.0.23 publisher also stored PUBLISHED for 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

📥 Commits

Reviewing files that changed from the base of the PR and between 350b42c and 678f30c.

📒 Files selected for processing (3)
  • studio/src/main/resources/crafter/studio/database/createDDL.sql
  • studio/src/main/resources/crafter/studio/database/upgrade/5.0.x/5.0.0.23-to-5.0.0.24.sql
  • studio/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

@jmendeza
jmendeza marked this pull request as ready for review August 6, 2026 01:50
@sumerjabri
sumerjabri merged commit 1d38ec2 into craftersoftware:develop Aug 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants