todogroup / gh-issues

A curated set of issues related to GitHub and running corporate scale open source
http://todogroup.org
26 stars 4 forks source link

Allow setting default account email per organization #32

Open willnorris opened 8 years ago

willnorris commented 8 years ago

You can set multiple email addresses on your GitHub account, and can route notifications on a per-org basis. However, when you create a commit through github.com (either through the web editor, or merge commits generated by the green merge button), the commit is always authored by the user's default email address (unless of course they have email privacy enabled).

I would like to be able to set the default email so that any changes made in a github.com/google repo always uses my @google.com email. (This is particularly important for us because we want employees to always use their work email address for Google repos)

bpapa commented 6 years ago

Would love this because it's broken a key workflow in our org. We're using Xcode server, and the "Big Screen" web view for CI Reports makes it look like we have more team members than we actually do, because some of our commits are from our local machines and some are merges done using the Web UI.

adam-arold commented 6 years ago

Bump. Is there some progress with this? I dont want to have to maintain more than one GitHub profile if I can help it but without this I have to. Is there a solution for this?

clarkbw commented 6 years ago

Hold tight, something is coming

damienjbyrne commented 6 years ago

Any progress on this? This is a feature I'd really like to have.

benbalter commented 6 years ago

I would like to be able to set the default email so that any changes made in a github.com/google repo always uses my @google.com email.

Please excuse the lack of update while @clarkbw is away, but just discovered this issue, @willnorris and wanted to point you to https://blog.github.com/changelog/2018-05-03-choose-commit-email/.

As of May, you can choose the email used for web-based commits on the blob editor. It will default to the last email used to commit to the repo, and if you haven't committed before, your org-specific email.

Due to UI complexity and frequency of use, we scoped the feature to just blob edit commits, so merge commits are unaffected at this time and continue to be authored by your primary email.

adam-arold commented 6 years ago

I think for most of us the main point of this feature is to have a separate email for merging pull requests. This is literally true for everyone who has a GitHub account for personal use and wants to use it at the workplace which also uses GitHub.

Having the ability to choose an e-mail for web-based commits is nice I guess, but completely useless for this scenario since I use the web interface both on personal and company projects.

I think the only solution for this problem is an org-based e-mail address separation.

jackowayed commented 5 years ago

I just wanted to chime in and say that I've built a tool for my organization that is creating and merging PR's via the API, and we have the same issue. It's exacerbating our existing problem with people committing with personal emails from manually merging PR's.

So I hope that when someone takes a look at doing this for PR's, they keep the API in mind. (Or maybe do the API sooner because there isn't the same UI complexity? 😃)

dipla65 commented 5 years ago

Hi, How can i change the content in the email on a timebank application? Is anyone able to help. Many thanks

adam-arold commented 5 years ago

@clarkbw can you elaborate on that something which is coming? @benbalter any ETA on the fix?

benbalter commented 5 years ago

@adam-arold I believe @clarkbw may have been referring to https://blog.github.com/changelog/2018-05-03-choose-commit-email/, which solved (I think) the problem @willnorris described initially, at least in terms of web edits.

Building on that, https://github.blog/changelog/2019-01-23-limit-organization-email-notifications-to-verified-domains/ further segments personal and corporate email.

The last remaining step, at least in terms of this thread, would be the ability to choose your merge commit email. While I can't promise a specific date, it's one of our top feature requests, and I'm optimistic it should be implemented in the coming months.

adam-arold commented 5 years ago

Nice, thanks!

ehartung commented 5 years ago

@benbalter The feature you mentioned is about setting the commit email address per account, but the issue is about setting a default email address per organisation. This is especially important with GitHub Enterprise Cloud when you can use your account for private development (personal email) and professional work (company email).

benbalter commented 5 years ago

setting a default email address per organisation.

@ehartung are you able to elaborate? Are you concerned about personal emails being used for notifications? For web commits? For commits pushed via command line? Something else?

ehartung commented 5 years ago

@benbalter it's about having my personal email address for merge (web) commits (after PR) for private projects and my company email address for merge commits for business projects (in the GitHub-Org of the company I work for)

ehartung commented 5 years ago

... when I talk about "business projects" I mean, non-open-source projects in private repositories (GitHub Enterprise Cloud)

benbalter commented 5 years ago

it's about having my personal email address for merge (web) commits (after PR) for private projects and my company email address for merge commits for business projects (in the GitHub-Org of the company I work for)

@ehartung thanks for clarifying. Please see my comment above:

The last remaining step, at least in terms of this thread, would be the ability to choose your merge commit email. While I can't promise a specific date, it's one of our top feature requests, and I'm optimistic it should be implemented in the coming months.

As a first pass, we'll allow users to choose any verified email to use for merge commits (as we do for web edits), defaulting to the last email used in the repository, or the organization-specific notification email, if one is set. For most cases, this would default to the corporate email in business projects and their person email in personal projects. The next step would be to allow organization admins to enforce that the corporate email is used for merge commits, which is on our roadmap as a subsequent follow up after the ability to choose the merge commit email.

ehartung commented 5 years ago

