Bug 15395

Summary: Update Layer button does not display logs and creates two Update records in the database
Product: [Yocto Project Subprojects] Layer Index Reporter: Tim Orling <tim.orling>
Component: Layer IndexAssignee: Tim Orling <tim.orling>
Status: NEW --- QA Contact: apoorv sangal <apoorvsangal>
Severity: normal    
Priority: Medium    
Version: 5.0   
Target Milestone: 6.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Tim Orling 2024-02-09 16:02:09 UTC
When you click on the Update Layer button, e.g. for meta-maker, you see the Task View page but no dynamic log is displayed. Perhaps only when the task completes very quickly, the Success is also not detected.

Previously, the Update Layer button would launch a task view that showed nothing because the layerscelery container on the server did not have the database credentials. This has now been fixed.

From the admin interface, we can see that two Update records are created:

The first one is the actual task and shows the log:
https://layers.openembedded.org/admin/layerindex/update/39273/change/

which shows a proper task view after the fact:
https://layers.openembedded.org/layerindex/task/3ff5cb35-3c45-45f3-b973-353a0763502e/

The second one is empty with no task id and no record of what triggered it:
https://layers.openembedded.org/admin/layerindex/update/39274/change/

The update command is run in
https://git.yoctoproject.org/layerindex-web/tree/layerindex/tasks.py#n40

The update is generated in:
https://git.yoctoproject.org/layerindex-web/tree/layerindex/views.py#n125

Also, we should should double check that the lock is being respected/checked for. If a systemd timer/cronjob update is already running, we should queue the task and wait until the lock is freed. Some UI indication of the wait would be nice.