วิธีสร้าง Issue template ใน Gitlab

วิธีสร้าง Issue template ใน Gitlab

เคยเป็นไหม issue ที่มีคนเขียนถึงเรามา อ่านยังไงก็ไม่เข้าใจ หรือเขียนมาสั้นเกินไป หรือเขียนมาแล้วเข้าใจกันไปคนละแนวทาง ทำให้พอเราหยิบจับ issue นั้นขึ้นมาทำ แทนที่จะเป็นการแก้ไขปัญหา หรือพัฒนาให้เป็นไปตาม Feature นั้นๆ กลับทำให้เกิด โครตปัญหาขึ้นมาแทน

ถ้าเราทำงานคนเดียว เขียน issue เพื่อคนเดียวก็ไม่เท่าไร แต่พอทำงานเป็นทีม การเขียน issue แต่ละคนก็จะมีความหลากหลายมาก แต่โดยส่วนมากที่เจอ หรือผมเองก็ทำประจำคือเขียนสั้น ไม่ละเอียด คิดว่าตัวเองเข้าใจ แต่พอคนอื่นมาอ่านก็ไม่เข้าใจเหมือนเรา ทำให้เกิดปัญหาข้างต้นที่กล่าวมา

วิธีแก้ไขก็คือการสร้างรูปแบบ issue ให้เป็น Template ซะ เช่น ถ้า issue แบบ bug ให้เขียนแบบนี้ ถ้าแบบ feature ให้เขียนแบบนี้ เป็นต้น พอใครมาจะเขียนก็จะได้เขียนในแบบที่เรากำหนดไว้แล้ว ซึ่งในส่วนของ Gitlab นั้นก็รองรับการสร้าง Issue template นี้ แต่ผมดันพึ่งรู้ และนำมาใช้งาน ฮาๆ

วิธีสร้าง Issue template

1. สร้าง Markdown (.md) ไฟล์ใน .gitlab/issue_templates/ ของ Repository เรา และทำการ commit และ push ขึ้น default branch

2. ชื่อไฟล์จะเป็น feature_request.md หรือ Feature Request.md ก็ได้

3. ถ้าไม่มี .gitlab/issue_templates ก็ให้สร้างมันขึ้นมา

ตัวอย่าง Template ที่ผมใช้

bug-report.md

## Summary

<!-- Summarize the bug encountered concisely. -->

## Steps to reproduce

<!-- Describe how one can reproduce the issue - this is very important. Please use an ordered list. -->

## What is the current *bug* behavior?

<!-- Describe what actually happens. -->

## What is the expected *correct* behavior?

<!-- Describe what you should see instead. -->

## Relevant logs and/or screenshots

<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code
 as it's tough to read otherwise. -->

## Possible fixes

<!-- If you can, link to the line of code that might be responsible for the problem. -->

feature-report.md

## Prerequisites

Please answer the following questions for yourself before submitting an issue. **YOU MAY DELETE THE PREREQUISITES SECTION.**

- [ ] I am running the latest version
- [ ] I checked the documentation and found no answer
- [ ] I checked to make sure that this issue has not already been filed
- [ ] I'm reporting the issue to the correct repository (for multi-repository projects)

## Expected Behavior

Please describe the behavior you are expecting

## Current Behavior

What is the current behavior?

## Steps to Reproduce

Please provide detailed steps for reproducing the issue.

1. step 1
2. step 2
3. you get it...

## Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

* Firmware Version:
* Operating System:
* SDK version:
* Toolchain version:

## Failure Logs

Please include any relevant log snippets or files here.

ตัวอย่างอื่นๆ ดูได้จาก

.gitlab/issue_templates · master · GitLab.org / GitLab
GitLab is an open source end-to-end software development platform with built-in version control, issue tracking, code review, CI/CD, and more. Self-host GitLab on your own servers, in a...

การนำมาใช้งาน

ตอนสร้าง issue ให้เราเลือก Description มันจะมี Template ที่เราสร้างไว้แสดงออกมา

เมื่อเราเลือกสักอัน มันก็จะสร้าง Markdown ที่เราทำไว้มาให้เลย รายละเอียดต่างๆ ก็ไปแก้ไขเอาเอง

ข้อจำกัด

ถ้าเราใช้ของฟรีอยู่ เราจะสร้าง Template ได้เฉพาะในแต่ละ Repository ถ้าเราต้องการสร้างในระดับ Group, Sub group หรือ Project ต้องไปใช้ใน PREMIUM จ้า...

Arnon Kijlerdphon

Arnon Kijlerdphon

Choosing to live a plant-based lifestyle for the animals, my health, and the future of our planet.
Bangkok, Thailand