Open Bug 2056752 Opened 4 months ago Updated 2 months ago

Support editing `Repo.commit_flags` from admin UI

Categories

(Conduit :: Lando, enhancement, P3)

enhancement

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.

See Also: → 2056628

Issue: there is no native widget to edit nested ArrayFields.

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.

See Also: → 1963919

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.

Summary: Support editting `Repo.commit_flags` from admin UI → Support editing `Repo.commit_flags` from admin UI
See Also: → 2064629

Question: do we need to support custom flags addition from the UI, or just selecting from pre-defined ones?

Flags: needinfo?(zeid)
Flags: needinfo?(sheehan)

(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.

Flags: needinfo?(sheehan)
Priority: -- → P3
Assignee: nobody → omehani

Question: do we need to support custom flags addition from the UI, or just selecting from pre-defined ones?

Predefined works!

Flags: needinfo?(zeid)

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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: