Open GlancingMind opened 3 years ago
Unless I'm mistaken, you only need a proper identity to export. That makes sense because you need to add your bridge credentials somewhere to interact with the remote bug tracker.
Maybe your point is that the bridge configuration wizard should allow to optionally not setup credentials? But that would only work with public repo.
Oh I think we are talking about two different thinks. Let me clarify as my first post is a bit ambiguous. The problem I'm referring to is, that imported bug have my identity as author. This means, that those bugs appear to be written by me, but they might not.
Two possible solutions that I could think of:
While importing bugs, identities are created for each participant. Maybe this identities could link to their public user profiles, to make sure, that each identity is unique. This is important, as the MichaelMure on GitHub might be a different individual then MichaelMure on GitLab. By attaching an identity to some public profile, it can be ensured that both identities are different. At least until both public profiles claim to be the same individual.
That's how it should work. Isn't that what's happening for you?
I mean, an importer should create as much identities as needed to have the bug reflect the real history.
When I import the issues of my git-bug fork, they appear as my currently used git-bug identity TestUser. See this issue: https://github.com/GlancingMind/git-bug/issues/20 Notice the author of the Bug, which is TestUser instead of GlancingMind.
Somehow the GlancingMind identity is replaced by the TestUser identity as git-bug user ls
don't display my GitHub identity.
6ac33cd Michael Muré (MichaelMure)
94c90ef timbkr (timbkr)
723b0b4 TestUser
a76df02 Cláudio Silva (claudioantonio)
7d8b135 LenaNoctua (LenaNoctua)
That's definitely a bug. Is that happening as well with the termui?
Yes, the termui also displays TestUser.
WTF :-D
In that case that should be easy to reproduce/debug but what I'm confused about is that our tests should protect against something as obvious.
~Ah. I know where TestUser originates from. It is also used within my git config user.name
.~
~Update: Somehow I got it to work. But I'm not convinced. I'll investigate some more.~ ~Update: I have the feeling, that I never got it to work properly :grimacing:~ Update: I think I know where this behavior comes from. Will investigate further.
Okey got the error. I'll try to explain what happens: The github bridge adds a Metadata field (github-login) to currently used identity. (By doing so the bridge assumes, that my current identity matches the user of my github account.) While importing issues, the bridge checks, if an identity already exists. Otherwise the identity will be created. This is done via a cache lookup, of an identity with the github-login matching those of the issue author.
Problem: The bridge has assigned my current identity (TestUser) the github-login metadata and so the lookup will return the TestUser identity, instead of creating another identity with the name Sascha (my real GitHub identity).
How to solve this problem?
bridge configure
was invoked (TestUser) and the new imported identity from the issue (Sascha).git config user.name
matches the name of the GitHub identity.
This will certainly become a problem, when multiple bridges are used. E.g.
My GitLab account might not have the same username as my GitHub account, yet I have to choose one under which git-bug create bugs.git config user.name
.This is not a bug. My currently currently used identity is an aggregate of all my other identities, which just might have different usernames. When importing bugs, all bugs of my other identities are displayed via my "git-bug" identity. When I create a bug and export to GitHub and GitLab, both should then have the name used for the respective service. Suppose that I have the following usernames:
GitHub -> Sascha GitLab ->Foobar git-bug -> TestUser
Within git-bug, the bugs of my other identities are displayed as "TestUser". After exporting the bugs to GitHub, the author should be "Sascha" and analog for GitLab "Foobar". I think this is a fitting model. Maybe requires some explaining in the ReadMe?
~ I hope that this wall of text is understandable. :grimacing: ~
The github bridge adds a Metadata field (github-login) to currently used identity. (By doing so the bridge assumes, that my current identity matches the user of my github account.)
Correct. This happen at the end of each configurator, with this common piece of code: https://github.com/MichaelMure/git-bug/blob/87b97ca4b2f39240c698596ac14a6d3532f6363d/bridge/core/config.go#L22-L33
Problem: The bridge has assigned my current identity (TestUser) the github-login metadata and so the lookup will return the TestUser identity, instead of creating another identity with the name Sascha (my real GitHub identity).
Ok so the current identity is used as the identity matching the remote account. However, that identity doesn't replace all the others like I initially thought from your report.
So, to me this is more a UX issue. You got confused as to why the github identity got mapped to your current git-bug identity. That's a fair issue but what I wonder is, would have you been confused as well without your docker setup?
There is two scenarios for the bridges:
Scenario 1:
user create
, use git-bugScenario 2:
If you look at the code I linked above, it address those two cases. Either the existing identity is mapped, or a new identity is created.
Now that doesn't mean it's perfect, and there is probably more way to use git-bug.
So what could be done:
However, that identity doesn't replace all the others like I initially thought from your report.
Oh I didn't even consider this, as the imported repository contains only issues created by myself. :-)
That's a fair issue but what I wonder is, would have you been confused as well without your docker setup?
Probably I wouldn't have noticed, as my git config user.name
would likely match my GitHub identity.
But I can think of a case in which this might still have happened. E.g. I have my git-bug fork on GitHub and on GitLab. Suppose that I have the following usernames
GitHub -> Sascha GitLab -> Foobar
My git config user.name
can only match one of both services. Let's say it matches Sascha.
Now importing bugs via the GitHub bridge will result into bugs created by me, with Sascha as author.
Next I import via the GitLab bridge the bugs from GitLab. Those bugs who are created by me, will be displayed with Sascha as author. But if I wouldn't know now better, I would expect those bugs to be displayed with Foobar as author.
Well I know now better and the design of git-bug makes perfect sense. :+1:
- try to be smart and see if the name of the git-bug identity match the github one ... but that would probably introduce more weirdness and confusion
I agree, this seems to be not the right solution.
- ask the user for confirmation before mapping the current identity (scenario 1), otherwise create a new identity
This sound fine to me.
Maybe the git-bug user ls
command could be improved to make thinks more clear. E.g. following output
6ac33cd Michael Muré (MichaelMure)
94c90ef timbkr (timbkr)
723b0b4 TestUser **(This is you)**
|> GlancingMind (on GitHub)
|> Foo (on GitLab)
| ...
a76df02 Cláudio Silva (claudioantonio)
7d8b135 LenaNoctua (LenaNoctua)
Part of my confusion is probably also due to that I thought, my GitHub identity would be a separate one. E.g. similar to this:
000000 Foo (Bar)
6ac33cd Michael Muré (MichaelMure)
94c90ef timbkr (timbkr)
999999 Sascha (GlancingMind)
723b0b4 TestUser **(This is you)**
|> you are also, 999999 Sascha (GlancingMind), on GitHub
|> you are also 000000 Foo (Bar) (on GitLab)
| ...
a76df02 Cláudio Silva (claudioantonio)
7d8b135 LenaNoctua (LenaNoctua)
ask the user for confirmation before mapping the current identity (scenario 1), otherwise create a new identity
.. it is then.
Also agree on the user ls
command, there is many ways to make it less crappy. The good balance is a bit tricky to find though.
Or what could also work, print a message similar to this one after the bridge was configured.
Your git-bug identity "TestUser" has adopted your GitHub identity "Sascha (GlancingMind)". Just for information: Bugs created by your GitHub identity "Sascha (GlancingMind)" will be displayed under your git-bug identity "TestUser".
Also agree on the
user ls
command, there is many ways to make it less crappy. The good balance is a bit tricky to find though.
Let me know, if I should create dedicated issues out of my given example.
A message works but then the user has no way to fix the situation if it's not what he expect. Might as well add the prompt and select the right thing to do.
So, if there is a current user: Is your current identity TestUser the one you want to associate with $login? [Y/n]
Let me know, if I should create dedicated issues out of my given example.
Issues are good, PRs are even better ;) But yes we can discuss first about what to do.
Issues are good, PRs are even better ;)
Sure. Maintainers time is precious :D
This bot triages untriaged issues and PRs according to the following rules:
lifecycle/stale
label is appliedlifecycle/stale
was applied, the issue is closedTo remove the stale status, you can:
lifecycle/stale
labelThis bot triages issues in order to help the maintainers identify what needs attention, according to the following lifecycle rules:
lifecycle/stale
is appliedlifecycle/stale
was applied,
lifecycle/rotten
is appliedThis bot will not automatically close stale issues.
To remove the stale status, you can:
To avoid automatic lifecycle management of this issue, add
lifecycle/frozen
.
Last time I tried, the GitHub bridge imported all bugs with my current user identity (not sure if this also applies to the other bridges). I think it might be better to use a at least a special "bridge" user for importing bugs. This way the user can see, that the bug was imported.
Other idea would be to support a "sync" status field, which contains a reference for each repository a bug was synced with. Then a user could be show a list if each synced repository contains the specific bug.