You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been suggested that the web app have a way to request a repo rescan. This should be pretty easy to add, but presently the UI does not require a login, so for the short term, requesting a rescan will need to be anonymous. Not all users may want to enable this, so we'd need to make it configurable.
We add a setting in settings.py ALLOW_ANONYMOUS_RESCAN_REQUEST (default False) which the user can override in /etc/source_optics/conf.d/*.py). If set, a button and route will be available to request a rescan the next time the scanner loop comes around. As a refresher, per docs, multiple scanners can ALREADY run on different nodes if pointed at the same database, and are somewhat designed to serve different organizations.
So, if this new setting is set, we enable a route and a new button to appear on the repo index page, which is accessed by clicking the database symbol while looking at the repo table.
If clicked, the button sets the rescan request boolean that ALREADY exists on the repo object, which is also already what the webhooks already use today (see INSTALL.md for webhook docs). Basically, it would be just like triggering the webhook.
Then, the user can simply put the scan script on cron (like one would do with the webhook docs as mentioned already in INSTALL.md) - like they probably have anyway, and then crank up the scan threshold in settings.py (most likely overridden in /etc/source_optics/conf.d) so that cron won't run scans on already-been-scanned repos so often, and thus will require using the boolean.
Eventually, I want to consider database configuration (Django admin) of most of these settings, which something like https://django-constance.readthedocs.io/en/latest/ (note: I haven't t tried this at all yet) may help - another ticket on this pending
It's been suggested that the web app have a way to request a repo rescan. This should be pretty easy to add, but presently the UI does not require a login, so for the short term, requesting a rescan will need to be anonymous. Not all users may want to enable this, so we'd need to make it configurable.
We add a setting in settings.py ALLOW_ANONYMOUS_RESCAN_REQUEST (default False) which the user can override in /etc/source_optics/conf.d/*.py). If set, a button and route will be available to request a rescan the next time the scanner loop comes around. As a refresher, per docs, multiple scanners can ALREADY run on different nodes if pointed at the same database, and are somewhat designed to serve different organizations.
So, if this new setting is set, we enable a route and a new button to appear on the repo index page, which is accessed by clicking the database symbol while looking at the repo table.
If clicked, the button sets the rescan request boolean that ALREADY exists on the repo object, which is also already what the webhooks already use today (see INSTALL.md for webhook docs). Basically, it would be just like triggering the webhook.
Then, the user can simply put the scan script on cron (like one would do with the webhook docs as mentioned already in INSTALL.md) - like they probably have anyway, and then crank up the scan threshold in settings.py (most likely overridden in /etc/source_optics/conf.d) so that cron won't run scans on already-been-scanned repos so often, and thus will require using the boolean.
Eventually, I want to consider database configuration (Django admin) of most of these settings, which something like https://django-constance.readthedocs.io/en/latest/ (note: I haven't t tried this at all yet) may help - another ticket on this pending
cc @grayaii
The text was updated successfully, but these errors were encountered: