SSWConsulting / SSW.Dory

SSW.Dory - Sharepoint and GitHub
http://sswdory.com
1 stars 0 forks source link

✨ Feature - Pull Request Audit #93

Open Jord-Gui opened 9 months ago

Jord-Gui commented 9 months ago

Cc: @adamcogan @GordonBeeming

As raised by @sethdailyssw, we currently run this process manually every week. Let’s add an automated Pull Request audit to SSW.Dory.

The flow should be like this:

  1. For each pull request, pull the title and description from GitHub
  2. Run Prompt 1 - Review PR on the title and description (first comment) together. – it will tell you if the pull request is good or needs correction, and the reason
  3. If output = Good, then nothing happens
  4. If output = Needs Correction, then an email is sent. Template

Image

Figure: Use this email template

  1. Run Prompt 2 on the ALL the results – it will generate a summary email
  2. Send that email: To: Gordon CC: Adam, Seth
Jord-Gui commented 9 months ago

Prompt 1 - Review PR:

Your task is to analyze a pull request provided by the user.

Step 1: Check the pull request's 'title' field and the first comment in the conversation (the description).

Every title must have:

  1. What the Pull Request will do
  2. How the Pull Request achieved it Examples: PBI title: Product Backlog Item 100359: "Desktop App | Exporting occasionally failed" Fix desktop app exporting - prevent database concurrent access while exporting

Context - every Pull Request must have one of the below as the source of the change:

an issue url (or tag the ID, e.g. #123) conversation, using the key phrase "as per our conversation" Relates to #{{ ISSUE NUMBER }} From email, subject... I noticed that... Anything with 'I' in it, as this means the author themself is the source of the change Note: 'bug' is not an adequate description...the person who is the source is not mentioned (needs to be 'I' noticed the bug or '{{ NAME }} noticed the bug')

Write your output in the following format: ‘Good/Needs correction - Pull Request #xxx1 by {{ author }} Reason: {{ if needed }}’

Jord-Gui commented 9 months ago

Prompt 2:

Gather all the information from the reviewed pull requests and write a message in this exact format: Note: Good means title and description are adequate, Ok means one of them needs correction, Bad means both title and description need correction. Replace the x with actual numbers.

Hi Adam Here is your weekly Pull Request report.

Done - SSW.Rules.Content: This week's "PR health" is x/10 ✅ Good - x% 🫤 Ok - x% ❌ Bad - x% 📩 Sent - x corrections 💬 Comment - (e.g. Most people are still not putting the source of the change. Some are not understanding ‘what triggered the change’ – they just put what they are fixing.)

Done - SSW.Website (content): This week's "PR health" is x/10 ✅ Good - x% 🫤 Ok - x% ❌ Bad - x% 📩 Sent - x corrections 💬 Comment - Most PRs have an issue linked, and the issue usually has the source (some more clear than others)

💬 Check emails with subject: Pull Request Master - Missing PR context