Skip to content

Draft-Release Creation Action#86

Open
Yaswant Pradhan (yaswant) wants to merge 7 commits into
MetOffice:developfrom
yaswant:release-changelog
Open

Draft-Release Creation Action#86
Yaswant Pradhan (yaswant) wants to merge 7 commits into
MetOffice:developfrom
yaswant:release-changelog

Conversation

@yaswant

@yaswant Yaswant Pradhan (yaswant) commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

PR Summary

Code Reviewer: Andrew Coughtrie (@andrewcoughtrie)

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • The modified workflow's README has been updated, if required
  • The changes have been sufficiently tested (please describe)

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy

Met Office Github Copilot Enterprise was used in compiling the README documentation for draft-release workflow.

Code Review

  • The changes are approriate and testing has been sufficient

@yaswant Yaswant Pradhan (yaswant) marked this pull request as ready for review June 30, 2026 12:19
@yaswant Yaswant Pradhan (yaswant) changed the title Draft Release Creation Action Draft-Release Creation Action Jun 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new reusable GitHub Actions workflow to create draft GitHub releases with auto-generated notes, alongside a central release-notes template and end-user documentation. This fits the repo’s goal of providing shared workflows for Simulation Systems projects.

Changes:

  • Add a reusable workflow (workflow_call) that checks out a central release template and runs gh release create --generate-notes --draft.
  • Add a shared .github/templates/release.yml to define changelog categories/exclusions.
  • Add end-user documentation for consuming the workflow, and relax rumdl rules to accommodate the new Markdown patterns.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pyproject.toml Disables several rumdl Markdown rules to allow the new README content/style.
draft-release/README.md Documents the new “Draft Release” reusable workflow, usage variants, and changelog label taxonomy.
.github/workflows/draft-release.yaml Implements the reusable workflow that injects a release template and creates a draft release via GitHub CLI.
.github/templates/release.yml Defines release-note categories and excluded labels for GitHub’s release notes generator.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/draft-release.yaml Outdated
Comment thread .github/workflows/draft-release.yaml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Comment thread .github/bin/compile-release-notes.sh Outdated
Comment thread .github/bin/compile-release-notes.sh Outdated
Comment thread .github/templates/release.yml Outdated
Comment thread .github/workflows/draft-release.yaml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Comment thread .github/workflows/draft-release.yaml Outdated
fetch-tags: true
persist-credentials: false

- name: Checkout shared template repository (sparse)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now redundant. But thanks for the pointer.

Comment thread .github/workflows/draft-release.yaml Outdated
run: |
set -euo pipefail

TITLE="Release ${GITHUB_REF_NAME} (Milestone?)"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. This is deliberate.

Comment on lines +64 to +70
if [ -n "$PREV_TAG" ]; then
COMPARE_RANGE="${PREV_TAG}...${GITHUB_SHA}"
# Single API call to get all commit hashes within the release window
gh api "repos/${CALLER_REPO}/compare/${COMPARE_RANGE}" --jq '.commits[].sha' >commit-shas.txt
else
git -C local-code rev-list --max-count=300 "${GITHUB_SHA}" >commit-shas.txt
fi
Comment thread .github/bin/compile-release-notes.sh Outdated
Comment on lines +85 to +92
# Extract pull requests directly from the repository's main PR list.
# Pull the 200 most recent merged PRs, then match them against commit-shas.txt
{
gh api "repos/${CALLER_REPO}/pulls?state=closed&per_page=100&page=1"
gh api "repos/${CALLER_REPO}/pulls?state=closed&per_page=100&page=2"
} | jq -r '.[] | select(.merged_at != null) |
"\(.merge_commit_sha) \(.number) \(.title) | \(.user.login) | \([.labels[].name] | join(","))"' >recent-prs.txt

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deliberately skipping --paginate to avoid rate limit exhaustion, and workflow timeout risk.

Comment thread .github/bin/compile-release-notes.sh Outdated
Comment on lines +174 to +178
metadata=$(echo "$row" | cut -d'|' -f1)
user=$(echo "$row" | cut -d'|' -f2 | xargs)
labels=$(echo "$row" | cut -d'|' -f3 | xargs)
pr=$(echo "$metadata" | awk '{print $2}')
title=$(echo "$metadata" | cut -d' ' -f3-)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested code changes will break very badly.

… categorised changelog generation

- Introduced a composite action for draft releases, consolidating the release process.
- Added a new script to compile release notes from a shared changelog template.
- Created a structured YAML template for changelog categories and exclusions.
- Updated README to reflect new structure and usage instructions.
- Removed previously implemented reusable workflow and streamlined the workflow for better maintainability.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Comment thread draft-release/README.md Outdated
This action is intentionally located at repository root level and has the
following components:

- `draft-release/action.yml` (composite action)
Comment thread draft-release/README.md Outdated

jobs:
release:
runs-on: ubuntu-slim

@yaswant Yaswant Pradhan (yaswant) Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-copilot Not quite. ubuntu-slim is a legitimate, first-party runner image maintained by GitHub in the actions/runner-images repository. See https://github.com/actions/runner-images/blob/main/images/ubuntu-slim/ubuntu-slim-Readme.md

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Comment thread pyproject.toml
Comment on lines 18 to +26
exclude = [
".github/pull_request_template.md",
]
disable = [
"MD033", # Inline HTML
"MD034", # Bare URL used
"MD036", # Emphasis used instead of a header
"MD041", # First line in file should be a top level header
]
Comment thread draft-release/README.md
Comment on lines +33 to +37
| 🔬 Scientific & Algorithmic Updates | `science`, `technical` | **science**: Domain-specific mathematical changes or model updates.<br>**technical**: Deep algorithmic optimisations or background logic shifts. |
| 📚 Documentation | `documentation` | Changes isolated to READMEs, inline code docstrings, scientific documentation, working practices, or other non-functional documentation updates. |
| ⚡ Performance Improvements | `optimisation` | Direct speed execution metrics, runtime improvements, memory, storage, or other resource optimisations. |
| ♻️ Refactoring | `refactor` | Code cleanup, modularisation, or other internal improvements without behavior changes. |
| 🛠️ Maintenance | `build`, `chore`, `ci` | **build**: Changes affecting build tools or external compiler toolchains.<br>**chore**: General housekeeping, licence updates, or minor administrative tasks.<br>**ci**: Changes to GitHub Actions workflows, CI/CD pipelines, or other automation.|
Comment thread draft-release/README.md
Comment on lines +79 to +82
Step1 -.-> Desc1[Checks out the calling repository into <code>local-code</code><br>with full history and tags]
Step2 -.-> Desc2[Executes <code>compile-release-notes.sh</code><br>using action-local template <code>release.yml</code>]
Step4 -.-> Desc3[Executes <code>gh release create/edit</code><br>with categorised changelog notes in draft state]
Skip -.-> Desc4[Workflow completes early<br>if no merged PRs found in release window]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are digressing Copilot. Those html markers are intentional. GitHub's Markdown rendering, particularly of mermaid diagram has some edge cases, so please don't suggest such changes.

@yaswant

Copy link
Copy Markdown
Collaborator Author

Andrew Coughtrie (@andrewcoughtrie) this is ready for your review now. I ended up converting it into a composite action rather than a reusable workflow, so the structure has changed quite a bit. Copilot reviews have been helpful, but not the suggested code changes - we need to be careful.
I spoke with Hacka Fett (@christophermaynard) and we agreed that a single optimisaton label is enough. I've also added a couple of extra labels based on our offline discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants