So I’ve started on the previously discussed Redmine plugin to replace Backlogs, and got a feel for what’s possible in Redmine 2 (I want to deploy this to the current instance and disable Backlogs before we upgrade). So now, I want to lay out a spec for the things I’ve heard people want, and make sure I hit most of the requirements (we can, of course, iterate on the plugin in future :P). To be clear, we want to:
- unblock the upgrade path for Redmine (by removing Backlogs)
- standardise on one place for release/version data
EDIT: Now on version 2 of the spec, re-using the Version field
Requirements
- A “Found In Release” field
- This should be
has_many
multi-select, so that we can mark a bug as being present in multiple releases
- This should be
- A “Fixed In Release” field
- This should be
has_many
multi-select, so that we can show which versions the fix has been backported to
- This should be
- A “Targeted For Release” field
- Single-valued, show the current target for an open bug
- Updated to
$next-release
over the API via the release-notes script- Could potentially use the Fixed-In release on Status=open bugs
- Otherwise reuse the Target Version field from Redmine Core
- API endpoints for tool-belt and release-notes
- Seems to mostly involve gathering issues for a given release and then using/updating the data for those issues
- Storage for old Version Sprint / Backlog bug data?
Spec
The Version field is most suitable for this, however over time that’s ended up being used for Sprint/Backlog data. I’d like to reclaim this for it’s intended purpose (versions of Foreman or a Plugin).
- Add two
has_and_belongs_to_many
relationships betweenIssues
andVersions
- One to hold
fixed_in
relationships - One to hold
found_in
relationships
- One to hold
- Add two tables to hold the HABTM data
- The
show
page needs to display the multiple versions selected - The
edit
form needs multi-select inputs (found-in
should filter onstatus == 'open'
)
- The
- The issues API is very hard to extend from a plugin (would probably involve
alias_method_chain
) so we should probably write a new API and update the external tooling/releases/id/fixedin/issues.json
should return the list of matching issues withfixed_in.includes? release
- This would allow the changelog / release-notes updates to be simplified
/releases/id/targetversion/issues.json
should returnissues.where(:release_id == release.id)
- Simplifies the mass-update at the start of a new cycle
/releases/id/foundin/issues.json
- not sure if we need it, but for completeness…
- Permisisons - it’s easy to accidentally unselect in a multiple_select field (if you don’t Ctrl-click)
- Should default to append-only
- Developers / admins can overwrite the entire array of versions on submit
Options
- Do we need a separate Target Version field?
- Fixed-in could read “targeted for” if Status == Open
- Could be hard to mass-update from the tooling when we start a new release
- The “Target Version” for a project is a single-select field
- This fits the Target Version usecase above
- Second option if this doesn’t work through the fixed-in / targetted for field
- The “Found in Release” custom field is currently used for some data (although it’s not multi-select)
- Presumably we’d want to write a one-time migration for this to Versions, and remove the custom field?
- Likewise obsoletes the “found in Katello release” field as Versions can be per-project?
- The Versions from Foreman are shared with subprojects, so Katello would see them. To avoid this we could:
- Move Katello to a top-level project (I can’t see a problem with this), or
- Don’t share versions with children, and re-create the versions per-child (e.g. the installer, the proxy, etc)
Current code: GitHub - theforeman/redmine_release_fields: Redmine plugin to expose multi-select Found-in and Fixed-in fields