diff options
| author | Jose Santiago Vales Mena <[email protected]> | 2025-06-27 13:07:04 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-27 13:07:04 -0700 |
| commit | fce97a3094147fca0186e054a3b2777d119279f8 (patch) | |
| tree | 6edf0ca623de77264fbd39637ea1bb72205bab08 | |
| parent | 02b59d168de5812730fda9e0642302d1e3b25877 (diff) | |
| parent | d10e550fee9da007365a03b5e599c25648266753 (diff) | |
Merge pull request #1 from 5an7y/sample-based-issue-template
Create Sample Issue template
| -rw-r--r-- | .github/CODEOWNERS | 2 | ||||
| -rw-r--r-- | .github/ISSUE_TEMPLATE/sample_issue.yml | 75 | ||||
| -rw-r--r-- | .github/ISSUE_TEMPLATE/sample_issue_generator.py | 66 |
3 files changed, 143 insertions, 0 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index be83c18d..093db174 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -10,6 +10,8 @@ # Windows Implementation Library submodule /wil/ @microsoft/driver-samples-maintainers +# Samples + # Audio /audio/ @microsoft/windowsaudio diff --git a/.github/ISSUE_TEMPLATE/sample_issue.yml b/.github/ISSUE_TEMPLATE/sample_issue.yml new file mode 100644 index 00000000..2ce8d762 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/sample_issue.yml @@ -0,0 +1,75 @@ +name: Issue with a sample +description: Report a problem you have with a specific sample. +title: '[path/to/sample]: ' +body: +- type: dropdown + id: Sample Area + attributes: + label: Which is the area where the sample lives? + description: Select the area where you're experiencing the problem. + options: + - /audio/ + - /bluetooth/ + - /avstream/ + - /general/SimpleMediaSource/ + - /network/wwan/ + - /nfc/ + - /gnss/ + - /network/radio/ + - /network/wsk/ + - /sd/ + - /smartcrd/ + - /gpio/ + - /pofx/PEP/ + - /prm/ + - /wmi/wmiacpi/ + - /general/SystemDma/ + - /video/ + - /tools/ + - /pofx/WDF/ + - /powerlimit/ + - /simbatt/ + - /thermal/ + - /general/perfcounters/ + - /general/tracing/ + - /filesys/cdfs/ + - /filesys/fastfat/ + - /filesys/miniFilter/ + - /general/cancel/ + - /general/event/ + - /general/registry/ + - /network/config/ + - /network/modem/ + - /network/ndis/ + - /network/trans/ + - /security/ + - /TrEE/ + - /general/DCHU/ + - /setup/ + - /print/ + - /wia/ + - /sensors/ + - /storage/ + - /general/echo/ + - /general/ioctl/ + - /general/pcidrv/ + - /general/PLX9x5x/ + - /general/toaster/ + - /hid/ + - /input/ + - /pofx/UMDF2/ + - /serial/ + - /spb/ + - /usb/ + - /wmi/wmisamp/ + - /pos/ + - /network/wlan/ + validations: + required: true +- type: textarea + id: description + attributes: + label: Describe the issue + description: Provide a clear and concise description of what the issue is. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/sample_issue_generator.py b/.github/ISSUE_TEMPLATE/sample_issue_generator.py new file mode 100644 index 00000000..3d35ae9b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/sample_issue_generator.py @@ -0,0 +1,66 @@ +import re +import yaml + +# Read the CODEOWNERS file +with open("../CODEOWNERS", "r") as file: + lines = file.readlines() + +# Parse the CODEOWNERS file to extract areas and their paths +areas = {} +sample_section_found = False + +for line in lines: + line = line.strip() + if line.startswith("# Samples"): + sample_section_found = True + continue + + if sample_section_found: + if line.startswith("#"): + continue + elif line: + path, codeowner = line.split() + if path in areas: + raise ValueError(f"{path} has been found two times inside CODEOWNERS file") + areas[path] = codeowner + +# Generate the YAML structure +yaml_form = { + "name": "Issue with a sample", + "description": "Report a problem you have with a specific sample.", + "title": "[path/to/sample]: ", + "body": [] +} + +dropdown = { + "type": "dropdown", + "id": "Sample Area", + "attributes": { + "label": "Which is the area where the sample lives?", + "description": "Select the area where you're experiencing the problem.", + "options": [path for path, codeowner in areas.items()] + }, + "validations": { + "required": True + } +} + +# Add a description field +description_field = { + "type": "textarea", + "id": "description", + "attributes": { + "label": "Describe the issue", + "description": "Provide a clear and concise description of what the issue is." + }, + "validations": { + "required": True + } +} + +yaml_form["body"].append(dropdown) +yaml_form["body"].append(description_field) + +# Write the YAML to a file +with open("sample_issue.yml", "w") as outfile: + yaml.dump(yaml_form, outfile, sort_keys=False) |
