Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check PR title

on:
workflow_call:

defaults:
run:
shell: bash

jobs:
check_title:
runs-on: ubuntu-latest

steps:
- uses: ytanikin/pr-conventional-commits@fda730cb152c05a849d6d84325e50c6182d9d1e9 # 1.5.1
with:
task_types: '["build", "feat", "fix", "docs", "test", "ci", "style", "refactor", "perf", "chore"]'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since the rippled repo doesn't support the feat and style prefixes, can we allow the caller to set the task types as an input?

One option would be to have a comma-separated list as input, and another would be to have a set of boolean inputs that all default to true but which can be easily overridden. You'd have to do some preprocessing before calling the action, but shouldn't be too much effort.

@ximinez: it would make sense for clio and rippled to support the same prefixes.

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.

feat is used though: XRPLF/rippled@ed5d6f3

git log | grep "feat: "
    feat: Add public key to log messages (#5678)
    feat: Install validator-keys (#5841)
    * feat: Install validator-keys
    feat: Implement separate upload workflow (#5762)
    * feat: Implement separate upload workflow
    feat: improve squelching configuration (#5438)
    feat: add user version of `feature` RPC (#4781)
    feat: allow `port_grpc` to be specified in `[server]` stanza (#4728)
    feat: support Concise Transaction Identifier (CTID) (XLS-37) (#4418)
    feat: mark 4 amendments as obsolete: (#4291)

I haven't found style:, but I think the easiest solution would be to just use the same list - it's been working well at Clio, and doesn't create confusion.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Don't we already have the PR template to capture this information? So, either we keep using that or remove that?

I think the major use-case of this won't be just to identify PR category from title, but to also filter them in searches. Although, that can be done using string matching in title, but it is fragile. Filtering using labels though is much more robust. So, better way would be to just program the Copilot to analyze changes in PR and assign a label to it automatically. What do you think?

Copy link
Copy Markdown
Collaborator Author

@mathbunnyru mathbunnyru Mar 9, 2026

Choose a reason for hiding this comment

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

Don't we already have the PR template to capture this information? So, either we keep using that or remove that?

I will remove that, that was my plan and part of the frustration. It will be a part of the rippled PR after this one gets merged.

I think the major use-case of this won't be just to identify PR category from title, but to also filter them in searches. Although, that can be done using string matching in title, but it is fragile. Filtering using labels though is much more robust. So, better way would be to just program the Copilot to analyze changes in PR and assign a label to it automatically. What do you think?

Since we don't know yet how to launch Copilot using corporate tokens, I think it might be a further improvement, not something that can be implemented right now.

Copy link
Copy Markdown

@pratikmankawde pratikmankawde Mar 9, 2026

Choose a reason for hiding this comment

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

We should ask developers to follow this workflow then. Also, check this out: #76

Copy link
Copy Markdown
Collaborator Author

@mathbunnyru mathbunnyru Mar 9, 2026

Choose a reason for hiding this comment

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

We should ask developers to follow this workflow then.

What do you mean?
It will be automatic workflow that verifies that PR title is as expected, and if everything's good no action won't be needed, if not - they will get red CI (and will eventually fix it).

Also, check this out: #76

It looks like a reimplementation of add_label + custom_labels of the ytanikin/pr-conventional-commits.
I didn't want to add labels here, because neither Clio, nor rippled uses automatic labels for our own PRs right now, so I didn't want to deal with this problem.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I meant the workflow of adding the Type of Change value or Label, so that we can use these values while filtering PRs. The PR I created automatically adds label, so dev. doesn't need to do it. This way we don't need to introduce the PR title requirements. Since the labels are more reliable and useful.

Besides, how would you tell a developer which prefix to use in the title of their change? Maybe by adding information regarding that in the PR template?
So, developers then need to read those details and then update the PR title accordingly. I would propose to keep the existing Type of Change section, let dev. select the correct option there, as they do now. Then the workflow script automatically apply the correct label to the PR. So, basically nothing changes for developers and we get what we want.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@pratikmankawde let's discuss your suggestion offline & merge this PR to make things at least better going forward.

add_label: false

- name: Check if title starts with upper-case letter
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
if [[ ! "${PR_TITLE}" =~ ^[a-z]+:\ [\[A-Z] ]]; then
echo "Error: PR title must start with an upper-case letter."
exit 1
fi
8 changes: 8 additions & 0 deletions .github/workflows/test-check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
on:
pull_request:
types: [opened, edited, reopened, synchronize]
workflow_dispatch:

jobs:
test-check-pr-title:
uses: ./.github/workflows/check-pr-title.yml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Reusable workflows and actions for XRPLF repos

## Available Reusable Workflows

- `check-pr-title.yml`: Checks the title of Pull Requests against a specified pattern.
- `pre-commit.yml`: Runs `pre-commit` checks on code changes.
- `pre-commit-autoupdate.yml`: Runs `pre-commit autoupdate` to update pre-commit hooks.

Expand Down