@benbalter Thanks! Having the ability to choose the email address for merge commits would be great.

timoreimann commented 5 years ago

I believe https://github.com/isaacs/github/issues/95 is asking for the very same feature.

ishepherd commented 5 years ago

Ping. Please can you update us on the ETA, @benbalter ?

numbsafari commented 5 years ago

Will the ability to specify a default account per-organization be something that only applies to the Enterprise cloud, meaning that it's yet another reason not to host an open-source project on github.com, or will it be something that is available for regular github.com organizations?

benbalter commented 5 years ago

Please can you update us on the ETA

I can't promise an exact timeline for general availability, but for those that are members of the Maintainer's Early Access Program, you should expect access to a private beta within the coming week.

Will the ability to specify a default account per-organization be something that only applies to the Enterprise cloud

Per my comment above, as we do with commits from web edits today, if you have multiple verified emails, you will be presented with the option to choose your merge commit email (on all repos). We'll try to anticipate the email you'd like to use (the default in the dropdown, which you can change), based on your prior commits to the repo, or if this is your first commit, your notification email for the organization, if one is set. This will similarly be available on all repositories.

Building on that, down the line, we might offer organization admins the ability to restrict which emails can be used for merge commits (e.g., requiring an email in the organization's verified domain be used, and only listing those email in the dropdown). That's a bit further down the line, as we wanted to get the ability to choose your merge commit email out first and in your hands, along with several other improvements, and haven't yet decided if the ability to restrict merge commit emails will be limited to organizations on the Enterprise Cloud plan.

benbalter commented 5 years ago

for those that are members of the Maintainer's Early Access Program, you should expect access to a private beta within the coming week.

If you are a member of the maintainer's early access program, please see https://github.com/maintainers/early-access-feedback/issues/235.

benbalter commented 5 years ago

Thank you all for your thoughtful feedback. You can now choose the author email for commits created when merging pull requests via the web. For more information, see https://github.blog/changelog/2019-04-24-choose-your-merge-commit-email/.

LilyMGoh commented 5 years ago

@benbalter Is there a way to set the organization default email so that I don't have to select from the dropdown every time? Thanks.

benbalter commented 5 years ago

Is there a way to set the organization default email so that I don't have to select from the dropdown every time?

@LilyMGoh the drop down will default to the last email you used to commit to the repo, defaulting to your organization notification email if this is your first commit, meaning ideally, it should default to the email you'd like to use for the repo, or will after your first use, without needing to manage an additional setting.

LilyMGoh commented 5 years ago

@benbalter It's a bug then.

ghost commented 5 years ago

@benbalter It's a bug then.

I agree. Would be nice to be able to set the organization's default email for every repo under such org.

tylerstillwater commented 5 years ago

The drop down does not remember the last setting I used for the organization. It always resets to my default github email account.

benbalter commented 5 years ago

@tylerb are you able to share the steps you take to see that? I just tried to reproduce it and wasn't able to under the following conditions:

  1. As a user with two verified emails, A and B
  2. Set primary email to email A
  3. In an org owned repo, edit a file via the web editor
  4. See that it defaults to email A
  5. Select to commit with email B and commit
  6. Edit the file again
  7. See that it defaults to email B
  8. Create a pull request
  9. See that the merge box defaults to email B

Are you doing something differently? Would love to better understand what's going on so that we can fix it. Thanks!

tylerstillwater commented 5 years ago

Certainly:

  1. As a user with two verified emails, A and B
  2. Set primary email to email A
  3. Create a local branch
  4. Commit some code
  5. Push to a new, remote branch
  6. Open a PR
  7. Click "Squash and Merge"
  8. See that the dropdown shows email A
  9. Choose email B
  10. Complete the merge
  11. Run steps 3 through 7
  12. See that the dropdown still shows email A
benbalter commented 5 years ago

Commit some code

@tylerb Is it possible that the local commits are authored with email A? If so, would you expect the squash and merge button to change the author email by default?

tylerstillwater commented 5 years ago

@benbalter That may be true, yes. However, the local commits in the PRs I'm working on are created by various members of my team, then I am the one who does the squash and merge from the feature branch into the main branch.

mattt commented 5 years ago

@benbalter Thanks so much for the ability to configure email addresses for merge commits — this is really helpful! Would it be possible to extend this functionality when resolving merge conflicts on GitHub.com? Currently, it doesn't look like there's a way to select a different email from the primary / default address associated with your account.

benbalter commented 5 years ago

Currently, it doesn't look like there's a way to select a different email from the primary / default address associated with your account.

That is correct. Due to limitations in the user interface, for this iteration we chose to display the email that will be used to resolve merge conflicts via the web UI, but hope to make that configurable in a subsequent iteration. Thanks for the feedback!

benbalter commented 5 years ago

@tylerb dug into this a bit more and wanted to share two scenarios where I believe the drop down may not reflect the last email used in the drop down:

  1. When after merging, commits are pushed to any branch using a different email.
  2. When squash merging another user's pull request

The reason for both is that we look for the most recent commit, on any branch, that you authored.

If you've authored other commits since the last merge via the web interface using another email, those commits will override the preference.

Similarly, if you squash merge another user's pull request, the actor is set as the committer and the PR author is set as the commit author (for proper attribution), in which case the email you selected via the dropdown for that squash merge (of another user's pull request) would not be preserved and it would default to your most recent authored commit or your per-organization notification email, if set.

