зеркало из
1
0
Форкнуть 0
Перейти к файлу
Arthur Baars d5f74fc64b
Merge pull request #9 from semmledocs-ac/0503-tutorial-review
docs: Editorial review of tutorial
2019-05-13 13:00:07 +02:00
.env_template Switch to using a dedicated bot account to identify issue events initiated by the app itself 2019-02-25 16:44:46 +00:00
.gitignore Ensure latest version of Jinja2 2019-04-15 10:05:07 +01:00
CODE_OF_CONDUCT.md Basic functional example of Webhook integration 2019-02-01 15:51:11 +01:00
CONTRIBUTING.md Basic functional example of Webhook integration 2019-02-01 15:51:11 +01:00
COPYRIGHT Basic functional example of Webhook integration 2019-02-01 15:51:11 +01:00
LICENSE Basic functional example of Webhook integration 2019-02-01 15:51:11 +01:00
Pipfile Ensure latest version of Jinja2 2019-04-15 10:05:07 +01:00
README.md docs: Editorial pass on readme and tutorial 2019-05-03 16:04:01 +01:00
issues.py Add clarification paragraph at the start of the README 2019-03-28 17:02:48 +00:00
lgtm.yml Basic functional example of Webhook integration 2019-02-01 15:51:11 +01:00
tutorial.md Merge remote-tracking branch 'upstream/master' into 0503-tutorial-review 2019-05-09 10:40:25 +01:00

README.md

LGTM issue tracker integration example

Code style: black Total alerts

Issue tracking in LGTM Enterprise

LGTM Enterprise gives customers the option of exporting alerts to any issue tracker, by sending webhook POST requests to the external service. Semmle provides an existing full-featured add-on for Atlassian Jira, but other issue trackers need a lightweight application to act as translator for LGTM. This repository provides a basic example of how such an application might be implemented.

Integration with external issue trackers is not available to users of LGTM.com.

This repository

This project gives a quick illustrative example of how to integrate LGTM Enterprise with a third-party issue tracker. This code is intended as a proof-of-concept only, showing the basic operations necessary to handle incoming requests from LGTM. It is not intended for production use. Please feel free to use this as a starting point for your own integration, but if you are using Atlassian Jira see also the LGTM Jira add-on.

We use a lightweight Flask server to handle incoming requests, which in turn writes to the issue tracker of a specified GitHub repository. When not run in debug mode, incoming requests are verified using the secret specified when configuring the integration. For a more detailed explanation please see the associated tutorial.

For instructions on configuring your LGTM Enterprise instance, please see the relevant LGTM help pages.

Integration with the GitHub issue tracker requires an access token for the GitHub installation, with appropriate permissions.

Configuration

When run through pipenv the app pull its configuration from the .env file, for which an example is provided:

FLASK_APP=issues.py
FLASK_DEBUG=0

GIT_REPO_URL=https://github.com/api/v3/repos/USERNAME/REPO/issues
GIT_ACCESS_TOKEN=PERSONAL_ACCESS_TOKEN

LGTM_SECRET=SECRET_AS_SPECIFIED_IN_LGTM_INTEGRATION_PANEL

Running

The easiest way to get the app running is with pipenv. Obviously a proper deployment would require something other than the built-in Flask development server.

Note: This example project requires a minimum of python3.5.

pipenv install
pipenv run flask run

Contributing

We welcome contributions to our example LGTM issue tracker integration. While we intend this project to remain a minimal pedagogical example, if you have an idea how it could be made clearer or more valuable to other users, then please go ahead an open a pull request! Before you do, though, please take the time to read our contributing guidelines.

License

The LGTM Jira add-on is licensed under Apache License 2.0 by Semmle.