Auto-tracking state is not saved when editing a project

Bug #1449241 reported by Caio Begotti
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Capomastro
Fix Released
Medium
Caio Begotti

Bug Description

Just noticed when you check auto-tracking at the project edit view its state is not really saved? I mean, it's probably saved but it's not restored when you leave then come back to the edit view (it's now wrongly unchecked). I'm not sure yet if it's just an UI problem if its value is not being passed on, which may cause problems with the builds IDs counts, which I'll report in another bug.

Bonus: have a better description of the checkbox in the UI

Related branches

Caio Begotti (caio1982)
description: updated
Revision history for this message
Daniel Manrique (roadmr) wrote :

OK, I confirmed this. To reproduce:

- Create a project. Select any set of dependencies, check "auto track" and create it.
- In the project detail page, confirm that the "auto-track" column says "yes" for your selected deps.
- Click "Edit project". Notice the auto-track checkbox is unchecked.
- Edit something unrelated like the description. Leave "auto-track" alone. Click Submit.

Expected result
- In the project detail page, the dependencies' auto-track column says "yes"

Actual result
- In the project detail page, the dependencies' auto-track column says "No"

Revision history for this message
Daniel Manrique (roadmr) wrote :

in projects/forms.py, the ProjectForm declares the auto_track boolean field but I don't see it being initialized anywhere.

Also, note that auto-tracking is set per dependency; that is, a project could auto-track dependency A but not auto-track dependency B (even though it can depend on both). So auto_track is actually an element in the intermediate ProjectDependency model.

So it's kinda hard to initialize auto_track. Clearly, if all ProjectDependency for this project are set to auto_track, we ought to set the tick mark to checked, and if none are set, then we set the tick mark to not checked. But if some are and some aren't, what should we do?

I don't think the capomastro user-facing UI allows setting autotrack independently for each dependency for a project, so we should NOT encounter the middle case.

I'm attaching a partial patch which fixes the functional part of this bug. What's missing? tests!! (Just didn't have time to do them). I'll set to triaged.

Revision history for this message
Daniel Manrique (roadmr) wrote :
Changed in capomastro:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2015-05
Revision history for this message
Daniel Manrique (roadmr) wrote :

Wow, I think this second patch may be better, it queries on a non-indexed field but given the size of dependency lists for a project this should not be an issue.

Caio Begotti (caio1982)
Changed in capomastro:
status: Triaged → Fix Committed
assignee: nobody → Caio Begotti (caio1982)
Caio Begotti (caio1982)
Changed in capomastro:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.