JILS-40: Database change indicator



Issue Information

Issue Type: New Feature
 
Priority: Major
Status: Open

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: Jira Issue Listing Script (JILS)
Resolution: Unresolved
Target version: 0.1,
Labels: API,

Created: 2015-12-24 14:25:08
Time Spent Working
Estimated:
 
45 minutes
Remaining:
 
45 minutes
Logged:
 
0 minutes


Description
At the moment, wget based mirrors of a JILS instance need to simply pull a new copy periodically, as there's no programmatic way to identify whether anything's changed without doing so.

Although it doesn't take long, it's a waste of bandwidth, especially as the mtime's of the files on disk will change, so any downstream proxies revalidating against (for example) projects.bentasker.co.uk will need to reacquire pages even if they haven't actually changed.

One solution would be to add a new "API" call, much like the status page.

Any change against an issue will result in an entry in JIRAs worklog, so returning a simple count of entries for the relevant project filter would be sufficient for a client to identify if anything's changed (though if it has, they'd still need to pull everything).

A query along the lines of
SELECT count(ja.ID) AS actioncount
FROM jiraissue AS a 
LEFT JOIN project AS b on a.PROJECT = b.ID
LEFT JOIN jiraaction AS ja ON ja.issueid=a.ID
WHERE b.pkey IN ('JILS');

Would probably be sufficient


Issue Links

Toggle State Changes

Activity


Actually, it seems that query won't take issue creation into account, so needs adjusting to include an issue count.
SELECT count(ja.ID) AS actioncount
FROM jiraissue AS a 
LEFT JOIN project AS b on a.PROJECT = b.ID
LEFT JOIN jiraaction AS ja ON ja.issueid=a.ID
WHERE b.pkey IN ('JILS');

SELECT count(a.ID) as issuecount 
FROM jiraissue AS a 
LEFT JOIN project AS b on a.PROJECT = b.ID
WHERE b.pkey IN ('JILS');


Though that still won't take adding components/versions into account. Not sure if that's necessarily an issue though, as updating an issue to assign it to a component or a version will create an entry in jiraaction. Do we really need to display a version or component before it has anything assigned to it? Simple enough to add additional queries if not I suppose
btasker added 'API' to labels
As of JILS-41 there is a means to identify whether individual pages (limited to Issue pages and attachments at the moment) have changed as Last-Modified and ETags have been implemented (alongside support for conditional requests).

It may be that the considerations that need to be taken for Version/Component pages tie in well with what needs to be considered for this feature.
btasker added '0.1' to Fix Version