Github Scheduled Reminders - Some Slack Mentions Aren't Linked - github

We have setup scheduled reminders for one of our teams in GH. When the reminders are displayed in Slack, some of the users' accounts are not linked properly. For those users, it just shows their GH username unlinked. Everyone else (probably 80% or better of our users) has a proper # mention instead of their GH username. I've looked at profiles for unlinked users in both systems and cannot determine a clear root cause.
Has anyone else seen this, any possible solutions?
EDIT: The plot thickens. I'm seeing the SAME USER in the SAME REMINDER both be # mentioned correctly/linked and incorrectly/unlinked. There's a pattern for the affected users:
On the line that prints the PR #, Title, and Owner, the affected users' github username appears unlinked.
On the line that prints the days stale/days old/waiting on list, SOME of the affected users' will be correctly # mentioned and some will not.
Maddening.

For the slack users where this doesn't work, have you tried having them unsubscribe from github using a /github unsubscribe followed by a /github subscribe command again to get github to refresh their slack account information?
I am not sure if the application you are using is a separate application or if it is part of the github to slack integration. If it is, it talks about how your accounts are not linked until this step is performed.
I came across this article here: https://github.com/integrations/slack#configuration
Subscribing and Unsubscribing
At this point, your Slack and GitHub user accounts are not linked. To link the two accounts, authenticate to GitHub using a /github slash command, /github signin.
The /github slash command also accepts a subscribe argument that you can use to subscribe to an Organization or Repository's activity /github subscribe <organization>/<repository>.
unfurl_code
If you originally gave the app access to "All repositories" and you've created a new private repository on GitHub after installing the GitHub integration for Slack, the /github subscribe command will work automatically on your new repository. If you installed the app on a subset of repositories, the app will prompt you to install it on the new repository.
The /github slash command also supports unsubscribe. To unsubscribe to notifications from a repository, use /github unsubscribe <organization>/<repository>

Related

Merge two github accounts

Is it possible to merge two GitHub accounts into one?
I had one work account but would like to merge into a personal one.
I found some details about transferring ownership of the own repos which will merge all commit history etc.
Could anyone please confirm if it will transfer all commit history for any contributions made to another third party repos?
What will happen in the third party repos where I have made contributions from work account after the work account is deleted?
That is what describes "Merging multiple personal accounts"
And its repository transfer process (from the account you want to delete to the account you want to keep) should transfer issues, pull requests, and wikis.
You will need to add the email address you used to author the commits (of the old account) to the account you're keeping.
That way, your old contributions will be preserved.
I logged a support ticket with github and below is the summary:
After deleting work account and following steps as mentioned https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository did not bring contributions across to the personal account.
As work account was deleted - it started showing as a ghost account.
The commits made through work account were as from the personal acccount but contribution history (PR or any reviews) didn't come across to the personal account.
So make sure you think of above steps before removing any of your Github account.
Below were responses from Github:
As pull requests, issues and all activity in the GitHub web UI excluding commits are directly tied to the account that created them, they will not be counted on the new account even if you add the old account's email address to the new account.
Pull requests are replaced with the ghost user when the account is deleted. On the other hand, we read the email address from the metadata stored inside a commit and attempt to match commits up with a user account, so those that meet the contribution criteria will be counted on the new account.

GitHub / GitLab access upon request

In GitHub or GitLab, to invite a collaborator, the administrator usually asks the collaborator's email.
Instead, how can the administrator allow anyone to request access through clicking a button on the GitHub / GitLab website?
I remember this was possible on at least one of these websites.
In GitLab, you can click on request access:
An email is sent to the most recently active project maintainers. Up to ten project maintainers are notified. Any project maintainer can approve or decline the request.
If a project does not have any maintainers, the notification is sent to the most recently active owners of the project’s group.
If you change your mind before your request is approved, select Withdraw Access Request
The OP Dean adds in the comments:
The maintainer can enable this by making the repo public but with visibility restricted to only project members.
With GitLab 15.8 (January 2023), that will trigger:
Create To-Dos for group owners on access request
Previously, access requests to a group appeared only in the Access requests tab in the Group members section.
Now, access requests also appear in the group owner’s To-Do List.
As a group owner, having access requests added directly to your To-Do List can help you manage your tasks more efficiently and add members quicker.
See Documentation and Issue.
And, still with See GitLab 15.8 (January 2023):
Create To-Dos for project owners on access requests
Previously, access requests to a project appeared only in the Access requests tab in the Project members section.
Now, access requests also appear in the project owner’s To-Do List.
As a project owner, having access requests added directly to your To-Do List can help you manage your tasks more efficiently and add members quicker.
See Documentation and Issue.

Limit Github slack integration to only reviews to which I'm assigned or participating

Has anyone figured out how to limit Github slack integration to only reviews in which you are assigned or a reviewer?
I added it to my slack workspace and set the subscriptions thus:
/github subscribe myOrg statuses, reviews
I was hoping to only get my reviews and not all reviews. I can't seem to figure out how to filter down to the items I care about especially as the notification options are: every new message or none.
Install the GitHub Slack integration in your workspace
Go to your github settings reminders
Enable real-time alerts and check the appropriate boxes (which is probably all but Your PR has failed CI checks)
In slack you do not need to subscribe to anything. Doing so will get you all kinds of additional notifications

