Implement organization limits #389

Merged
tobru merged 9 commits from 380-organization-limits into main 2026-02-05 07:50:45 +00:00
Member

closes #380, closes #384

Notable points:

  • We do not enforce organization limits in the OSB API – when a service is added to the OSB service list via the API, we do not check if this service is allowed per the list of service definitions in the limits profile
  • Once an organization is expired, we do not permit instance creation anymore, but users can still browse services and offerings. Imo this is better than not permitting it, but it's your call how locked-down an expired account should be.
closes #380, closes #384 Notable points: - We do not enforce organization limits in the OSB API – when a service is added to the OSB service list via the API, we do not check if this service is allowed per the list of service definitions in the limits profile - Once an organization is expired, we do not permit instance creation anymore, but users can still browse services and offerings. Imo this is better than not permitting it, but it's your call how locked-down an expired account should be.
Implement organization limits
All checks were successful
Tests / test (push) Successful in 37s
f79a974002
closes #380
Owner

We do not enforce organization limits in the OSB API – when a service is added to the OSB service list via the API, we do not check if this service is allowed per the list of service definitions in the limits profile

This is OK

Once an organization is expired, we do not permit instance creation anymore, but users can still browse services and offerings. Imo this is better than not permitting it, but it's your call how locked-down an expired account should be.

Yes, this makes sense this way.

Other things:

  • When an organization already hit the limit of maximum instances, the service creation fails after hitting "Create" with " Maximum service instances (1) reached.". We should even disable the "Get It" button when we've hit the limit, this gives a better user experience. Maybe show an information to the user that it's not possible to create new instances because of the limit reached.
  • The "Usage Limits" card on the organization details needs better alignment with other cards Screenshot_20260202_164939
> We do not enforce organization limits in the OSB API – when a service is added to the OSB service list via the API, we do not check if this service is allowed per the list of service definitions in the limits profile This is OK > Once an organization is expired, we do not permit instance creation anymore, but users can still browse services and offerings. Imo this is better than not permitting it, but it's your call how locked-down an expired account should be. Yes, this makes sense this way. Other things: * When an organization already hit the limit of maximum instances, the service creation fails after hitting "Create" with " Maximum service instances (1) reached.". We should even disable the "Get It" button when we've hit the limit, this gives a better user experience. Maybe show an information to the user that it's not possible to create new instances because of the limit reached. * The "Usage Limits" card on the organization details needs better alignment with other cards ![Screenshot_20260202_164939](/attachments/9f82fee4-dcb5-4d58-ab41-13651984b416)
Author
Member

When an organization already hit the limit of maximum instances, the service creation fails after hitting "Create" with " Maximum service instances (1) reached.". We should even disable the "Get It" button when we've hit the limit, this gives a better user experience. Maybe show an information to the user that it's not possible to create new instances because of the limit reached.

Done.

The "Usage Limits" card on the organization details needs better alignment with other cards

Done.


I now added the featureset described in #384: fully enforcing the validity limits + reminder sending (needs yet another cronjob). Notes on this implementation:

  • The reminder emails are plain text emails – HTML emails would be prettier, but would require some setup and design (HTML emails are notoriously hard to make look good in all or even most major email clients)
  • Who should receive the emails? Per the issue text, this should be all organization members, but we should probably limit this by roles?
> When an organization already hit the limit of maximum instances, the service creation fails after hitting "Create" with " Maximum service instances (1) reached.". We should even disable the "Get It" button when we've hit the limit, this gives a better user experience. Maybe show an information to the user that it's not possible to create new instances because of the limit reached. Done. > The "Usage Limits" card on the organization details needs better alignment with other cards Done. -------- I now added the featureset described in #384: fully enforcing the validity limits + reminder sending (needs yet another cronjob). Notes on this implementation: - The reminder emails are plain text emails – HTML emails would be prettier, but would require some setup and design (HTML emails are notoriously hard to make look good in all or even most major email clients) - Who should receive the emails? Per the issue text, this should be all organization members, but we should probably limit this by roles?
Owner

The reminder emails are plain text emails – HTML emails would be prettier, but would require some setup and design (HTML emails are notoriously hard to make look good in all or even most major email clients)

That's OK

Who should receive the emails? Per the issue text, this should be all organization members, but we should probably limit this by roles?

