Is it possible to check if a Github user has published a new gist? - github

The Github gists feature is interesting to me because it provides a facility to publish things that are of interest but may not rate a new repo, like snippets of useful code. I would like to follow a user's gists and know when a new gist is published, but I see no way to do that in the web user interface. Is this possible?

Yes, this can be done, but you have to use the combination of the Github Gist API and a bit of coding. One example of how to do this is here, using Python. This utility lets you query a Github user's gists, and creates a small file with the timestamp of the latest gist. When you run the query again it checks to see if there are any newer gists and lets you know, then updates the file with the new timestamp.

Related

Where does Azure DevOps wiki store comments?

Azure DevOps includes a Wiki feature for all projects. The wiki content is stored as a git repository, with a .md markdown file for every page. You can clone the repository and look at how it is organised. All pages in the wiki allow users to submit comments - clearly these must be stored somewhere, but where? They do not appear in the wiki repository.
Unfortunately, we haven't sort it into any history and it only relevant to Wiki page until now. This comment feature is being implement but haven't supported from UI.
As of today, what we provide is view the comments content from UI, or get them from API:
Get https://dev.azure.com/{org name}/{project name}/_apis/wiki/wikis/{wiki name}/pages/{page id}/comments
In fact, the backend data structure has been built, but we haven't provide the corresponding UI to public. So, with above api, you can not only get the comments you want, but also record the modification history of the comments.
Personally, it sounds a good idea about putting comments into source control since it not only records some important conversation about current wiki, also has representation about its development process.
Much recommend you can share your idea here, it is the official forum that our Product Group reviewed.
You can share the suggestion ticket link here, I'm sure I would be the first voter on that. Also, there will have other SO users who view this ticket support that.

Uploading source code for specific requirement in github

I have heard that, product based companies will look for what we have done outside of projects and also looking for the github profile.
In the meantime, I have created an automation application which addresses the specific requirement (Timesheet) in our organization. So, I thought of uploading this one too.
I have also done the screen cast and uploaded it to YouTube for adding in the profile (Resume).
This exact tool is not useful for all the people , but useful for the people in our organization, in which they can edit/contribute more.
Now I am having the question like, can I upload this kind of the code to GitHub?
Thanks.
Yes, you can.
Code on GitHub does not have to be useful to other people. You can push code there even if it is only useful to you or people in your organization.
You could also use a private repository if you do not want other people to see the code.
See: https://github.com/pricing

Make Jira links clickable in Github

