Github API Specify Previous Tag - github

I'm trying to figure out how to specify "Previous Tag" via queryparams in the release form automation, or via the Create Release API. Preferably Both.
Here is the feature in the UI documented as step 7 here.
If there is no way to do this - where does one request a feature for github? Ex: Is there a github project for github?
Here are the documentation pages for the two ways to do this:
Automation for release forms - there is no "previous_tag" option.
Create a release API - there is no obvious reference to how to specify previous tag, even though there is a way to specify and tell it to generate release notes.
To repeat the question one more time:
How do we specify the specify the prerelease tag for release note autogen? - if unavailable, where does one request a feature for github?

Update:
There is a separate API for generating the release notes, which accepts the previous_tag parameter.
For the querystring, a feature request is open in the github feedback board. Vote for it go give it visbility, hopefully GitHub will take note and implement it.
Original Answer:
It does not look like you can configure it via queryparameters or the API yet. The documentation you shared seems to confirm that.
GitHub has an open discussion board where you can propose features and they have previously shown that they work on topics that resound with the community.
I don't see a fitting category for "Releases" right now, but you can probably fit it into the categories APIs and Integrations or General.

Related

Gitlab Release json web access

GitHub has a public api that one can access to get current release info, and find the release file (.deb or .tar.gz or .exe, etc) by going to https://api.github.com/repos/[project creator]/[project]/releases/latest
Does GitLab have something similar? I'm working on an automated installer to get certain programs from GitLab that have releases. Using the above api for GitHub, I'm able to get the json info for the current release, and get the url to download the latest release, based on what version I want.
I'm hoping to find something similar in GitLab.
Look no further than GitLab's Release API Docs to start that investigation. It looks quite robust, and I believe you will find it can provide that information.
You can use this API to query for each project, looking for the releases it has. (You could also look for the availability of the project if you are unsure if it is present). Once found, determine the release to retrieve. It's important to note that releases are not always made by a team, so they hopefully are specifically packaging the code into a release for distribution. Additionally, via the API, you can also ensure that the release has specific tags so that if they are using tags, you can focus on specific ones of note, or you can use a more generic approach (e.g. semantic version) to determine which release to retrieve.
Hope that helps. GitLab has a rich API. Take a look.

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.

Release Template for GitHub

Is there a way to add a .github/release_template.md similar to pull requests, so that when you are drafting a new release, it uses the template?
I've seen https://github.com/apps/release-drafter and alike that you can add to your GitHub, but was wondering if this is natively supported.
No. Templates are only supported for issues and pull requests.
As of October 2021, you can now add a .github/release.yml file to do some autopopulation of the release notes:
https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes
Right now it is a bit limited, and needs a bit of extra functionality to become a full template, but I think moving forward that will be the file you'd be looking for in this situation.
It's not quite what you (and I) want but you can use query parameters to pre-populate the create release form:
https://docs.github.com/en/repositories/releasing-projects-on-github/automation-for-release-forms-with-query-parameters
which may be useful if for example you add a "Create Release" link in your documentation.
The same approach could be used to create a "custom tab" that uses the link I think (settings > custom tabs)

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

Changelog generation from Github issues?

Is there a way to automatically generate a change log from Github issues?
Ideally I want to be able to point at a closed milestone and generate either a plain text list of closed issues with their titles or, even better, a list with markup for links to the issues and the title of the issues themselves.
You can try to use Github-Changelog-Generator. (I'm author of this project)
It generates changelog from tags and merged pull-requests.
This script also have a support of GitHub Issues.
This changelog was generated by this script. CHANGELOG.md
Example:
Changelog
1.2.5 (2015-01-15)
Full Changelog
Implemented enhancements:
Use milestone to specify in which version bug was fixed #22
Fixed bugs:
Error when trying to generate log for repo without tags #32
Merged pull requests:
PrettyPrint class is included using lowercase 'pp' #43 (schwing)
support enterprise github via command line options #42 (glenlovett)
This isn't for Github specifically, but through Git you can run the log through pretty print to generate a changelog style html page.
From https://coderwall.com/p/5cv5lg
git log v2.1.0...v2.1.1 --pretty=format:'<li> view commit • %s</li> ' --reverse | grep "#changelog"
You can use the GitHub API to get a list of issues associated with a given milestone.
For example:
curl https://api.github.com/repos/<user>/<project>/issues\?milestone\=1\&state\=closed
replace <user> and <project> with the username and project and this will return a json list of all closed issues of the milestone with the id 1. You can then, for example, use a script to extract the information you are interested. Here is a python example that prints the list of issues as restructured text:
import json
with open("issues.json") as of:
data = json.load(of)
for issue in data:
t = issue['title']
n = issue['number']
url = issue['html_url']
print "* %s [`Issue %s <%s>`_]" % (t, n, url)
See if the following tool will do for you github-changes.
Disclosure: I'm the author of the tool.
We created an open source project to generate changelog from the list of closed github issues since a given datetime. It's available here: https://github.com/piwik/github-changelog-generator
Not directly through GitHub: that would be a kind of hook that you could put in place, and which would based on naming convention or comment convention that your project might follow.
Even using the issues title isn't always a sure way to generate meaningful change log, unless you review and edit if needed each and every issue title of your project.
In other words, it is very dependent on how you manage your project and not easily generalized to all GitHub repos.
I said as much in a very similar question "Publish a project release (binary/source packages) on Github?".
In addition of a third-party solution (or a GitHub Action like generate-changelog), you might soon Q3 2021, have a native feature from GitHub:
One of the most important parts of the software lifecycle is releasing your code for others to consume.
GitHub Releases will make that even easier by providing compelling and automatic release notes.
When creating a Release, you can click a button to automatically generate release notes.
If you want something more custom, you can a REST API to get the generated release notes and integrate them into your existing releases process.
We also want to ensure that these release notes look amazing when a maintainer shares them and make them easier to discover. We have done a complete redesign of releases to make projects announcements look stunning.
We are surfacing these releases in the feed to increase discovery.
We are also improving the open graph data for releases so they look equally fantastic when shared off of the GitHub platform.
Intended Outcome
Our number one goal is to make it easy for maintainers to create great release notes so more people can discover that amazing work maintainers are doing.
With minimal effort many projects will be able to benefit from detailed release notes.
For maintainers who put more time into their release notes to write editorialized content the intended outcome is that we free up time they are currently spending to maintain custom infrastructure and compile a changelog so they can focus on the most important content for their customers, high quality editorialized content.
Our other goal is to ensure that the release notes look great and are something maintainers and developers are excited to read and share.
How will it work?
The new Releases UI will be able to be enable with feature preview
A new button in the Release creation UI will be able to be pressed to generate release notes from any tag
The generated notes will be able to be configured via a .github/release.yml
A new REST API will allow customers to generate notes at their own convenience to further automate and customize the experience with GitHub actions.
I helped build a jQuery plugin for this recently that uses GitHub issues to communicate app updates directly to the user. The repo can be found here https://github.com/uberVU/github-changelog
Usage is pretty simple:
$(function() {
var $demoChangelog = $('.demo-changelog');
//call the plugin on a dom none
$demoChangelog.changelog({
//give it a repo to monitor
githubRepo: 'uberVU/github-changelog-playground',
});
//manually check for new closed issues
$('.demo-button').on('click', function(e) {
e.stopPropagation();
$demoChangelog.changelog('checkForUpdates');
});
});