On Tue, 3 Jan 2023 at 12:49, 'Jesse Glick' via Jenkins Developers <[email protected]> wrote: > > On Fri, Dec 30, 2022 at 8:17 AM Cristian Morales Vega <[email protected]> > wrote: >> >> I am looking at https://issues.jenkins.io/browse/JENKINS-70342, but >> I'm not sure how the "context" in CanonicalIdResolver is supposed to >> be used. The only thing I have seen in the docs is "Can be used (for >> example) to distinguish ambiguous committer ID using the SCM URL". >> >> DefaultUserCanonicalIdResolver, User.FullNameIdResolver, >> User.UserIDCanonicalIdResolver ignore it; and I have not seen it used >> anywhere else, neither giving nor receiving a context. But I'm new >> here, there is no easy way to see all the implementations of >> CanonicalIdResolver in all the plugins, there is? > > > https://github.com/jenkinsci/additional-identities-plugin/blob/f98f43fc8a2b1831779e48cb5355bf1295ce347f/src/main/java/com/cloudbees/jenkins/plugins/AdditionalIdentityResolver.java#L51-L62 > seems to look for it. But it could only come from > https://github.com/jenkinsci/jenkins/blob/9d961dcce5f9e6094d2b9bf38ae4a112a27df4d8/core/src/main/java/hudson/model/User.java#L509-L510 > and I do not recall any code ever passing this argument to `User.get`. I > suspect this aspect of the API was never really developed.
For my simple needs, the additional-identities-plugin actually solves all my issues! >> The use of "idOrFullName" in resolveCanonicalId() also feels a bit >> overspecific? While you could call an email an "id", you could argue >> the same about a full name. > > > Full name would be something like “First M. Last”. It is possible to pass > this to `User.get` to look up a user by either id or full name. In practice > we try to always use `getById`. The id might be something like `flast` or > like `[email protected]` or something else, depending on the `SecurityRealm`. > > The entire system of associating “ids”, full names, and email addresses with > both `SecurityRealm` authentications and SCM commit “authors” in Jenkins is a > complicated mess I am afraid. FWIW I have created https://issues.jenkins.io/browse/JENKINS-70382 -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAGUfO%2ByRmFgt%2B%3DPERobKsLuDs_Utu%3D8tTv0-HVT7Qg8btorfNA%40mail.gmail.com.