For now, all organization members are fine. We can refine this at a later stage if required.

reminder sending (needs yet another cronjob)

If I'm not mistaken, that would be similar to https://servala.app.codey.ch/servala/servala-portal/src/branch/main/deployment/kustomize/base/portal/cronjob.yaml, but with the send_expiration_reminders command? Would it make sense to implement this with Django 6 tasks and something like django-dbtasks? I'd create an issue for later for this then (out of scope of this PR).

Then:

  • In the "You have reached the maximum number of service instances (1) for this organization. Contact support to increase your limit." message, please link to /org/$org/support/
  • Same for "Contact us to extend"
  • This bar needs bit of alignment, the clock is misaligned Screenshot_20260203_081832
> The reminder emails are plain text emails – HTML emails would be prettier, but would require some setup and design (HTML emails are notoriously hard to make look good in all or even most major email clients) That's OK > Who should receive the emails? Per the issue text, this should be all organization members, but we should probably limit this by roles? For now, all organization members are fine. We can refine this at a later stage if required. > reminder sending (needs yet another cronjob) If I'm not mistaken, that would be similar to https://servala.app.codey.ch/servala/servala-portal/src/branch/main/deployment/kustomize/base/portal/cronjob.yaml, but with the `send_expiration_reminders` command? Would it make sense to implement this with Django 6 tasks and something like [django-dbtasks](https://github.com/imsweb/django-dbtasks?#periodic-tasks)? I'd create an issue for later for this then (out of scope of this PR). Then: * In the "You have reached the maximum number of service instances (1) for this organization. Contact support to increase your limit." message, please link to `/org/$org/support/` * Same for "Contact us to extend" * This bar needs bit of alignment, the clock is misaligned ![Screenshot_20260203_081832](/attachments/b7cfaa35-a616-48ac-a8cc-4a7e6e5cacd6)
Author
Member

Would it make sense to implement this with Django 6 tasks and something like django-dbtasks?

Maybe! I haven't worked with the new Django tasks interface yet, and I think its strength and target will be in the realm of user-triggered tasks that are long running (e.g. generating download files etc) rather than scheduled tasks that should run in a fixed interval like crontabs. (You definitely can model one with the other; like with celery-cronjobs, but it always feels a bit awkward).

I do think that we'll want some sort of management around recurring tasks to avoid having a lot of cronjobs – instead probably a single frequently-running one that schedules/defers hourly tasks, daily tasks etc (or, even simpler and less prone to error until we need something more complex, possibly a manage.py daily_tasks, manage.py hourly_tasks). Worth discussing in a separate issue for sure.

In the "You have reached the maximum number of service instances (1) for this organization. Contact support to increase your limit." message, please link to /org/$org/support/
Same for "Contact us to extend"

Done, and also fixed the alignment, and made the call-to-support buttons look the same in alerts as in the top-level banners.

> Would it make sense to implement this with Django 6 tasks and something like django-dbtasks? Maybe! I haven't worked with the new Django tasks interface yet, and I think its strength and target will be in the realm of user-triggered tasks that are long running (e.g. generating download files etc) rather than scheduled tasks that should run in a fixed interval like crontabs. (You definitely can model one with the other; like with celery-cronjobs, but it always feels a bit awkward). I do think that we'll want some sort of management around recurring tasks to avoid having a lot of cronjobs – instead probably a single frequently-running one that schedules/defers hourly tasks, daily tasks etc (or, even simpler and less prone to error until we need something more complex, possibly a `manage.py daily_tasks`, `manage.py hourly_tasks`). Worth discussing in a separate issue for sure. > In the "You have reached the maximum number of service instances (1) for this organization. Contact support to increase your limit." message, please link to /org/$org/support/ > Same for "Contact us to extend" Done, and also fixed the alignment, and made the call-to-support buttons look the same in alerts as in the top-level banners.
Add user-based organization creation limits
All checks were successful
Tests / test (push) Successful in 41s
fd7e626f51
closes #382
Author
Member

#382 is now also part of this PR

#382 is now also part of this PR
tobru merged commit 64bb1900cc into main 2026-02-05 07:50:45 +00:00
tobru deleted branch 380-organization-limits 2026-02-05 07:50:45 +00:00
Sign in to join this conversation.
No description provided.