[API] Publish project lifecycle events to Iguazio v4#9703
Merged
liranbg merged 3 commits intoMay 22, 2026
Conversation
Contributor
📊 Diff Coverage Report📂 Click to view full coverage detailsDiff CoverageDiff: origin/development...HEAD, staged and unstaged changes
Summary
|
liranbg
approved these changes
May 22, 2026
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.
📝 Description
Extends the Iguazio v4 events client and
Projectscrud layer to publish project lifecycle events (creation and deletion) so the orca events service can store them, evaluate rules, and dispatch actions.Five event configs are exercised here - three new ones (
MLRun.Project.Creation.Succeeded,MLRun.Project.Deletion.Succeeded) that are added on the orca side in the companion PR, plus the two*.Failedvariants that already existed in the orca catalog but were never published from MLRun.Depends on: https://github.com/McK-Private/orca/pull/750
🛠️ Changes Made
mlrun/common/schemas/events.py— newProjectLifecycleEventActionsenum (creation_succeeded,creation_failed,deletion_succeeded,deletion_failed) re-exported frommlrun.common.schemas.server/py/services/api/utils/events/base.py—generate_project_lifecycle_eventadded as no-op defaults returningNone, so the v3iguazio.pyandnop.pyclients keep working with no changes and call sites remain client-agnostic.server/py/services/api/utils/events/iguazio_v4.py— five new event-name constants,EVENT_CLASS_PROJECT = "Project", thePROJECT_LIFECYCLE_EVENTSlookup table, and the two concrete generators (INFO for success, WARNING for failure — matching the orca catalog). Error details are passed through the existing_apply_errortruncation helper.server/py/services/api/crud/projects.py— four emission points wired up:create_project:creation_succeededafter the DB call returns;creation_failedin theexceptthen re-raise.delete_project: same try/except pattern, scoped narrowly around the finaldb.delete_project(...)call —check-strategy and missing-project short-circuits stay silent.No breaking changes. New events only flow on Iguazio v4 systems where the orca catalog entries exist; on v3/CE the base-class no-op returns
Noneand emission is skipped silently.✅ Checklist
🧪 Testing
Generator unit tests in
server/py/services/api/tests/unit/utils/events/test_events_iguazio_v4.py(+9 tests):error+error_typein details and an extended description; succeeded actions ignore any passederror.MLRunInvalidArgumentError.ERROR_DETAIL_LIMIT.Crud emission tests added to
server/py/services/api/tests/unit/db/test_projects.pyas methods on the existingTestProjects(TestDatabaseBase)class (+13 tests):create_project: success + failure (re-raises and emitscreation_failed).delete_project: success onrestrictedstrategy; no-emit oncheck; no-emit when project missing; failure path emitsdeletion_failedand re-raises.End-to-end verification against a live Iguazio v4 system is gated on the companion orca PR being merged so the new catalog entries exist; this is intentionally out of scope for this PR.

🔗 References
MLRun.Project.Creation.Succeeded,MLRun.Project.Deletion.Succeeded) to the orca event catalog🚨 Breaking Changes?
🔍️ Additional Notes
Noneand emit is skipped — no behavior change.*.Succeededpublishes will be rejected and logged as best-effort warnings (no functional impact, just noisy logs).