Skip to content

Conversation

@jvstme
Copy link
Collaborator

@jvstme jvstme commented Nov 26, 2025

  • Add the framework for event emission
  • Add the events API
  • Add a few sample events about project / user / fleet / instance / run / job creation

Hidden behind the DSTACK_FF_EVENTS feature flag.

Part of #3290

Next steps:

  • CLI
  • UI
  • Actual event coverage
  • More event targets (volumes, gateways, backends, secrets; possibly repos and files)

- Add the framework for event emission
- Add the events API
- Add a few sample events about project / user /
  fleet / instance / run / job creation.
.order_by(*order_by)
.limit(limit)
.options(
joinedload(EventModel.targets),
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC, targets can potentially be from different projects. The access filter checks that an event has at least one target in the user's project but the response includes all the targets. Thus, event responses can leak targets from projects that users don't have access to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This may be expected in some cases.

Example: job assigned to instance, where the job and the instance are in different projects (will be possible once we allow sharing instances between projects, which is on the Q4 roadmap).

  • Users in the job's project may need to know what instance it is assigned to.
  • Users in the instance's project may need to know what jobs are assigned to it.

When this is not expected, it may be possible to split the event into several events with different targets. I don't think we'll have such cases anytime soon, but I described this behavior in the events.emit docstring.

- DB query and schema optimizations
- Event logging
- `DSTACK_FF_EVENTS` feature flag
- More input validation
- More unit tests
- Various docs
@jvstme jvstme marked this pull request as ready for review December 5, 2025 01:02
@jvstme jvstme requested a review from r4victor December 5, 2025 01:02
@jvstme jvstme merged commit b780ad3 into master Dec 5, 2025
28 checks passed
@jvstme jvstme deleted the issue_3290_events branch December 5, 2025 08:23
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.

3 participants