Is there a way I can make Jira ticket id's on Github link to Jira? (much the same way as how it happens on Bitbucket).
Maybe there is a plugin or something I could use ?
EDIT:
I specifically want ticket id's in Github to link through to Jira, this is not described in any of the resources below:
How do I connect github to JIRA?
https://confluence.atlassian.com/display/BITBUCKET/Linking+Bitbucket+and+GitHub+accounts+to+JIRA
https://help.github.com/articles/integrating-jira-with-your-projects/
Update 2022:
Dusan Plavak mentions in the comments that, as of today (Q1 2022), you can also import / automate creation of autolinks via github api.
You can also use gh api:
gh api repos/octocat/hello-world/autolinks \
-f -q 'key_prefix:key_prefix url_template:url_template'
And since July 2022, you also have autolinks with alphanumeric IDs (for instance for a Trello card URL: https://trello.com/c/3eZr2Bxw).
2019: No need for Chrome plugin, Safari hack or scripts.
From October 2019, GitHub can automatically transform TICKET references to Jira links, for example.
See "Save time linking resources with autolink references" from Lars Schneider.
Now you can set up an autolink reference and GitHub will automatically create links (to external systems) for you.
How it works
If you use GitHub with external services (like Jira), you might be familiar with shorthand references (like TICKET-123) to point to resources in those external systems.
Starting today, GitHub can automatically transform shorthand references into clickable links for GitHub Pro, Team, and Enterprise plans.
So not the regular github.com.
To enable this feature, a repository admin needs to register the reference prefix (such as TICKET-) in the settings.
Afterwards, references of that type are detected in issues, pull requests, comments, or commit messages, and turned into links.
This speeds up navigation between GitHub and external systems.
See documentation.
Note that the ticket prefix is not included in the hyperlink despite being included in the anchor text. The URL preview in the setting is accurate:
The animation in the feature announcement, replicated above, shows this limitation but not clearly.
This means that you have to either include the project key in the target URL as well or prefix all project keys with a another key and use that as the autolink prefix.
You cannot even use Git's trailers to reference tickets and use autolinks, because trailers are key-value pairs separated by : (colon space) and an autolink prefix that ends with a space is invalid.
I decided to make a Chrome extension for this ! This extension works on all websites, not just Jira ! :D
Install it here:
https://chrome.google.com/webstore/detail/jira-hotlinker/lbifpcpomdegljfpfhgfcjdabbeallhk
Source code:
https://github.com/helmus/Jira-Hot-Linker
If you mean the commit message for commit e0d9e32 shows TEST-1234 Fixed this really bad bug and you want TEST-1234 to link to http://www.your-jira.com/browse/TEST-1234 then no it does not look like this is possible.
You could look to do a Chrome/Firefox browser plugin that accomplishes the behavior you desire. (Scans the webpage looking in certain sections for JIRA Key's and then updates them to links)
I wrote a site specific Safari hack. It requires you to install it yourself, but that gives you the opportunity to read the code (it's short!) first. https://github.com/unicode-org/icu-jira-safari
it fetches elements of class commit, gh-header-title, and js-issue-row with getElementsByClassName()
then, for anything such as ICU-1234 (our Jira project id), it creates a link to the appropriate URL on the Jira server.
I wanted to include Jira issue status as well, but Atlassian Cloud CORS settings prevent that.
Here is an example if the linkification (ICU-10464 turns into a link on the right hand side).
Someone made exactly what I wanted coming from gitlab.
https://chrome.google.com/webstore/detail/linkify-jira-issues/ekbbnaokafbanjgmcbllligemhiclbcb
This updates the text in my github PRs to convert them in clickable links.
I made a super simple Chrome extension for this. It simply adds a link to the relevant JIRA ticket on your Github pull request page in a non-obtrusive way (See screenshot below)
Install it here: https://chrome.google.com/webstore/detail/github-to-jira/dhnagjladcclacjnccpnibdmkljidnhl?hl=en-GB
Source code here: https://github.com/mfalade/github-to-jira
While Github Autolink is an awesome solution, this is easier to use for the following reasons.
You don't need to provide a description with ticket number for this to work. It automatically derives ticket number from your branch name.
You don't have to configure anything on the Github admin page. Perfect for users who don't have admin privileges
You can work on multiple projects or teams more easily. Supports multiple ticket prefixes.
This extension works for all project management tools you might want to link to

How can I backup Github bugtracker?

How can I easily backup & restore bugtracker of project on Github? Repository itself is obvious, wiki is also a git repository - but what about bugtracker?
I want to fully backup bugtracker (tickets, attached imaged, labels, comments, images attached in comments, dates of creation and closing of tickets etc) with ability to recreate it on github account.
Saving it as editable format would be a good bonus.
I am aware about Github API and that I can make tool like this. But I would prefer to use (optionally improve) existing one.
Existing ones mainly export the issue text, not always their attachments.
github-issues-export
github-to-bitbucket-issues-migration
Those services could be extended with the issue API to export more.
A more complete service is backhub.co, which exports a bit more (but isn't as easily expendable). It is free for public repos.
Update August 2018: vorburger adds in the comments a direct link example of how to use the GitHub Issues API to obtain all comments from a particular issue:
https://api.github.com/repos/JDKMissionControl/jmc/issues/1/comments

GitHub Repo Size Graph

I'd like to see a graph of the total size of a repo over time.
(this is useful as it can help to see if poeple are accidentally checking in stuff they shouldn't, like binaries etc.)
The standard github graphs show lots of interesting stuff, but not this simple metric so far as I can see.
Any ideas?
Have you considered giving a try to the GitHub Archive project?
As stated on the home page
GitHub Archive is a project to record the public GitHub timeline, archive it, and make it easily accessible for further analysis.
GitHub Archive provides downloadable json datasets and also makes its content available via Google BigQuery for easy online analysis (see this document for more information on this topic and sample queries).
Note: GitHub timeline data is available starting February 12, 2011.
Update:
Provided your repository is private, you may have to fallback to the GitHub API and consider the size member. In order to graph, you'd have to trigger a regularly call to the API and locally store the result.
syntax: /repos/:user/:repo [GET]
example: https://api.github.com/repos/libgit2/libgit2