arcanis.me/projects/_posts/2014-07-27-reportabug.md
2016-02-02 00:55:13 +07:00

7.0 KiB

permalink hastr layout title short tags hasgui hasdocs developers license links
projects/reportabug true project Report a Bug reportabug qt, c++, library, development false true
Evgeniy Alekseev
LGPLv3

Qt application/library which allows users to create an issue for projects which are hosted on GitHub. It may work over GitHub or GitReport. It works fine, but it was created as proof-of-concept.

Developers and contributors

{% for devel in page.developers %}

  • {{ devel }}{% endfor %}

License

  • {{ page.license }}

Installation

Instruction

Build as a standalone application

  • Download the actual source tarball.

  • Extract it and set up your configuration.

  • Install the application:

    cd /path/to/extracted/archive
    mkdir build && cd build
    cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_AS_LIBRARY:BOOL=0 ../
    make
    sudo make install
    

Build as a library in your project

  • Download the actual source tarball.

  • Extract it and set up your configuration.

  • include it into your project. For example if you use cmake:

    add_subdirectory (reportabug)
    
  • Declare class in you sources. For example:

    Reportabug *reportWindow = new Reportabug(parent=this, debugCmd=false, params=0);
    reportWindow->showWindow();
    
  • Link your application with this library.

Available cmake flags:

  • -DBUILD_AS_LIBRARY=0 - build the application but not a library.
  • -DBUILD_DOCS=1 - build developer documentation.
  • -DBUILD_SHARED_LIBRARY=1 - build the shared library instead of static one.
  • -DENABLE_GITHUB=0 - disable GitHub module.
  • -DENABLE_GITREPORT=0 - disable GitReport module.
  • -DOWN_GITHUB_TOKEN=STRING - use STRING as own GitHub token.
  • -DUSE_QT5=0 - use Qt4 instead of Qt5.

Dependencies

I want note that all were tested on latest version of dependencies.

  • qt5-base (if Qt5 is used) or qt4 (if Qt4 is used)
  • qt5-network (if Qt5 is used)
  • automoc4 (make)
  • cmake (make)
  • doxygen (make, documentation)
  • qt5-webkit (if Qt5 is used) or qtwebkit (if Qt4 is used) (optional, required by GitReports module)

How to use

GitHub module

This module creates an issue over GitHub. GitHub API is used for creating issue. User should type own username and password. The typical POST request is:

curl -X POST -u user:pass -d '{"title":"A new bug","body":"Some error occurs"}' \
     //api.github.com/repos/owner/repo/issues

To disable this module use -DENABLE_GITHUB=0 cmake flag.

This module may send request using developer's token too. Please visit this page and generate a new one. Needed scopes are public_repo (or repo if you will use it for a private repository).

Please keep in mind that passing the token in the clear, you may discredit your account.

The typical POST request is:

curl -X POST -H "Authorization: token token" -d '{"title":"A new bug","body":"Some error occurs"}' \
     //api.github.com/repos/owner/repo/issues

To enable this module set up your token using -DOWN_GITHUB_TOKEN=0 cmake flag.

This module requires QtNetwork module.

GitReports module

This module creates issue over GitReports. Please visit this page and set up it for your repository.

To disable this module use -DENABLE_GITREPORT=0 cmake flag. This module requires QtNetwork and QtWebKit modules.

Configuration

For the developer configuration please use config.h header. Also you may load parametrs dynamically using params array (needed keys is the same as for the header

Main configuration

  • OWNER - the owner of the source repository.
  • PROJECT - the project name.
  • TAG_BODY - default body of an issue. It may be used for both modules.
  • TAG_TITLE - default title of an issue. It may be used only for GitHub module.
  • TAG_ASSIGNEE - assign an issue to this account. It may be used only for GitHub module. This tag will work only if user has push access. If it will be empty, it will be ignored.
  • TAG_LABELS - set these labels to an issue. Labels should be comma separated. It may be used only for GitHub module. This tag will work only if user has push access. If it will be empty, it will be ignored.
  • TAG_MILESTONE - set this milestone to an issue. It may be used only for GitHub module. This tag will work only if user has push access. If it will be empty, it will be ignored.

GitHub module settings

  • GITHUB_COMBOBOX - text of this module into comboBox.
  • ISSUES_URL - issues url, in the most cases do not touch it. Default is //api.github.com/repos/$OWNER/$PROJECT/issues. Available tags here are $PROJECT, $OWNER.

GitReports module settings

  • CAPTCHA_URL - captcha url, in the most cases do not touch it. Default is //gitreports.com/simple_captcha?code=.
  • GITREPORT_COMBOBOX - text of this module into comboBox.
  • PUBLIC_URL - issues url, in the most cases do not touch it. Default is //gitreports.com/issue/$OWNER/$PROJECT. Available tags here are $PROJECT, $OWNER.