Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web button to request a rescan #149

Open
mpdehaan opened this issue Sep 20, 2019 · 1 comment
Open

web button to request a rescan #149

mpdehaan opened this issue Sep 20, 2019 · 1 comment
Labels

Comments

@mpdehaan
Copy link
Member

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

@mpdehaan
Copy link
Member Author

see #150 for the web configuration of settings

@mpdehaan mpdehaan added ui feature and removed ui labels Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant