---
hastr: true
layout: project
title: Report a Bug
short: reportabug
tags: qt, c++, library, development
hasgui: false
hasdocs: true
developers:
    - Evgeniy Alekseev
license: LGPLv3
links:
---
<!-- info block -->
<h2><a href="#info" class="anchor" id="info"><span class="octicon octicon-link"></span></a>Information</h2>
<p>Qt application/library which allows users to create an issue for projects which are hosted on GitHub. It may work over <a href="https://github.com" title="GitHub">GitHub</a> or <a href="https://gitreports.com/" title="GitReports">GitReport</a>. It works fine, but it was created as proof-of-concept.</p>

<h3><a href="#devel" class="anchor" id="devel"><span class="octicon octicon-link"></span></a>Developers and contributors</h3>
<ul>
  {% for devel in page.developers %}
    <li>{{ devel }}</li>
  {% endfor %}
</ul>

<h3><a href="#license" class="anchor" id="license"><span class="octicon octicon-link"></span></a>License</h3>
<ul>
  <li>{{ page.license }}</li>
</ul>
<!-- end of info block -->

<!-- install block -->
<h2><a href="#install" class="anchor" id="install"><span class="octicon octicon-link"></span></a>Installation</h2>

<h3><a href="#instruction" class="anchor" id="instruction"><span class="octicon octicon-link"></span></a>Instruction</h3>
<h4><a href="#singleapp" class="anchor" id="singleapp"><span class="octicon octicon-link"></span></a>Build as a single application</h4>
<ul>
  <li>Download the actual source <a href="https://github.com/arcan1s/reportabug/releases" title="GitHub">tarball</a>.</li>
  <li>Extract it and set up your configuration.</li>
  <li>Install the application:

{% highlight bash %}
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
{% endhighlight %}

  </li>
</ul>

<h4><a href="#aslibrary" class="anchor" id="aslibrary"><span class="octicon octicon-link"></span></a>Build as a library in your project</h4>
<ul>
  <li>Download the actual source <a href="https://github.com/arcan1s/reportabug/releases" title="GitHub">tarball</a>.</li>
  <li>Extract it and set up your configuration.</li>
  <li>include it into your project. For example if you use <code>cmake</code>:

{% highlight cmake %}
add_subdirectory (reportabug)
{% endhighlight %}

  </li>
  <li>Declare class in you sources. For example:

{% highlight cpp %}
Reportabug *reportWindow = new Reportabug(parent=this,
                                          debugCmd=false,
                                          params=0);
reportWindow->showWindow();
{% endhighlight %}

  </li>
  <li>Link your application with this library.</li>
</ul>

<h4><a href="#cmakeflags" class="anchor" id="cmakeflags"><span class="octicon octicon-link"></span></a>Available cmake flags:</h4>
<ul>
  <li><code>-DBUILD_AS_LIBRARY=0</code> - build the application but not a library.</li>
  <li><code>-DBUILD_DOCS=1</code> - build developer documentation.</li>
  <li><code>-DBUILD_SHARED_LIBRARY=1</code> - build the shared library instead of static one.</li>
  <li><code>-DENABLE_GITHUB=0</code> - disable GitHub module.</li>
  <li><code>-DENABLE_GITREPORT=0</code> - disable GitReport module.</li>
  <li><code>-DOWN_GITHUB_TOKEN=STRING</code> - use STRING as own GitHub token.</li>
  <li><code>-DUSE_QT5=0</code> - use Qt4 instead of Qt5.</li>
</ul>

<h3><a href="#dependencies" class="anchor" id="dependencies"><span class="octicon octicon-link"></span></a>Dependencies</h3>
<p>I want note that all were tested on latest version of dependencies.</p>
<ul>
  <li>qt5-base <i>(if Qt5 is used)</i> <b>or</b> qt4 <i>(if Qt4 is used)</i></li>
  <li>qt5-network (if Qt5 is used)</li>
  <li>automoc4 <i>(make)</i></li>
  <li>cmake <i>(make)</i></li>
  <li>doxygen <i>(make, documentation)</i></li>
  <li>qt5-webkit (if Qt5 is used) <b>or</b> qtwebkit (if Qt4 is used) <i>(optional, required by GitReports module)</i></li>
</ul>
<!-- end of install block -->

<!-- howto block -->
<h2><a href="#howto" class="anchor" id="howto"><span class="octicon octicon-link"></span></a>How to use</h2>
<h3><a href="#github" class="anchor" id="github"><span class="octicon octicon-link"></span></a>GitHub module</h3>

<p>This module creates an issue over GitHub. <a href="https://developer.github.com/v3/issues/" title="Documentation">GitHub API</a> is used for creating issue. User should type own username and password. The typical POST request is:</p>

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

<p>To disable this module use <code>-DENABLE_GITHUB=0</code> cmake flag.</p>

<p>This module may send request using developer's token too. Please visit <a href="https://github.com/settings/applications" title="Settings">this page</a> and generate a new one. Needed scopes are <code>public_repo</code> (or <code>repo</code> if you will use it for a private repository).<br>
<b>Please keep in mind that passing the token in the clear, you may discredit your account.</b></p>

<p>The typical POST request is:</p>

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

<p>To enable this module set up your token using <code>-DOWN_GITHUB_TOKEN=0</code> cmake flag.</p>

<p>This module requires <code>QtNetwork</code> module.</p>

<h3><a href="#gitreports" class="anchor" id="gitreports"><span class="octicon octicon-link"></span></a>GitReports module</h3>
<p>This module creates issue over <a href="https://gitreports.com/about" title="GitReports">GitReports</a>. Please visit <a href="https://gitreports.com/" title="GitReports">this page</a> and set up it for your repository.</p>

<p>To disable this module use <code>-DENABLE_GITREPORT=0</code> cmake flag. This module requires <code>QtNetwork</code> and <code>QtWebKit</code> modules.</p>
<!-- end of howto block -->

<!-- config block -->
<h2><a href="#config" class="anchor" id="config"><span class="octicon octicon-link"></span></a>Configuration</h2>
<p>For the developer configuration please use <code>config.h</code> header. Also you may load parametrs dynamically using <code>params</code> array (needed keys is the same as for the header</p>
<h3><a href="#mainconfig" class="anchor" id="mainconfig"><span class="octicon octicon-link"></span></a>Main configuration</h3>
<ul>
  <li><code>OWNER</code> - the owner of the source repository.</li>
  <li><code>PROJECT</code> - the project name.</li>
  <li><code>TAG_BODY</code> - default body of an issue. It may be used for both modules.</li>
  <li><code>TAG_TITLE</code> - default title of an issue. It may be used only for GitHub module.</li>
  <li><code>TAG_ASSIGNEE</code> - 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.</li>
  <li><code>TAG_LABELS</code> - 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.</li>
  <li><code>TAG_MILESTONE</code> - 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.</li>
</ul>

<h3><a href="#githubconfig" class="anchor" id="githubconfig"><span class="octicon octicon-link"></span></a>GitHub module settings</h3>
<ul>
  <li><code>GITHUB_COMBOBOX</code> - text of this module into comboBox.</li>
  <li><code>ISSUES_URL</code> - issues url, in the most cases do not touch it. Default is <code>https://api.github.com/repos/$OWNER/$PROJECT/issues</code>. Available tags here are <code>$PROJECT</code>, <code>$OWNER</code>.</li>
</ul>

<h3><a href="#gitreportsconfig" class="anchor" id="gitreportsconfig"><span class="octicon octicon-link"></span></a>GitReports module settings</h3>
<ul>
  <li><code>CAPTCHA_URL</code> - captcha url, in the most cases do not touch it. Default is <code>https://gitreports.com/simple_captcha?code=</code>.</li>
  <li><code>GITREPORT_COMBOBOX</code> - text of this module into comboBox.</li>
  <li><code>PUBLIC_URL</code> - issues url, in the most cases do not touch it. Default is <code>https://gitreports.com/issue/$OWNER/$PROJECT</code>. Available tags here are <code>$PROJECT</code>, <code>$OWNER</code>.</li>
</ul>
<!-- end of config block -->

<!-- gui block -->
<!-- end of gui block -->