Subscribing to a git repository on slack

Can someone tell me like I'm 5 on subscribing to a git repository on slack? My google-fu is not giving any answers.
I have five repositories, none of which I'm the owner on. I want a slack notification when there's a push to these repositories. If I type /github help I get a list of commands and it says I should be able to subscribe by "/github subscribe owner/repository"
I'm not sure which people on my team "own" the repository and I'm not sure where this information is in github.
I read somewhere I could just do /github subscribe and paste the full https link, but I get this back
If I click Install button I get a page that says "Where do you want to install slack?"
If I select configure under my github main repo, I get this:
If I start adding repositories, everyone on my team gets an email notification to add slack to github. I don't get an email notification. Nothing happens at all. Then everyone in the company pings me asking me why they're getting slack/github notifications. To prevent further humiliation, I just stopped trying to add the repo. I'd still like to add it though.
I should be able to subscribe by "/github subscribe owner/repository"
I'm not sure which people on my team "own" the repository and I'm not sure where this information is in github.
I just wanted to help with this part, since I recently had to figure that same thing out. The owner is the organization that your repositories belong to. So, lets say you have a repo named "RepoOne". If you click into that repo, the URL in the address bar should show: "https://github.com/[owner]/RepoOne"
So, you should be able to copy the owner and repo name from your URL and use it in the command as follows:
/github subscribe [owner]/RepoOne
Keep in mind, that only subscribes you to the isssues, pulls, commits, releases, and deployments. I like to include the reviews and comments too, so I go with:
/github subscribe [owner]/RepoOne reviews comments

How do I turn off automatic notification subscription for new repositories in a single organization on Github?

When I create a new repository in a Github organization, all the organization owners get automatically subscribed to that repository's notification.
I'm going to be making a lot of repositories for archival purposes. I would like to turn auto subscribe off, not just for me but for everyone in the org. I would also like to avoid sending out the initial "you have been automatically subscribed" email. I can't find anything in the Github API or organization settings to do this.
Hey there, we're just writing to let you know that you've been automatically subscribed to a repository on GitHub.
gitpan-test/Acme-LookOfDisapproval created by gitpan-test-account
Read-only release history for Acme-LookOfDisapproval
https://github.com/gitpan-test/Acme-LookOfDisapproval
You'll receive notifications for all issues, pull requests, and comments that happen inside the repository. If you would like to stop watching this repository, you can manage your settings here:
https://github.com/gitpan-test/Acme-LookOfDisapproval/subscription
You can unwatch this repository immediately by clicking here:
https://github.com/gitpan-test/Acme-LookOfDisapproval/unsubscribe_via_email/blahblahblah
You were automatically subscribed because you've been given push access to the repository.
Thanks!
Go to your profile settings
Click Notification Center
Uncheck Automatically watch repositories
I love gifs so I created one to show how to deal with this issue.
Go to your Settings page on GitHub
Then click at Notifications menu
Just uncheck Automatically watch repositories and you're done.
Peace! ✌️
The apacheflex organization has the same issue a year ago, and their conclusion wasn't too promising:
Try unchecking "Automatically watch" at:
https://github.com/watching
I tried that, I hope it will work, just I was wondering if it can be done
from admin rights in the Apache Flex github repo, that's why I was asking Om
unfortunately there are no Admin settings that lets me do this.
The best approach would be to go unwatch repos you dont want here: https://github.com/watching, like Jose mentioned.
This seems to be a per user setting and not a per organization setting.
You might also uncheck the 'Automatically watch' setting if you dont want to do this every repo that gets created.
Not ideal, but this is the best option we have for now.
This seems to be confirmed by the OP Schwern as detailed in the comments:
I contacted Github tech support and they said much the same thing, to turn off "Automatically watch".
Unfortunately that must be done per org member and it's a global option, not specific to the org.
To stop receiving notifications on some of the repos that you have been added to, simply visit this url https://github.com/watching and uncheck/unwatch all the repos you don't want to receive notifications from.
Hope this helps.
Check out github-watchlist
It allows regular expression based mass subscribing and unsubscribing for repositories.
Github-watchlist
I'm almost 8 years late but this can be handy.
# Make sure the personal access token has access to notifications & repo
GH_TOKEN=<TOKEN-HERE>
ORGANIZATION=<ORG-NAME>
MAX_REPO_COUNT=5000
repolist=$(GH_TOKEN=$GH_TOKEN gh repo list $ORGANIZATION -L $MAX_REPO_COUNT --json name --jq '.[].name')
echo $repolist | while read repo; do
echo "Unsubscribing from $ORGANIZATION/$repo\n"
GH_TOKEN=$GH_TOKEN gh api -H "Accept: application/vnd.github+json" /repos/$ORGANIZATION/$repo/subscription --method PUT -F ignored=true | jq '.'
done