Where does Azure DevOps wiki store comments? - azure-devops

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.

Related

Display recent activity to a section of the wiki in an Azure DevOps project

We're moving our wikis over to Azure DevOps and want to replicate the 'overview' pages we have for each section of the wiki. This is comprised of a table with links to various files (which was easy enough to create in markdown), followed by a list of recent updates to pages within that section (showing which team member made the update, which page was updated, and the date).
Azure DevOps doesn't appear to let you run queries on wiki pages within a project, which was my initial approach. I therefore need some markdown that will return a list of the above information (say, the last ten updates made to a specified page of the wiki and any of its sub-pages). Is this possible? Or is there a better way to get the result I'm after?
Display recent activity to a section of the wiki in an Azure DevOps project
I am afraid this is impossible at this moment.
If you want to return a list of the last ten updates made to a specified page of the wiki and any of its sub-pages, there is a option View Revisions, which you could get wiki page history:
Revision pages show who made the change along with the revision
message, date, and version or commit ID. To view details of a
revision, select the message or version link.
Check the document View wiki page history and revert changes for some more details.
But we could not get the update list for all wiki pages, just for one specify.
Besides, the functions supported by markdown are limited currently, AFAIK, we could not dynamic Wiki Content, if we need to list the update list for all wiki pages, it should be the dynamic content:
Check the user voice Add dynamic Wiki Content.
The way I can think of is that we could create a scripts to invoke REST API to return the updates made to a specified page of the wiki, then add the result to the markdown in the local, and push the changes to the Azure devops. But this will add a update message in the Wiki.
So, I am afraid this is impossible at this moment.
Hope this helps.
If you want to see recent wiki page changes, look in the DevOps Repos -> Commits page in the GUI.

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

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.

How do I create a "Revision page" with the GitHub API?

I would like to create a "Revision page" where the people can see on what I've been working using GitHub there's an example about what I mean:
It is supposed to show the commits from my GitHub repository.
A) More information is required
Firstly, could you clarify if it is your intention to
Show the Commit history for a single repository, or
You wish to show your commit activity across multiple repositories
Also:
You wish to have this information displayed on Github, or
You
wish to have this information displayed on an external site.
B) Displaying information on GitHub
If the intention is a combination of 1 and 3, then my first suggestion would be to check the existing functionality of GitHub, which has such a feature built-in.
This can be accessed by navigating to your repository, and simply clicking the Commits button. An example of the results can be found here:
Example GitHub Commit History
C) Displaying information on an external site
As you mention that you have limited experience with PHP, I would certainly start by evaluating GitList:
GitList allows you to browse repositories using your favorite browser,
viewing files under different revisions, commit history and diffs.
GitList is free and open source software, written in PHP, on top of
Silex and the Twig template engine.
If you feel confident that you could create your own solution to display the information in an external web page, then you should begin by familiarising yourself with the GitHub Developer Documentation, and specifically:
List commits on a repository
It is also worth examining the following article and existing GitHub project in order to enhance your knowledge:
How to Use Github’s API with PHP (SitePòint Article with code)
GitHub PHP Client (GitHub Project)
It may be that you can clone one of these projects, strip it down to the features essential for your needs, and customise the UI.

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