Open daira opened 1 year ago
This is essential to fully expose the DAG publically and remove one of ECC's information asymmetries.
I'm keen on satisfying this ticket (as far as the title) and I want to hash out the implementation more. I propose the following variation to @daira's proposal above:
The format is a relation header followed by a bulleted md list of ticket references.
This format is chosen for two reasons:
Relations headers must be an md bolded relation name with a colon on a line by itself, for example **Blocked-By:**\n
The relation Blocked-By
should precede Blocks
if both are present. (This regularity is to help humans navigate/edit.)
Each list item line must be - #<NNN>\n
which is a single ticket reference. Github renders these with titles.
Note: the ticket references chosen are just for illustration and have no relation to this ticket.
**Blocked-By:**
- #42
- #13
- #1
**Blocks:**
- #2
- #3
-would render as:
Blocked-By:
Blocks:
Will this always work well? Can all developers edit the Description to modify links?
Is allowing both Blocked-By
and Blocks
worth it? An ideal tool would always ensure the two sides of the relation are always rendered consistently, but this isn't the ideal tool. So for example ticket A
could have Blocked-By: B
and ticket B
could have no mention of A
(incomplete but consistent), or Blocks: A
(the only consistent option), or Blocked-By: A
(a nonsensical cycle), or both Blocks: A
and Blocked-By: A
.
IMO, it may be worth only supporting the Blocked-By
relation which removes all inconsistency except for cycles (which are mentioned in the original ticket description).
Proposal: allow dependencies to be expressed in the initial comment of a ticket, using the following syntax (case-insensitive).
Note that unlike Zenhub, this doesn't prevent creating cycles in the graph. What I suggest is to render a general directed graph rather than a DAG, but colour the arrows that are part of a cycle in red. This makes it clear that cycles are an error and makes them easy to spot in order to fix them manually.
To detect cycles in a directed graph, use any linear-time algorithm for finding strongly connected components, e.g. Tarjan's algorithm, Kosaraju's algorithm, or the Path-based strong components algorithm.