Crates.io | github-issue-url |
lib.rs | github-issue-url |
version | 0.1.0 |
source | src |
created_at | 2021-06-02 01:51:07.551423 |
updated_at | 2021-06-02 01:51:07.551423 |
description | GitHub prefilled issue URL builder |
homepage | |
repository | https://github.com/EstebanBorai/github-issue-url |
max_upload_size | |
id | 405053 |
size | 45,581 |
You can have issue form fields prefilled by specifying certain query parameters
in the "New Issue" URL (https://github.com/<User | Organization>/
For example:
https://github.com/EstebanBorai/github-issue-url/issues/new?
title=Null%3A+The+Billion+Dollar+Mistake
&body=Null+is+a+flag.+It+represents+different+situations
&template=bug_report.md
&labels=bug%2Cproduction%2Chigh-severity
&assignee=EstebanBorai
&milestone=1
&projects=1
This way you can provide a one click "Open Issue" button to your Rust applications, for instance you could have some stack trace, or details read from the host system where your application is running to let the user open an issue on GitHub without the need of specifying system /or application details themselves.
[dependencies]
github-issue-url = "0.1"
To create a URL like the one shown above you must use the Issue
struct included
in this crate, specify the repository owner and the repository name, and then
define the relevant fields such as title, body, template, labels, assginee,
milestone and/or projects, using the "setter-like" methods.
use github_issue_url::Issue;
const GITHUB_ISSUE_LINK: &str = "https://github.com/EstebanBorai/github-issue-url/issues/new?title=Null%3A+The+Billion+Dollar+Mistake&body=Null+is+a+flag.+It+represents+different+situations+depending+on+the+context+in+which+it+is+used+and+invoked.+This+yields+the+most+serious+error+in+software+development%3A+Coupling+a+hidden+decision+in+the+contract+between+an+object+and+who+uses+it.&template=bug_report.md&labels=bug%2Cproduction%2Chigh-severity&assignee=EstebanBorai&milestone=1&projects=1";
let mut have = Issue::new("github-issue-url", "EstebanBorai").unwrap();
have.title("Null: The Billion Dollar Mistake");
have.body(SAMPLE_ISSUE_BODY);
have.template("bug_report.md");
have.labels("bug,production,high-severity");
have.assignee("EstebanBorai");
have.milestone("1");
have.projects("1");
let have = have.url().unwrap();
assert_eq!(have, GITHUB_ISSUE_LINK.to_string());
git tag -a v0.1.0 -m "Release Message"
git push origin main --follow-tags
Every contribution to this project is welcome! Feel free to open a pull request or an issue.
Licensed under both the MIT License and the Apache 2.0 License.