/cx https://github.com/isaacs/github/issues/95 for a similar discussion.

tylerstillwater commented 5 years ago

@benbalter perfect! That really helps me understand why it's happening so I can get the behavior I want. Thanks for your help and time on this!

waldyrious commented 5 years ago

Would it be possible to extend this functionality when resolving merge conflicts on GitHub.com? Currently, it doesn't look like there's a way to select a different email from the primary / default address associated with your account.

That is correct. Due to limitations in the user interface, for this iteration we chose to display the email that will be used to resolve merge conflicts via the web UI, but hope to make that configurable in a subsequent iteration. Thanks for the feedback!

For the record, it seems to also be impossible to change the committer email when rebasing a PR.

I just had this problem when merging PRs via rebase in an organization repo, and the only way to make the committer email reflect the email associated with the organization was to change the primary email of my account, merge the PR, and then change it back (hopefully that preference will now be preserved for future rebase-based merges). Looking forward to have the ability to select author/committer email in the UI in more cases.

vividn commented 5 years ago

For your local repos make sure to associate your work email with the repo so that commits you push remotely will have the correct associated email. Then the dropdown will be correctly associated with your work when doing a PR. git config user.email myworkemail@workplace.com

fleetofthemalden commented 4 years ago

I am unable to see a dropdown. Just text saying it will be associated with my primary email even though all my commits thus far have been for my org email.

vividn commented 4 years ago

@fleetofthemalden, are your other emails added and verified in your settings on github.com? github > settings > emails other than that :man_shrugging:

fleetofthemalden commented 4 years ago

Yep. Added, verified, all commits are from the alternate (work) email, but the web UI is informing me that the merge commit will be made with my primary (personal) email, and no dropdown is available.

@fleetofthemalden, are your other emails added and verified in your settings on github.com? github > settings > emails other than that 🤷‍♂

GMNGeoffrey commented 4 years ago

A similar issue I'm running into is that when pulling down GitHub PRs via the API. The GitHub generated merge commit for a PR always uses the primary email address. That means that even if I have a PR with a single commit that uses one email, the GitHub generated merge commit uses another email

$ git log -1 origin/pull/142/head
commit de7bae8fbb961a6dce3d8aa9a648aaa935ddf773 (origin/test-pr-1, origin/pull/142/head, test-pr-1)
Author: Geoffrey Martin-Noble <gcmn@google.com>
Date:   Wed Nov 13 14:17:57 2019 -0800

    Test PR

$ git log -1 origin/pull/142/merge
commit 62c3308ca3479bba702cc68f2e56737a85de905b (origin/pull/142/merge)
Merge: 4004638 de7bae8
Author: Geoffrey Martin-Noble <GMNGeoffrey@gmail.com>
Date:   Thu Nov 14 15:48:34 2019 -0500

    Merge de7bae8fbb961a6dce3d8aa9a648aaa935ddf773 into 4004638b935d5dd49aa27507f3371110bd3c174c

More generally, it seems like the approach here has been somewhat piecemeal: "allow setting the committer email in these places", whereas what I (and AFAICT most people on this thread) want is "make all interactions with this organization/repository use this email". I'm having trouble imagining a use case where I want to be able to mix and match which email is associated with a repository or organization.

jlevon commented 4 years ago

There's no API field to allow us to set this when doing a squash merge, as far as I can tell. Is there an issue open on that?

karora commented 4 years ago

The issue for me is when other people in ${private organisation} commit (or whatever) to ${private organisation repository}, and the notifications of them having done that get sent to my personal e-mail address. I want all communication in relation to provide company repositories to go to my private company e-mail, whether I caused the change or not.

GMNGeoffrey commented 4 years ago

The issue for me is when other people in ${private organisation} commit (or whatever) to ${private organisation repository}, and the notifications of them having done that get sent to my personal e-mail address. I want all communication in relation to provide company repositories to go to my private company e-mail, whether I caused the change or not.

That is something you can actually set at https://github.com/settings/notifications. You can set notification email per organization.

benbalter commented 4 years ago

That is something you can actually set at https://github.com/settings/notifications. You can set notification email per organization.

Organization owners can also force the setting for all organization members as well: https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/restricting-email-notifications-to-an-approved-domain

karora commented 4 years ago

@benbalter Thanks! My searching had failed to find that (and found this in preference), and I guess I'd been expecting it to be on the Organisations page of the settings.

jeffmcaffer commented 4 years ago

Can we close this now?

GMNGeoffrey commented 4 years ago

Can we close this now?

The question karora just asked is largely unrelated to the rest of the thread. The core issue remains outstanding

GMNGeoffrey commented 4 years ago

Yet another place where this comes up. When making suggested edits it uses the default email address to populate the "Co-authored-by" tag