Skip to main content

VOL. VI

Edwin Krivoseev
GitHub Templates & Config Repos

FULLHAUS DEV DUNGEON

  • GitHub Templates
  • Configuration Repos

GitHub Templates

Issue and PR templates are pre-defined structures that help guide contributors when they report bugs, request features, or submit pull requests. These templates provide a consistent format that captures necessary information upfront, reducing back-and-forth clarifications and improving collaboration. Templates allow for clear, concise information, ensuring each report or PR submission follows a predictable structure.

With templates in place, contributors are more likely to:

  • Provide accurate details for bugs, features, and other issues.
  • Submit well-documented pull requests.
  • Reduce common errors and miscommunication in reports.

Creating GitHub PR Templates

PR templates guide contributors through submitting code changes. They help ensure essential information is included. You can create a PR template by adding a file called PULL_REQUEST_TEMPLATE.md in the .github directory.

An example PR template might look like this:

### Description of the Changes
Provide a brief overview of the changes.

### Related Issues
Link to any issues related to this PR.

### Testing Performed
Explain how you tested your changes.

### Screenshots (if applicable)
Add relevant screenshots for UI changes.

### Checklist
- [ ] Code has been tested
- [ ] Documentation has been updated
- [ ] All tests pass

Creating GitHub Issue Templates

To create an Issue template in your GitHub repository, you’ll need to:

  1. Navigate to the .github/ISSUE_TEMPLATE directory in your repository.
  2. Add a Markdown file (e.g. bug_report.md or feature_request.md).

A basic Issue template might look like this:

---
name: Bug
about: File a bug
labels: Bug
---

### Description
Provide a clear and concise description of the bug.

### Steps to Reproduce
1. Go to '...'
2. Click on '...'
3. See error

### Expected Behavior
A description of what you expected to happen.

### Screenshots
If applicable, add screenshots to help explain your problem.

### Additional Context
Any other relevant information.

Issue Forms

GitHub recently introduced Issue forms, an advanced alternative to Issue templates that allow for a more interactive experience. Here’s how they differ:

AspectIssue TemplatesIssue Forms
File TypeMarkdown (.md)YAML (.yaml)
InteractivityStatic formatDynamic, supports drop-downs, checkboxes, etc.
CustomizationLimited to standard Markdown input fieldsSupports custom fields with validation options

With Issue forms, you can include elements like:

  • Dropdown menus for specific options.
  • Checkboxes for multiple selections.
  • Text areas with length validation.

Here's a YAML snippet for an Issue form:

name: Bug report
description: Report an issue
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thank you for filing an issue! If you are here to ask a question, use [Slack](https://fullhausonline.slack.com/) instead
- type: dropdown
id: package
attributes:
label: Which package is this bug report for?
options:
- global
- distribution
validations:
required: true
- type: textarea
id: description
attributes:
label: Issue description
description: Describe the issue in as much detail as possible.
warning

Currently the required validation field only works in public repositories!

Check out the whole documentation on GitHub or these repositories for reference:

Config Repos

To streamline our code quality process we already use ESLint and PHP-CS-Fixer. In order to ease configuration (especially across multiple projects) we defined our own configurations.

Benefits:

  • Consistency
    Depending on the same configuration keeps all projects more consistent and reduces discrepancies.
  • Efficiency
    If the internal convention changes, the update only needs to be done inside the configuration repo instead of all projects individually.
  • Ease of integration
    Integrating the config is as easy as installing a new package. Also, the only rules you need to define are the ones you want to overwrite.

Check out both configs to learn how to use them: