Code Monkey home page Code Monkey logo

nimbug's Introduction

NimBug

  • Nim Semi-Auto Bug Report Tool.

Install

  • nimble install nimbug (No dependencies)

Use

$ nimbug

GitHub Username or Team of the project?: juancarlospaco
GitHub Repository of the project?: nimbug
Issue report short and descriptive Title? (Must not be empty): Can not divide by zero
Issue report proposed Labels? (Comma separated, can be empty): bug,invalid
Issue report 1 proposed Assignee? (GitHub User, can be empty): juancarlospaco
Links with useful info/pastebin?  (9 Links max, can be empty): https://nim-lang.org
Links with useful info/pastebin?  (9 Links max, can be empty):
  • Generates this bug (Fake): #1
  • Real life use case (Real): nim-lang/Nim#13722 (comment)
  • Auto-Detects Git User and Repo of the project you are reporting bugs to.

Compile-Time options

Define defaultUser and defaultRepo then you have a custom Bug Report Tool for YOUR project.

Example:

  • nim c -d:defaultUser=nim-lang -d:defaultRepo=Nim nimbug.nim

Now it reports Bugs directly to https://github.com/nim-lang/Nim/issues

Privacy

  • NimBug does not include any path of your personal folders, and you can see the results on the browser anyway.

See also

FAQ

  • Why?.

I remember Ubuntu years ago come with a tiny script named ubuntu-bug.

  • Why not use --title="foo"?.

The tool is interactive on purpose.

Using all options via arguments will encourage unattended scripts to report bugs.

  • Why not use GitHub API?.

Using it from the API offers no benefit over the URL params, but it requires a valid GitHub Token secret and code to store secrets, requires OpenSSL with -d:ssl, configuration for secrets probably, documentation about how to setup the secrets on the app before use, this is what the API takes:

{
  "title": "Found a bug",
  "body": "Can not divide by zero",
  "assignees": [
    "octocat"
  ],
  "labels": [
    "bug"
  ]
}

Literally the same you can pass via URL.

But if you want it via API for some reason, I will accept the Pull Request.

nimbug's People

Contributors

juancarlospaco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nimbug's Issues

Get git repo-url from current folder

Idea:
Get the git url from .git/config->remote-url instead of asking for "Team"+"Repo". Of course this would not work, if you are working in fork, then go for upstream-url. If the folder is not a git-repo, then ask for "Team"+"Repo".

System Information

{
  "compiled": "2020-03-24T15:43:21",
  "NimVersion": "1.1.1",
  "hostCPU": "amd64",
  "hostOS": "linux",
  "cpuEndian": "littleEndian",
  "getTempDir": "/tmp/",
  "getHomeDir": "/home/user/",
  "getConfigDir": "/home/user/.config/",
  "now": "2020-03-24T16:58:57+01:00",
  "getCurrentEncoding": "UTF-8",
  "getFreeMem": 401408,
  "getTotalMem": 528384,
  "getOccupiedMem": 74096,
  "countProcessors": 4,
  "uname": {
    "sysname": "Linux",
    "nodename": "",
    "release": "",
    "version": "",
    "machine": "x86_64"
  },
  "FileSystemCaseSensitive": true,
  "nimcacheDir": "",
  "ccompilerPath": "",
  "nimpretty": "0.2",
  "nimble": "nimble v0.11.0 compiled at 2020-02-01 09:37:42\ngit hash: couldn't determine git hash",
  "nimgrep": "1.4",
  "nimsuggest": "Nim Compiler Version 1.0.6 [Linux: amd64]\nCompiled at 2020-02-01\nCopyright (c) 2006-2019 by Andreas Rumpf\n\nactive boot switches: -d:release -d:danger --gc:markAndSweep",
  "choosenim": "choosenim v0.4.0 (2019-04-18 22:21:21) [linux/amd64]",
  "gcc": "gcc (Arch Linux 9.2.1+20200130-2) 9.2.1 20200130\nCopyright (C) 2019 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.",
  "clang": "clang version 9.0.1 \nTarget: x86_64-pc-linux-gnu\nThread model: posix\nInstalledDir: /usr/bin",
  "git": "git version 2.25.1",
  "node": "v13.11.0",
  "python": "Python 3.8.2",
  "ssd": true
}

