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

chore(issues): add new issue templates #253

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/general_bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# THIS FILE IS AUTOGENERATED. Please modify the source in _helpers
name: "Template Bug Report"
description: Report an issue with one of the templates
title: "[Bug]: "
labels: "bug"
body:
- type: textarea
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Actual Behavior
description: A clear description of what actually happens.
validations:
required: true
- type: textarea
attributes:
label: Additional Information
description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/request_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Template Request
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't requesting templates better handled through the CodeExchange process?

description: Request a template for a new or existing use case
title: "[Template Request]: "
labels: template-request
assignees: ''
body:
- type: textarea
attributes:
label: What is your use case?
description: A clear and concise description of what your use case is.
placeholder: SMS Broadcast Notifications
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like.
description: A clear and concise description of what you want to happen.
placeholder: I want a user to be able to input a list of phone numbers and a message into a browser interface. When I click "Send" I want that message to be sent to all of numbers via SMS.
validations:
required: true
- type: textarea
attributes:
label: "Additional requirements/dependencies:"
description: List any additional requirements this template should fulfill.
98 changes: 98 additions & 0 deletions .github/ISSUE_TEMPLATE/template_bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# THIS FILE IS AUTOGENERATED. Please modify the source in _helpers
name: "Template Bug Report"
description: Report an issue with one of the templates
title: "[Template Bug]: "
labels: "template-bug"
body:
- type: dropdown
attributes:
label: Affected Template
description: Which template is affected by the bug you have found? If multiple are affected please pick "Multiple" and list them in the "Other Comments" section.
options:
- "Blank Template"
- "Hello World"
- "Hello Voice"
- "Hello Messaging"
- "Never gonna give you up"
- "Forward Call"
- "Forward Message"
- "Forward Message to Multiple Numbers"
- "Forward Message to Email via SendGrid"
- "Voicemail"
- "Forward Message to Email via Sparkpost"
- "Airtable SMS Broadcast"
- "Simple Conference"
- "Stripe payments via SMS"
- "Stripe SMS Receipt Webhook Handler Function"
- "Chat Token Function"
- "Sync Token Function"
- "Video Token Function"
- "Hunt / Find Me"
- "HTTP Redirect"
- "Functions Temporary Storage"
- "Phone Verification"
- "Blocklist Call Function"
- "Echo Funlet"
- "Simple Message Funlet"
- "Simple Menu Funlet"
- "Whisper Funlet"
- "Forward Funlet"
- "Call Me Funlet"
- "Simulring Funlet"
- "Find Me Funlet"
- "Voice Client JavaScript Sample Application"
- "conversations"
- "SIP Quickstart"
- "Conference Line with Phone Verification"
- "PIN-protected Conference Line"
- "Caller Gated Conference Line"
- "Basic Video App"
- "SMS Notifications"
- "Voice IVR"
- "Email Verification Magic Links"
- "Verify Testing Dashboard"
- "Verify Push Backend"
- "SMS Broadcast with Verification"
- "International telephone input"
- "Forward SMS message as an email (Mailgun)"
- "JSON Webhook Adapter"
- "SMS Broadcast"
- "Masked Phone Number"
- "COVID-19 Vaccine Standby List"
- "Segment Track Notification"
- "Google Sheets SMS Log"
- "COVID-19 Vaccine FAQ Bot"
- "Patient Appointment Management"
validations:
required: true
- type: dropdown
attributes:
label: Tool Used
description: "How are you using this template? For `twilio-run`/`create-twilio-function` and `twilio serverless` choose `Serverless Toolkit`"
options:
- "CodeExchange Quick Deploy"
- "Serverless Toolkit"
- "Manual (Copy & Paste)"
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Actual Behavior
description: A clear description of what actually happens.
validations:
required: true
- type: input
attributes:
label: Browser Version
description: If this is an issue that involves behavior in the browser please specify your browser, version and operating system.
placeholder: "Firefox 89.0.1, macOS Big Sur"
- type: textarea
attributes:
label: Additional Information
description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
13 changes: 11 additions & 2 deletions .github/workflows/env-manifest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate Env Manifest
name: Template Updates

