github-issue-url 0.1.0

GitHub prefilled issue URL builder
Documentation
  • Coverage
  • 52.94%
    9 out of 17 items documented1 out of 11 items with examples
  • Size
  • Source code size: 54.07 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.13 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 33s Average build duration of successful builds.
  • all releases: 33s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • StudyResearchProjects/github-issue-url
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • LeoBorai

Crates.io Documentation Build Clippy Formatter Tests

Motivation

You can have issue form fields prefilled by specifying certain query parameters in the "New Issue" URL (https://github.com/<User | Organization>//issues/new).

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.

Installation

[dependencies]
github-issue-url = "0.1"

Usage

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());

Release

git tag -a v0.1.0 -m "Release Message"
git push origin main --follow-tags

Contributing

Every contribution to this project is welcome! Feel free to open a pull request or an issue.

License

Licensed under both the MIT License and the Apache 2.0 License.