apache / apache/buildstream

bst show --order alpha splits up elements from junction

Open
#2,041 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
140
Forks
45
Avg merge
1d 3h
Merged PRs (30d)
6

Description

The ordering used by `bst show --order alpha` is based on the comparison operator of the `Element` class. This ordering is based on element name only which means that the junction an element comes from is ignored when searching elements. This means that elements from different junctions get mixed together in the `bst show` output which is confusing.

A better option might be to use `_get_full_name` as the sort key (either in the `def __lt__` in Element or directly in the `bst show` code). I am not sure on the stability promises of buildstream and whether the ordering of `alpha` cannot change (if so could we consider adding a new ordering?).

### References

Comparison operator of `Element` class: https://github.com/apache/buildstream/blob/b8e6876d760641c2b6ccc3e2578eba48d0a33332/src/buildstream/element.py#L315-L316

Sorting in `bst show`: https://github.com/apache/buildstream/blob/b8e6876d760641c2b6ccc3e2578eba48d0a33332/src/buildstream/_frontend/cli.py#L657-L658

Contributor guide

Open the contributing guide

Research direction

Start by reading the Element comparison operator in src/buildstream/element.py and the sorting at src/buildstream/_frontend/cli.py, using the referenced lines as entry points. Reproduce bst show --order alpha with elements from different junctions, then determine whether alpha should sort by _get_full_name and verify that junction elements remain grouped in the output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.