Skip to content

Commit

Permalink
ci: add issue templates and workflow for JIRA
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
  • Loading branch information
sergiusens committed Apr 14, 2023
1 parent 8b3ed19 commit 6094db1
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Bug Report
description: File a bug report
labels: ["Type: Bug", "Status: Triage"]
body:
- type: markdown
attributes:
value: >
Thanks for taking the time to fill out this bug report! Before
submitting your issue, please make sure this has not been
already reported or if it works with the latest published
version of Snapcraft.
- type: textarea
id: bug-description
attributes:
label: Bug Description
description: >
If applicable, add screenshots to help explain your
problem. If applicable, add screenshots to help explain the
problem you are facing.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: To Reproduce
description: >
Please provide a step-by-step instruction of how to reproduce the behavior.
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: >
We need to know a bit more about the context in which Snapcraft failed.
- Are you running Snapcraft in destructive-mode, using LXD or Multipass.
- On what system is Snapcraft running (e.g.; Ubuntu 20.04 LTS, Windows 10, OS X 10.15).
validations:
required: true
- type: textarea
id: snapcraft.yaml
attributes:
label: snapcraft.yaml
description: >
If possible, please paste your snapcraft.yaml contents. This
will be automatically formatted into code, so no need for
backticks.
render: shell
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: >
Please copy and paste any relevant log output. This will be
automatically formatted into code, so no need for backticks.
render: shell
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional context

27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Task
description: File an enhancement proposal
labels: ["Type: Task", "Status: Triage"]
body:
- type: markdown
attributes:
value: >
Thanks for taking the time to fill out this enhancement
proposal! Before submitting your issue, please make sure there
isn't already a prior issue concerning this. If there is,
please join that discussion instead.
- type: textarea
id: enhancement-proposal
attributes:
label: What needs to get done
description: >
Describe what needs to get done
validations:
required: true
- type: textarea
id: enhancement-proposal
attributes:
label: Why it needs to get done
description: >
Describe why it needs to get done
validations:
required: true
53 changes: 53 additions & 0 deletions .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Issues

on: [issues]

jobs:
update:
name: Update Issue
runs-on: ubuntu-latest
steps:
- name: Dump Github Context
run: |
echo "update=false" >> $GITHUB_ENV
if [ ${{ github.event_name }} != "issues" ]; then
echo "This action only operates on issues"
exit 0
fi
echo "update=true" >> $GITHUB_ENV
- name: Determine action
run: |
if [ ${{ github.event.action }} == "opened" ]; then
echo "action=open" >> $GITHUB_ENV
fi
if [ ${{ github.event.action }} == "reopened" ]; then
echo "action=reopen" >> $GITHUB_ENV
fi
if [ ${{ github.event.action }} == "closed" ]; then
echo "action=close" >> $GITHUB_ENV
fi
- name: Determine type
run: |
if ${{ contains(github.event.*.labels.*.name, 'Type: Bug') }}; then
echo "type=bug" >> $GITHUB_ENV
else
echo "type=story" >> $GITHUB_ENV
fi
- name: Update
if: ${{ env.update == 'true' }}
env:
ID: ${{ github.event.issue.html_url }}
TITLE: ${{github.event.issue.title }}
COMPONENT: Snapcraft
DESCRIPTION: Opened by ${{ github.event.issue.user.login }}.
run: |
data=$(jq -n \
--arg id "$ID" \
--arg action "${{ env.action }}" \
--arg title "$TITLE" \
--arg description "$DESCRIPTION" \
--arg component "$COMPONENT" \
--arg type "${{ env.type }}" \
'{data: {id: $id, action: $action, title: $title, description: $description, component: $component, type: $type}}')
curl -X POST -H 'Content-type: application/json' --data "${data}" "${{ secrets.JIRA_URL }}"

0 comments on commit 6094db1

Please sign in to comment.