-
Notifications
You must be signed in to change notification settings - Fork 37
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
adding pr description conventions #440
Open
codergig3
wants to merge
4
commits into
linear-b:main
Choose a base branch
from
codergig3:description
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9f1a315
adding pr description conventions
xTrilton c4ed7b4
Rename enforce_pr_description_requirements.yml to enforce_pr_descript…
codergig3 284f3db
Rename pr_description_checklist.yml to pr_description_checklist.cm
codergig3 a8d7769
Merge branch 'main' into description
vim-zz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
docs/automations/standard/enforce-pr-description-requirements/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: gitStream Automation - Enforce PR Description Requirements. | ||
description: Automaticallly request changes for PRs that have empty descriptions. | ||
--- | ||
# Enforce PR Description Requirements | ||
<!-- --8<-- [start:example]--> | ||
Automaticallly request changes for PRs that have empty descriptions. | ||
|
||
![Enforce PR Description Requirements](/automations/standard/enforce-pr-description-requirements/enforce-pr-description-requirements.png) | ||
|
||
!!! info "Configuration Description" | ||
|
||
**Conditions (all must be true):** | ||
|
||
* The PR description is empty. | ||
|
||
**Automation Actions:** | ||
|
||
* Request changes and post a comment explaining that PR descriptions are required. | ||
|
||
<div class="automationExample" markdown="1"> | ||
!!! example "Enforce PR Description Requirements" | ||
```yaml+jinja | ||
--8<-- "docs/downloads/automation-library/standard/enforce-pr-description-requirements/enforce_pr_description_requirements.cm" | ||
``` | ||
<div class="result" markdown> | ||
<span> | ||
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/standard/enforce-pr-description-requirements/enforce_pr_description_requirements.cm){ .md-button } | ||
</span> | ||
</div> | ||
<!-- --8<-- [end:example]--> | ||
|
Binary file added
BIN
+34.1 KB
...ard/enforce-pr-description-requirements/enforce-pr-description-requirements.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
docs/automations/standard/pr-description-checklist/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: gitStream Automation - Block a PR From Merging if the Description Lacks Any Required Checklist Items. | ||
description: Block a PR from merging if the description lacks any required checklist items. | ||
--- | ||
# Block a PR From Merging if the Description Lacks Any Required Checklist Items | ||
<!-- --8<-- [start:example]--> | ||
Block a PR from merging if the description lacks any required checklist items. | ||
|
||
![PR Description Checklist](/automations/standard/pr-description-checklist/pr-description-checklist.png) | ||
|
||
!!! info "Configuration Description" | ||
|
||
**Conditions (all must be true):** | ||
|
||
* The PR description has one or more unchecked checkboxes. | ||
|
||
**Automation Actions:** | ||
|
||
* Request changes and post a comment asking the author to complete the PR checklist. | ||
* Apply a yellow “Missing Checklist Items” label. | ||
|
||
|
||
<div class="automationExample" markdown="1"> | ||
!!! example "Block a PR from merging if the description lacks any required checklist items" | ||
```yaml+jinja | ||
--8<-- "docs/downloads/automation-library/standard/pr-description-checklist/pr_description_checklist.cm" | ||
``` | ||
<div class="result" markdown> | ||
<span> | ||
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/standard/pr-description-checklist/pr_description_checklist.cm){ .md-button } | ||
</span> | ||
</div> | ||
<!-- --8<-- [end:example]--> | ||
|
Binary file added
BIN
+37.7 KB
docs/automations/standard/pr-description-checklist/pr-description-checklist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
...brary/standard/enforce-pr-description-requirements/enforce_pr_description_requirements.cm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
manifest: | ||
version: 1.0 | ||
|
||
automations: | ||
enforce_pr_description_requirements: | ||
if: | ||
- {{ not has.description }} | ||
run: | ||
- action: request-changes@v1 | ||
args: | ||
comment: | | ||
Descriptions are required for all PRs. Please update your description to describe what changes this PR introduces and anything else reviewers should be aware of. Please also provide a reference to any relevant project management tracking resources. | ||
has: | ||
description: {{ pr.description | includes(regex=r/[a-zA-Z]/) }} |
21 changes: 21 additions & 0 deletions
21
...ownloads/automation-library/standard/pr-description-checklist/pr_description_checklist.cm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- mode: yaml -*- | ||
|
||
manifest: | ||
version: 1.0 | ||
|
||
automations: | ||
pr_description_checklist: | ||
if: | ||
- {{ pr.description | includes(regex=r/\-\[\]/) }} | ||
run: | ||
- action: add-label@v1 | ||
args: | ||
label: "Missing Checklist Items" | ||
color: {{ colors.yellow }} | ||
- action: request-changes@v1 | ||
args: | ||
comment: | | ||
Please complete the PR checklist before requesting a code review. | ||
Comment on lines
+7
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about doing 2 checks, one for optional checklist items and one for mandatory. We cna suggest that a check list item that marked as mandatory blocks PR with request change and that optionl one result in a
for the baove mandatory regex is |
||
|
||
colors: | ||
yellow: 'fbca04' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original regex doesnt cover GitHub markdown checkbox
- [ ]
which has spaces