Conversation
The aireview domain structs (AiReview, AiFailurePrediction, AiPredictionMetrics) were previously added to core/models/domainlayer/code/ and registered in core's GetDomainTablesInfo() and migration registry. This violated the architecture rule that core cannot import from plugins and introduced unnecessary upstream divergence. This commit: - Removes the 3 domain struct files from core/models/domainlayer/code/ - Removes their entries from GetDomainTablesInfo() in domaininfo.go - Deletes the 2 core migration scripts and their register.go entries - Adds plugins/aireview/models/domain/ package with the 3 structs - Adds an idempotent plugin migration (20260612000001_claim_domain_tables) that uses AutoMigrate to ensure tables exist on both new and existing deployments without breaking production instances - Updates all convert tasks and tests to import from the new package Verified end-to-end locally: ai_reviews (25), ai_failure_predictions (22), and ai_prediction_metrics (8) rows written correctly after a pipeline run. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #104 +/- ##
==========================================
- Coverage 40.80% 40.70% -0.11%
==========================================
Files 147 151 +4
Lines 10189 10219 +30
==========================================
+ Hits 4158 4160 +2
- Misses 5927 5955 +28
Partials 104 104
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
…tables migration Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
/ok-to-test |
|
🤖 Finished Review · ✅ Success · Started 12:56 PM UTC · Completed 1:02 PM UTC |
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
Labels: Review identified documentation staleness in AGENTS.md related to domain model location Previous run (2)ReviewFindingsMedium
Low
Previous run (3)ReviewFindingsMedium
Low
Previous run (4)ReviewFindingsMedium
Low
Previous run (5)ReviewFindingsMedium
Low
Previous run (6)Review — refactor(aireview): move domain models and migrations into pluginVerdict: approve · No blocking findings. SummaryClean, well-scoped refactoring that moves three plugin-specific domain models ( What was verifiedCorrectness & migration safety:
Security: No new attack surface, secrets, or privilege changes. Intent & scope: The change matches the stated goal of reducing upstream divergence. All modifications are coherent with the architectural direction of keeping plugin-specific types in the plugin. Minor observations
Neither observation affects correctness or warrants changes-requested status. Previous run (7)Review — approveClean, well-scoped refactoring that moves plugin-specific domain models and migrations out of core into the aireview plugin. The change correctly reduces upstream divergence in What was verifiedCorrectness
Security — No security-relevant changes. Pure structural refactoring. Scope & intent — The diff matches the stated purpose. The removal from Style — Package name Documentation — Previous run (8)Review — approveClean refactoring that correctly moves plugin-specific domain models out of core and into the What was verifiedCorrectness
Migration safety
Upstream divergence
Incidental changes
No security, correctness, or architectural concerns identified. Labels: Refactoring that improves plugin architecture |
|
🤖 Finished Review · ✅ Success · Started 7:56 AM UTC · Completed 8:02 AM UTC |
Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
🤖 Finished Review · ✅ Success · Started 8:26 AM UTC · Completed 8:32 AM UTC |
|
🤖 Review · ❌ Terminated · Started 2:02 PM UTC · Ended 2:17 PM UTC |
Code Review by Qodo
1.
|
|
🤖 Finished Review · ✅ Success · Started 2:02 PM UTC · Completed 2:17 PM UTC |
|
/ok-to-test |
rsoaresd
left a comment
There was a problem hiding this comment.
Great work 🚀 ! Just suggestion regarding test:
| bitbucket_server "github.com/apache/incubator-devlake/plugins/bitbucket_server/impl" | ||
| claudeCode "github.com/apache/incubator-devlake/plugins/claude_code/impl" | ||
| circleci "github.com/apache/incubator-devlake/plugins/circleci/impl" | ||
| claudeCode "github.com/apache/incubator-devlake/plugins/claude_code/impl" |
There was a problem hiding this comment.
These tests will fail. I needed to add the following changes to work:
in backend/plugins/table_info_test.go:
- add the following imports:
agentready "github.com/apache/incubator-devlake/plugins/agentready/impl"
aireview "github.com/apache/incubator-devlake/plugins/aireview/impl"
codecov "github.com/apache/incubator-devlake/plugins/codecov/impl"
testregistry "github.com/apache/incubator-devlake/plugins/testregistry/impl"
- add the following checkers:
checker.FeedIn("agentready/models", agentready.AgentReady{}.GetTablesInfo)
checker.FeedIn("aireview/models", aireview.AiReview{}.GetTablesInfo)
checker.FeedIn("testregistry/models", testregistry.TestRegistry{}.GetTablesInfo)
checker.FeedIn("codecov/models", codecov.Codecov{}.GetTablesInfo)
in backend/plugins/aireview/impl/impl.go:
- add the following import
"github.com/apache/incubator-devlake/plugins/aireview/models/domain" - add the following domains in
GetTablesInfo():
&domain.AiReview{},
&domain.AiFailurePrediction{},
&domain.AiPredictionMetrics{},
in backend/plugins/testregistry/impl/impl.go:
- add the following model in
GetTablesInfo():
&models.TektonTask{},
Test_GetPluginTablesInfo failed because owned plugins were not FeedIn'd and aireview/testregistry omitted domain/TektonTask models. Document the table_info_test.go fork divergence. Upstream-Status: N/A — owned plugins are Konflux-only additions Co-Authored-By: Cursor <cursoragent@cursor.com>
|
🤖 Review · ❌ Terminated · Started 1:47 PM UTC · Ended 2:00 PM UTC |
|
Code review by qodo was updated up to the latest commit 3f22bdc |
|
🤖 Finished Review · ✅ Success · Started 1:47 PM UTC · Completed 2:00 PM UTC |
|
/retest |
|
@mfrancisc can you have a look at failing linters? One is likely commit message - 1a24314, the other is about imports in migrations - I think you have already fixed that in the main? |
|
The fix for the |
|
🤖 Review · |
1124bc2 to
1f6bacc
Compare
|
🤖 Review · ❌ Terminated · Started 2:01 PM UTC · Ended 2:13 PM UTC |
|
@kpiwko commit message linter is fixed now, even if the required rule it's a bit too strict IMHO and I don't really understand why. |
|
Code review by qodo was updated up to the latest commit 1f6bacc |
|
🤖 Finished Review · ✅ Success · Started 2:01 PM UTC · Completed 2:13 PM UTC |
|
🤖 Finished Review · ✅ Success · Started 10:37 AM UTC · Completed 10:53 AM UTC Commit: |
|
🤖 Finished Review · ✅ Success · Started 10:31 AM UTC · Completed 10:47 AM UTC Commit: |
|
🤖 Finished Review · ✅ Success · Started 12:40 PM UTC · Completed 12:56 PM UTC Commit: |
Problem
Three domain model files (
AiReview,AiFailurePrediction,AiPredictionMetrics)were added to
backend/core/models/domainlayer/code/and registered in core'sGetDomainTablesInfo()and migration scripts. This was incorrect for two reasons:1. Plugin-specific types in core
The
core/models/domainlayer/package tracks upstream Apache DevLake domain types.Adding aireview-specific structs here pollutes core with plugin concerns and creates
maintenance overhead on every upstream rebase.
2. Scope deletion registration was non-functional
Registering the tables in
GetDomainTablesInfo()implied scope deletion support,but the aireview converters never populate
_raw_data_params(they operate onproject-level aggregations, not raw scope data). The deletion query would silently
match zero rows. The registration was cosmetic.
Solution
core/models/domainlayer/code/GetDomainTablesInfo()and the core migration registryplugins/aireview/models/domain/package with the same structs20260612000001_claim_domain_tables)using
AutoMigrate— safe for both new installs and existing production databasesthat already have the tables from the old core migrations
Impact
domaininfo.goandregister.goTesting
Verified end-to-end on a local podman instance against
konflux-ci/mobster(May–June 2026 data window):
ai_reviews: 25 rowsai_failure_predictions: 22 rowsai_prediction_metrics: 8 rows