Skip to content

feat: task to check session quota and send alerts#1252

Draft
mohammad-alisafaee wants to merge 8 commits intobuild/resource-quotasfrom
build/resource-quotas-notification
Draft

feat: task to check session quota and send alerts#1252
mohammad-alisafaee wants to merge 8 commits intobuild/resource-quotasfrom
build/resource-quotas-notification

Conversation

@mohammad-alisafaee
Copy link
Copy Markdown
Contributor

  • A task that checks available session quotas
  • Write proper alerts to the database for the UI task to read

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 7, 2026

Coverage Report for CI Build 24859833641

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Warning

No base build found for commit 73303f9 on build/resource-quotas.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 87.079%

Details

  • Patch coverage: 43 uncovered changes across 1 file (25 of 68 lines covered, 36.76%).

Uncovered Changes

File Changed Covered %
bases/renku_data_services/data_tasks/task_defs.py 49 6 12.24%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 28861
Covered Lines: 25132
Line Coverage: 87.08%
Coverage Strength: 1.52 hits per line

💛 - Coveralls

Comment on lines +497 to +507
# TODO: Does this send an alert every time the check runs and the quota is low!?

alert = UnsavedAlert(
user_id=user_id,
# TODO: Use proper event type here
event_type="session_quota_low_remaining",
session_name=session_name,
title="Session quota running low",
message=f"You have used {usage_percentage:.1f}% of your quota in resource pool {resource_pool_id}.",
)
await dm.notifications_repo.create_or_update_alert(user=admin_user, alert=alert)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note: this will create the alert the first time and then update it (title and message) if it already exists.

@mohammad-alisafaee mohammad-alisafaee force-pushed the build/resource-quotas-notification branch from feac323 to 8bcf22f Compare April 23, 2026 21:29
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.

4 participants