Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: how to configure labelogenic Jira issues #275

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@

OPENEDX_WEBHOOKS_CONFIG=development
GITHUB_PERSONAL_TOKEN=
JIRA_SERVER=
JIRA_USER_EMAIL=
JIRA_USER_TOKEN=
JIRA_INFO_FILE=
72 changes: 52 additions & 20 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,6 @@ Generate a secret key for Flask, so that it can save information into the sessio
Set Up Authentication Tokens
----------------------------

Jira
~~~~

OAuth authentication for Jira requires a RSA keypair. To set this up:

#. Get a Jira access token. TODO: Explain how to do this.

#. Specify the Jira user email and token:

.. code-block:: bash

$ heroku config:set [email protected]
$ heroku config:set JIRA_USER_TOKEN=94LW................51FC

#. Specify the Jira server to use:

.. code-block:: bash

$ heroku config:set JIRA_SERVER=https://somejira.atlassian.net/

GitHub
~~~~~~

Expand All @@ -88,6 +68,58 @@ GitHub
$ heroku config:set GITHUB_BLENDED_PROJECT=edx:9


Jira
~~~~

The bot can be configured to work with many Jira servers.

The JIRA_INFO_FILE setting specifies a YAML file name in openedx-webhooks-data repo.
For a hypothetical organization named MegaCorp, it might look like this:

.. code-block:: yaml

# The key is a short name that will be looked up from the label.
# This configures the settings for a "jira:mega" label.
Mega:
# The URL of the Jira instance.
server: https://megacorp.atlassian.net
# The email address and user token for the account that will make
# Jira issues. Be sure it has the privileges needed.
email: [email protected]
token: 84Ma................z1FC
# The URL of a YAML file mapping repos to Jira project details.
mapping: https://raw.githubusercontent.com/megacorp/.github/HEAD/jira-mapping-prod.yaml
# A textual description of the Jira instance, to use in comments.
# It will be used in a sentence like this:
# "I've created issue PROJ-123 in {description}."
description: the private MegaCorp Jira

The mapping file is YAML that maps a repo name to two pieces of information: a
Jira project and an issue type to create in that project. The file can be at
any URL. As shown above, a raw GitHub URL is convenient. The reason this is
separate from other config is so that this mapping file can be managed by Megacorp
while the info file above with credentials in it is managed by the team running
openedx-webhooks. The file specifies repos, possibly with wildcards, and for each
provides the project and issue type to use:

.. code-block:: yaml

defaults:
type: Task
repos:
# The repo name is an org/repo string from GitHub.
- name: openedx/edx-platform
project: ARCHBOM
- name: nedbat/webhook-testing # For Ned to test the bot on stage
project: NEDBAT
type: TestIssue
# The repo name can have shell-like wildcards
- name: openedx/*
project: OPENSOURCE
- name: *
project: ENGR


Deploy
------

Expand Down
Loading