Support editing `Repo.commit_flags` from admin UI
Categories
(Conduit :: Lando, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: shtrom, Assigned: shtrom)
References
Details
Attachments
(1 external file)
We should define a cleaner data structure for the flags, e.g., at least a namedtuple, so we can have flag.name and flag.description, but we'd need to check that it doesn't wreak havoc in existing data and/or add conversion, and use it throughout the codebase (i.e., flag.name instead of flag[0]).
We'll keep DONTBUILD (and SHIPPING from bug 2064629) as pre-defined selectable values.
Comment 1•4 months ago
|
||
| Assignee | ||
Comment 2•4 months ago
•
|
||
Issue: there is no native widget to edit nested ArrayFields.
Comment 3•4 months ago
|
||
We had to make the flag read-only in bug 1963919, as the field being present caused updates to Repo objects via the admin UI to break. We should ensure reverting to allow editing the field doesn't regress in the same fashion.
| Assignee | ||
Comment 4•4 months ago
|
||
Yeah, I had a jab at this yesterday, and noticed that issue. I suspect we may need to go the same way as the bootstrap and autoformat commands, and use a JSONField. Barring that, I think we'll need a custom admin widget to render nested ArrayField.
Updated•4 months ago
|
| Assignee | ||
Comment 5•3 months ago
|
||
Question: do we need to support custom flags addition from the UI, or just selecting from pre-defined ones?
Comment 6•3 months ago
|
||
(In reply to Olivier Mehani [:shtrom] from comment #5)
Question: do we need to support custom flags addition from the UI, or just selecting from pre-defined ones?
Is there a use case for supporting custom flags? I think selecting from the pre-defined flags would be ideal.
Updated•3 months ago
|
Updated•3 months ago
|
Comment 7•2 months ago
|
||
Question: do we need to support custom flags addition from the UI, or just selecting from pre-defined ones?
Predefined works!
| Assignee | ||
Comment 8•2 months ago
|
||
Ok, so I think we could move this to using JSONArrays like we did for the Hooks https://github.com/mozilla-conduit/lando/blob/9ff2ade06140580519e6e6e23074aa9494250c31/src/lando/main/models/repo.py#L300-L305, with the matching Admin magic https://github.com/mozilla-conduit/lando/blob/9ff2ade06140580519e6e6e23074aa9494250c31/src/lando/main/admin.py#L429-L438
We'll have to be a bit careful with how this alters the existing database format (hopefully not), and make sure me migrate it correctly.
Description
•