Skip to content

Add update checker management command and documentation#3127

Merged
mlodic merged 36 commits intointelowlproject:developfrom
lvb05:feature/update-checker-2876
Feb 7, 2026
Merged

Add update checker management command and documentation#3127
mlodic merged 36 commits intointelowlproject:developfrom
lvb05:feature/update-checker-2876

Conversation

@lvb05
Copy link

@lvb05 lvb05 commented Dec 20, 2025

This PR adds a basic update check mechanism for IntelOwl.
It allows to verify whether the running instance is behind the latest published GitHub release.

Included changes

  • Added api_app/core/update_checker.py for version fetch + comparison logic
  • Added Django management command: check_updates
  • Added settings keys (UPDATE_CHECK_URL, version reuse via existing VERSION)
  • Updated README with usage + configuration notes

How to use

python manage.py check_updates

The command will:

  1. fetch the latest GitHub release tag
  2. normalize version strings
  3. compare against the locally configured version
  4. log whether a new version is available

No version upgrade happens automatically.
Fixes #2876

Notes

  • UPDATE_CHECK_URL is now environment configurable
  • local version comes from existing VERSION secret setting
  • no new dependencies added
  • cron / job scheduler usage referenced in docs if periodic checking is desired.

Checklist

  • I have read and understood the rules about how to contribute to this project.
  • The pull request targets the correct branch.
  • This PR is linked to an approved issue (Add update checker #2876).
  • A new plugin (analyzer, connector, visualizer, playbook, pivot, or ingestor) was added or modified.
    N/A – this PR does not introduce or modify any plugins.
  • No new external libraries were added.
  • Linters (Black, Flake8, Isort) report no errors.
  • Tests were added or updated.
    N/A – this PR adds a management command and configuration logic only; existing functionality and tests are unaffected.
  • Documentation was updated where appropriate (README updated with usage and configuration).
  • GUI changes were made.
    N/A – backend-only change.
  • I have addressed any CI or linter warnings triggered after submitting the PR.

Copy link
Contributor

@fgibertoni fgibertoni left a comment

Choose a reason for hiding this comment

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

Hey @lvb05 thanks for your contribution. Can you please compile the checklist in PR template ? It contains many important step to follow before asking for a review.

@lvb05
Copy link
Author

lvb05 commented Dec 24, 2025

Hey @lvb05 thanks for your contribution. Can you please compile the checklist in PR template ? It contains many important step to follow before asking for a review.

I’ve added and completed the PR checklist in the description.
Please let me know if anything needs adjustment. Thanks!

@fgibertoni
Copy link
Contributor

I can tell you've not read it carefully since your PR is pointing to the master branch.
Please read it carefully and adjust accordingly.

@lvb05 lvb05 changed the base branch from master to develop December 31, 2025 11:43
@lvb05
Copy link
Author

lvb05 commented Jan 4, 2026

Hi @fgibertoni,
I’ve updated the PR to target the develop branch and fixed the formatting issues.
All checks are green for now.
Thanks for your time!

Copy link
Contributor

@fgibertoni fgibertoni left a comment

Choose a reason for hiding this comment

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

Hey, thanks for your PR! Looking good overall 😃
Please address the pipeline for errors.

@lvb05 lvb05 requested a review from fgibertoni January 8, 2026 19:24
Copy link
Contributor

@fgibertoni fgibertoni left a comment

Choose a reason for hiding this comment

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

Looking good, thanks!
@mlodic for last check on expected results, otherwise we can merge this.

Copy link
Member

@mlodic mlodic left a comment

Choose a reason for hiding this comment

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

can you please show an example output of this command? a screenshot

Also there's no cronjob here but only the management command even if we agreed on that in the issue. This won't be run by the normal user manually, we need something that runs automatically and notify the user.

Also, the cronjob would need to add a notification through the current notification system. In that way, the user would see that notification in the GUI at the top right as a message.

README.md Outdated
All info about installation, usage, configuration and contribution can be found [here](https://intelowlproject.github.io/docs/)


### Update Checker
Copy link
Member

Choose a reason for hiding this comment

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

we cannot pollute the ReadMe with this content. Please remove this line and add this instead with a new PR in the Installation section: https://github.com/intelowlproject/docs/blob/main/docs/IntelOwl/installation.md

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for highlighting this
I’ve restored the README to its original state. I’ll add the Update Checker documentation under the Installation section in the docs repository (as suggested) via a separate PR.

@lvb05
Copy link
Author

lvb05 commented Jan 10, 2026

Hi, I’ve tested the check_updates management command in a local IntelOwl Docker setup. It was executed inside the intelowl_uwsgi container.

Screenshot 2026-01-10 163335

@lvb05
Copy link
Author

lvb05 commented Jan 10, 2026

For this PR, I kept the update checker as a management command only, mainly to introduce and validate the core logic first.
This shouldn’t be something users run manually. The next step would be to run it automatically (via cron or Celery beat) and send a notification through the existing GUI notification system.
Since that involves scheduler decisions and tighter integration with notifications, I think its better with a follow-up PR. Happy to implement that next if thats fine?

@lvb05 lvb05 requested review from fgibertoni and mlodic January 10, 2026 15:06
@mlodic
Copy link
Member

mlodic commented Jan 10, 2026

We won't merge this PR with these changes only because they are actually incomplete work, by themselves they don't help solving the issue.

So we can merge to the project only an implementation that contain all the necessary changes

@lvb05
Copy link
Author

lvb05 commented Jan 10, 2026

Before implementing the automatic update check, I want to confirm some things.
Should the “update available” notification be treated as a global/admin-level state or something user/org-specific, and should it be persistent until upgrade or just informational when detected? From an integration point of view, should this reuse the existing user_events_manager, or be handled as a separate system-level notification? Finally, for scheduling and delivery, is Celery beat the preferred mechanism(IntelOwl already use this), and is a GUI notification expected, or is a log/admin-level message sufficient?

@mlodic
Copy link
Member

mlodic commented Jan 11, 2026

  • the “update available” notification should be treated as a global/admin-level and persistent until upgrade
  • It would be great to reuse the user_events_manager to simplify the integration. If this makes impossible to treat the notification ad global (so contradicts the previous point), I don't think it is a problem, it is better to re-use the actual flow than creating complete new integrations for just this case.
  • Celery beat is good - A GUI notification would be great. However when you say log/admin level message, what do you mean? Cause that could be an option in case you have a good idea

@lvb05
Copy link
Author

lvb05 commented Jan 12, 2026

By log/admin-level message, I mean a complementary signal, not a replacement for the GUI.
The idea would be to always surface the update via a persistent GUI notification, but also log it at INFO/WARNING level when detected. This is useful for headless/API-only deployments and for operational observability (logs/alerts), and also acts as a safe fallback if the GUI event creation fails.
I was thinking to implement the GUI notification as the primary mechanism and adding a structured log message alongside it.

@mlodic
Copy link
Member

mlodic commented Jan 12, 2026

I was thinking to implement the GUI notification as the primary mechanism and adding a structured log message alongside it.

Fine with this, thanks!

@lvb05
Copy link
Author

lvb05 commented Jan 16, 2026

Summary of current status

  • This PR adds a persistent backend state for update checks and refactors the logic to be idempotent and admin/global scoped.

  • A Celery task is implemented to allow running the update check asynchronously, but it is not scheduled yet.

  • GUI notification rendering and Celery Beat scheduling are intentionally deferred, pending confirmation on UX and scheduling expectations.

Once aligned, I’ll add GUI integration, periodic scheduling, and documentation in a follow-up PR.
The full backend logic is implemented.
What remains is how and when it should be executed automatically.

@mlodic
Copy link
Member

mlodic commented Jan 30, 2026

I'll review as soon as I can

@mlodic
Copy link
Member

mlodic commented Jan 30, 2026

there are still conflicts and, as mentioned, this requires GUI changes otherwise it won't make a lot of sense adding this as a feature

@lvb05
Copy link
Author

lvb05 commented Jan 31, 2026

there are still conflicts and, as mentioned, this requires GUI changes otherwise it won't make a lot of sense adding this as a feature

Yep I'll add a frontend system update panel and an API endpoint '/system/update-check/ ' to expose update status. Let me know if you’d like any specific fields or UI adjustments.
Thanks

@lvb05
Copy link
Author

lvb05 commented Feb 2, 2026

Hi!
All CI checks are passing now. I’ve addressed the requested changes.
I will open a separate PR for documentation updates.
Let me know if any further adjustments are needed.

Copy link
Member

@mlodic mlodic left a comment

Choose a reason for hiding this comment

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

we need a showcase about how this actually works to be able to merge this, otherwise we don't know the outcome

logger = logging.getLogger(__name__)


# UpdateCheckStatus (replace the existing class in api_app/models.py)
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this comment, can you please explain?

logger = logging.getLogger(__name__)


class UpdateCheckStatus(models.Model):
Copy link
Member

Choose a reason for hiding this comment

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

this has not been addressed

</div>

{data.update_available ? (
<div style={styles.updateBox}>A new system update is available!</div>
Copy link
Member

Choose a reason for hiding this comment

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

please show GUI screenshots/video fpr both cases

@lvb05
Copy link
Author

lvb05 commented Feb 6, 2026

Hi!
I’ve attached

  • Authenticated API responses for both cases (update available / system up to date)
  • Dashboard screenshots showing the UI behavior in both scenarios

The update checker persists its state via the UpdateCheckStatus model (added in migration 0072_update_check_system.py).
Plus, I already added the migrations for that in 0072 in that pr.

Proof-

Screenshot 2026-02-06 201116 Screenshot 2026-02-06 194838 Screenshot 2026-02-06 201516 Screenshot 2026-02-06 201500 Screenshot 2026-02-06 201333 Screenshot 2026-02-06 201321

@lvb05 lvb05 requested a review from mlodic February 6, 2026 16:08
@mlodic
Copy link
Member

mlodic commented Feb 6, 2026

thanks for showcasing it, it really helps. The change is fine, just one thing: I think this should be shown in the Home page, just before the "IntelOWl News" section and, in case we have the most recent version, it should not render anything because it would uselessly clutter the page.
In this way the user would get the message in the Home without cluttering the Dashboards. Thoughts?

@lvb05
Copy link
Author

lvb05 commented Feb 6, 2026

thanks for showcasing it, it really helps. The change is fine, just one thing: I think this should be shown in the Home page, just before the "IntelOWl News" section and, in case we have the most recent version, it should not render anything because it would uselessly clutter the page. In this way the user would get the message in the Home without cluttering the Dashboards. Thoughts?

That makes sense. To keep things simple and avoid duplication, I can move the entire System Updates component to the Home page and render it only when an update is available.
This way, the Home page stays clean when the system is up to date, and we don’t need separate “summary” and “detail” components. I can implement this.

@lvb05
Copy link
Author

lvb05 commented Feb 6, 2026

image

Hi! Done with all the refinements. Check once @mlodic @fgibertoni

@mlodic
Copy link
Member

mlodic commented Feb 7, 2026

that's nice, thanks

@mlodic mlodic merged commit 2093b46 into intelowlproject:develop Feb 7, 2026
9 checks passed
@lvb05
Copy link
Author

lvb05 commented Feb 8, 2026

Thanks for the merge! @mlodic @fgibertoni
I also wanted to check if you’re okay with me opening a separate PR to update the documentation related to this change. Please let me know if there’s anything specific you’d like covered there.

@mlodic
Copy link
Member

mlodic commented Feb 8, 2026

feel free to open a PR about it

Abhishek9639 pushed a commit to Abhishek9639/IntelOwl that referenced this pull request Feb 17, 2026
…ect#3127)

* Add update checker management command, settings, and docs

* Format update checker with black and branch update

* Fix linting issues and improve update checker command output

* Fix ruff linting issues

* Restore README.md (remove update checker documentation)

* Fix formatting in update checker management command

* Add persistent update check status model

* Fix trailing whitespace in UpdateCheckStatus docstring

* Use persistent state for update checks and add Celery task

* Add admin GUI notification for update availability and formatting

* Add IntelOwl update check system with model, migration, scheduler and unit tests

* style: fix import ordering per ruff

* fix: apply black formatting on tasks.py

* fix(update-checker): safe lazy imports and robust version handling

* fix(update-checker): prevent duplicate notifications and improve version handling

* Restore intel_owl/tasks.py to upstream version

* Add automated update check system with celery task, model, command and tests

* fix: use __latest__ for django_celery_beat migration dependency

* Fix migration 0072: use literal 'days' instead of IntervalSchedule.DAYS in historical model

* Fix update-check notifications to work correctly with transactions and tests

* Fix update checker tests to use UserEventQuerySet notifications and immediate execution in testing

* Apply Black formatting after rebase

* Fix ruff formatting issue in commons settings

* Fix ruff formatting

* .

* .

* Add system update panel and API endpoint

* Fix lint issues and adjust tests

* Add system update panel UI and fix lint/format issues

* Fix Prettier formatting for update checker components

* correct formatting and comments

* system update notification show up on Home

* style change in notification

---------

Co-authored-by: Daniele Rosetti <55402684+drosetti@users.noreply.github.com>
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.

Add update checker

4 participants

Comments