Proposed Labels

idea

Proposed Assignee

  • juancarlospaco

bisect bot

slightly off topic (so feel free to close) but since you have this repo that helps with tooling around issues, just wanted to suggest an idea I've been having (timotheecour/Nim#98 (comment)):

the goal is to automate bisection in github issues to:

  • find whether an issue is a regression or an always existing bug
  • find which commit/PR introduced the regression
  • further reduce

this would work using the following ingredients:

  • github issue trigger that would run a dedicated CI pipeline (see https://help.github.com/en/actions/reference/events-that-trigger-workflows#issue-comment-event-issue_comment)
  • the pipeline would search for a specific section in issue (mentioned in issue template), or simply parsing existing issue template
  • the pipeline would run git bisect to find the 1st commit introducing the bug (if any)
  • the git bisect output would be automatically inserted as metadata on issue (there are API's for that)
  • the author who sent out offending commit gets notified automatically

knowing which commit introduced an issue makes life a bit easier.

This could be usable as a cmdline/library (without github integration) as well as a CI pipeline.
That kind of tool exists in some software companies and is quite useful.

note

draft below

In my ideal world this would work:

  • user submits a bug, following (possibly revised) issue template; a good bug will be minimized, include all relevant context (via your tool, but IMO we can improve it a bit to reduce friction, eg using single cmd, we can discuss this separately)
  • nim-bisectbot (#8) takes over in the background:
  • it gets notified via github API
  • parses issue content to extract info it needs (example code)
  • verifies validity of the bug otherwise it notifies bug author
  • runs git bisect to find 1st offending commit
  • notifies author of offending commit
  • finds which OS the bug appears on (amongst all CI machines), to check if it's machine specific
  • reduces the bug as much as possible, using nim-dustmite (see nim-lang/Nim#8276; it works amazingly well in D, I've saved a ton of time in the past thanks to D's dustmite)

inspiration from brew `brew gist-logs`

I know you mentioned Why not use GitHub API?. but perhaps this is a bit different; i find brew gist-logs quite convenient, and allows to put more information there which would probably not be good to have embedded inside a github issue (eg this could negatively impact search by causing too many terms to point to the output log)

so there could be an analog nimbug gist-logs, with a commandline/API to be determined. Just throwing out this idea, which needs some refinement.

eg output: https://gist.github.com/timotheecour/f7dc4baa86f256695307731e35177dde
each homebrew issue requires it, see https://github.com/Homebrew/homebrew-core/issues/new?template=bug.md

owo

test

.

<textarea> { "wow": 42, "wut": 2 } </textarea>

.

test

[nimbug] Can not divide by zero

This is just a Test.

System Information

{
  "CompileDate": "2020-03-21",
  "CompileTime": "12:38:29",
  "NimVersion": "1.1.1",
  "hostCPU": "amd64",
  "hostOS": "linux",
  "cpuEndian": "littleEndian",
  "getTempDir": "/tmp/",
  "getHomeDir": "/home/juan/",
  "getConfigDir": "/home/juan/.config/",
  "now": "2020-03-21T09:39:40-03:00",
  "getCurrentEncoding": "UTF-8",
  "getFreeMem": 409600,
  "getTotalMem": 528384,
  "getOccupiedMem": 75488,
  "countProcessors": 6,
  "FileSystemCaseSensitive": true,
  "arguments": "",
  "outFile": "nimbug",
  "nimcacheDir": "",
  "command": "c",
  "commandLine": " c --noNimblePath -d:NimblePkgVersion=0.1.0 -d:release -o:/home/juan/code/nimbug/nimbug /home/juan/code/nimbug/src/nimbug.nim",
  "linkOptions": " -lm -lrt",
  "compileOptions": " -w",
  "ccompilerPath": "",
  "cincludes": [],
  "clibs": [],
  "nimpretty": "0.2",
  "nimble": "nimble v0.11.0 compiled at 2020-03-13 08:55:56\ngit hash: couldn't determine git hash",
  "nimgrep": "1.5",
  "nimsuggest": "Nim Compiler Version 1.1.1 [Linux: amd64]\nCompiled at 2020-03-13\nCopyright (c) 2006-2019 by Andreas Rumpf\n\nactive boot switches: -d:release -d:danger --gc:markAndSweep",
  "choosenim": "choosenim v0.6.0 (2020-03-06 18:24:57) [linux/amd64]",
  "gcc": "gcc (Arch Linux 9.2.1+20200130-2) 9.2.1 20200130\nCopyright (C) 2019 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.",
  "clang": "clang version 9.0.1 \nTarget: x86_64-pc-linux-gnu\nThread model: posix\nInstalledDir: /usr/bin",
  "node": "v13.9.0",
  "git": "git version 2.25.1"
}

Proposed Labels

bug, invalid

Proposed Assignee

  • juancarlospaco

Links

  1. https://nim-lang.org

Can't use nimbug in latest devel

Nice works.Thanks!

nimble install nimbug
nimbug

Got error
Error: unhandled exception: value out of range: -3 notin 0 .. 9223372036854775807 [RangeError]

Adtional information:

Ubuntu 18.04.4 LTS

Nim Compiler Version 1.1.1 [Linux: amd64]
Compiled at 2020-04-02
Copyright (c) 2006-2020 by Andreas Rumpf

Btw I think it needs release tag. And it should be metioned what os it supports(It seems not to support windows)

Give a privacy option

The current default output of system includes private details, which I as a default would prefer not to share. An idea would be to provide a commandline param, e.g. -private, where some of the system info would be removed/set to standard values.

That would include:

  • username in getHomeDir, getConfigDir should be removed or set to $USER. Maybe even the whole dir, if users are using a custom path instead of /home.
  • the uname: nodename, release and version.

System Information

{
  "compiled": "2020-03-24T15:43:21",
  "NimVersion": "1.1.1",
  "hostCPU": "amd64",
  "hostOS": "linux",
  "cpuEndian": "littleEndian",
  "getTempDir": "/tmp/",
  "getHomeDir": "/home/user/",
  "getConfigDir": "/home/user/.config/",
  "now": "2020-03-24T17:00:44+01:00",
  "getCurrentEncoding": "UTF-8",
  "getFreeMem": 401408,
  "getTotalMem": 528384,
  "getOccupiedMem": 74080,
  "countProcessors": 4,
  "uname": {
    "sysname": "Linux",
    "nodename": "",
    "release": "",
    "version": "",
    "machine": "x86_64"
  },
  "FileSystemCaseSensitive": true,
  "nimcacheDir": "",
  "ccompilerPath": "",
  "nimpretty": "0.2",
  "nimble": "nimble v0.11.0 compiled at 2020-02-01 09:37:42\ngit hash: couldn't determine git hash",
  "nimgrep": "1.4",
  "nimsuggest": "Nim Compiler Version 1.0.6 [Linux: amd64]\nCompiled at 2020-02-01\nCopyright (c) 2006-2019 by Andreas Rumpf\n\nactive boot switches: -d:release -d:danger --gc:markAndSweep",
  "choosenim": "choosenim v0.4.0 (2019-04-18 22:21:21) [linux/amd64]",
  "gcc": "gcc (Arch Linux 9.2.1+20200130-2) 9.2.1 20200130\nCopyright (C) 2019 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.",
  "clang": "clang version 9.0.1 \nTarget: x86_64-pc-linux-gnu\nThread model: posix\nInstalledDir: /usr/bin",
  "git": "git version 2.25.1",
  "node": "v13.11.0",
  "python": "Python 3.8.2",
  "ssd": true
}

Proposed Labels

feature

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.