on:
push:
Expand All @@ -25,6 +25,7 @@ jobs:
run: |
npm install
npm run ci:generate-manifest
npm run ci:update-issue-templates
env:
CI: true
NODE_ENV: test
Expand All @@ -33,11 +34,19 @@ jobs:
run: |
git diff --name-only | xargs
echo "::set-output name=files::$(git diff --name-only | xargs)"
- name: commit changes
- name: commit env changes
if: ${{ contains(steps.changes.outputs.files, 'env-variables.manifest.json') }}
run: |
git config user.name twilio-labs-ci
git config user.email [email protected]
git add env-variables.manifest.json
git commit -m "chore(env-manifest): update manifest file"
git push
- name: commit issue template changes
if: ${{ contains(steps.changes.outputs.files, '.github/ISSUE_TEMPLATE/template_bug_report.yml') }}
run: |
git config user.name twilio-labs-ci
git config user.email [email protected]
git add .github/ISSUE_TEMPLATE/template_bug_report.yml
git commit -m "chore(issues): update issue template file"
git push
44 changes: 44 additions & 0 deletions _helpers/template_bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Template Bug Report"
description: Report an issue with one of the templates
title: "[Template Bug]: "
labels: "template-bug"
body:
- type: dropdown
attributes:
label: Affected Template
description: Which template is affected by the bug you have found? If multiple are affected please pick "Multiple" and list them in the "Other Comments" section.
options:
# <<TEMPLATE_OPTIONS>>
validations:
required: true
- type: dropdown
attributes:
label: Tool Used
description: "How are you using this template? For `twilio-run`/`create-twilio-function` and `twilio serverless` choose `Serverless Toolkit`"
options:
- "CodeExchange Quick Deploy"
- "Serverless Toolkit"
- "Manual (Copy & Paste)"
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Actual Behavior
description: A clear description of what actually happens.
validations:
required: true
- type: input
attributes:
label: Browser Version
description: If this is an issue that involves behavior in the browser please specify your browser, version and operating system.
placeholder: "Firefox 89.0.1, macOS Big Sur"
- type: textarea
attributes:
label: Additional Information
description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
40 changes: 40 additions & 0 deletions _helpers/update-issue-templates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const fs = require('fs').promises;
const path = require('path');

const OUTPUT_PATH = path.resolve(
__dirname,
'..',
'.github',
'ISSUE_TEMPLATE',
'template_bug_report.yml'
);
const INPUT_PATH = path.resolve(__dirname, 'template_bug_report.yml');
const TEMPLATES_FILE = path.resolve(__dirname, '..', 'templates.json');

async function getTemplateNames() {
const templatesContent = JSON.parse(
await fs.readFile(TEMPLATES_FILE, 'utf8')
);
return templatesContent.templates.map((t) => t.name);
}

async function run() {
const templates = await getTemplateNames();

const optionsList = templates
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be an idea to sort the templates so that it's easier to find the one you want to reference.

.map((name) => {
return ` - "${name}"`;
})
.join('\n');

const inputFile = await fs.readFile(INPUT_PATH, 'utf8');
const outputData = `# THIS FILE IS AUTOGENERATED. Please modify the source in _helpers\n${inputFile.replace(
'# <<TEMPLATE_OPTIONS>>',
optionsList
)}`;

await fs.writeFile(OUTPUT_PATH, outputData, 'utf8');
console.log('Issue template updated');
}

run().catch(console.error);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"add-dependency": "npm install $npm_config_package --no-package-lock --prefix $npm_config_template && npm install --save-dev $npm_config_package",
"env-manifest": "node _helpers/generate-env-variable-manifest",
"ci:generate-manifest": "npm run env-manifest -- --write",
"ci:update-issue-templates": "node _helpers/update-issue-templates",
"lint": "eslint --ext js .",
"lint:all": "npm run lint -- --no-ignore",
"format": "prettier --write .",
Expand Down