Learn more about these different git repos.
Other Git URLs
The Pagure deployment that I'm managing contains repos that have lots of branches, e.g. product-X.1, product-X.2, product-X.3 etc; product-X.Y+1 is branched from product-X.Y on creation.
I have a mechanism that adds CI results to these commits as flags and I came up on a problem. It sometimes happens that developers add a commit with the same hash to multiple branches. This means that CI results coming in for a single commit hash are meant for different product versions. Pagure can't handle this situation right now, so only the latest CI flag from a particular CI system is displayed on every commit in all branches.
Therefore I'd like to propose adding branch name as an optional attribute of the CommitFlag object. The logic that displays flags would, for a certain commit:
CommitFlag
I'd be happy to contribute the code that would do this. I hope this makes sense.
We could do that, another way I can think off is splitting your CI results into different CI system: Commit passed CI <branch foo>, commit passed CI <branch bar>. Since you control the "name" of the CI system when adding the flag that should work, no?
Commit passed CI <branch foo>
commit passed CI <branch bar>
But that would display all results of tests on all branches when displaying commit list of any branch, wouldn't it?
Yup, but that's also a valid representation of things: that commit passed (or not) CI on all these branch.
Huh, never thought of it this way. I'd expect that the commit results displayed on a list of specific branch to be for that branch... Why would I be interested in results from other branches?
Ah, maybe I'm starting to understand your point. My proposal for where to show what was meant for the page with list of commits for specific branch - there we should show only results that are related for that specific branch. On a page with that specific commit, we should definitely display results for all branches (perhaps in sections).
Ok, I can get behind this :)
:thumbsup:
So I'm running into a design issue that I'd like to discuss first:
I added a branch = sa.Column(sa.Text(), nullable=True, default=None) attribute to CommitFlag - it should be None when related to no branch and a string if related to a specific branch. Now I'm trying to adapt e.g. /api/0/<repo>/c/<commit_hash>/flag to be able to work with branches. I want to add an optional ?branch=value argument, but I'm struggling with what value it should have for these two cases:
branch = sa.Column(sa.Text(), nullable=True, default=None)
None
/api/0/<repo>/c/<commit_hash>/flag
?branch=value
branch
Basically I guess we could say that for the first case, you must not specify the branch parameter at all, but what do we want to do with the second case? There's no special "null/None" value. Do you think this should have a special value to pass to branch?
Alternatively, a good solution might be returning the flags with branch = None always (e.g. even if ?branch=foo is specified), hence considering them implicitly associated with any branch (this would mean that it wouldn't be possible to get just a list of flags unrelated to specific branch).
branch = None
?branch=foo
WDYT?
I want to get all flags regardless of branch value
Then don't specify the branch value, it'll return all the flags.
I want to get just flags that are not related to any specific branch
Then don't specify the branch value, it'll return all the flags and you get to filter out, client side, the ones that are associated with a branch.
Does that make sense?
The question remains: when requesting the flags for the branch foo should we also include the flags not associated with any branches?
foo
I'd suggest we don't by default but maybe provide an extended argument to do so?
extended
Metadata Update from @pingou: - Issue assigned to bkabrda
Ok, thanks for the suggestions.
As for including flags not associated with any branches when flags for a branch are requested, I'd actually prefer always returning also branch non-specific flags. My perception is that I'm trying to get all flags that apply to a commit on a certain branch and the branch non-specific ones do apply as well, so I'd default to returning them too.
@bkabrda your last comment was 4 years ago, can you help me to understand if there was any progress or PR related to this issue since then?
Log in to comment on this ticket.