Skip to content
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

ci: add issue title check #273

Merged
merged 3 commits into from
Feb 3, 2025
Merged

Conversation

soma00333
Copy link
Contributor

@soma00333 soma00333 commented Feb 2, 2025

Commit Message

This introduces a new GitHub Actions workflow to check the length of issue titles and provide feedback if they exceed a specified limit.

Related Issues/PRs (if applicable)

Fixes #270

Special notes for reviewers (if applicable)

.github/workflows/issue_title_check.yaml: Created a new workflow named "Issue Title Check" that triggers on issue creation and edits. It includes two jobs: check_title_length to validate the title length and comment_if_long to leave a comment if the title is too long.
I checked the behavior with the forked repository.
image

Signed-off-by: soma00333 <soma03432303@gmail.com>
@soma00333 soma00333 requested a review from a team as a code owner February 2, 2025 12:00
Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

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

thank you!

.github/workflows/issue_title_check.yaml Outdated Show resolved Hide resolved
.github/workflows/issue_title_check.yaml Show resolved Hide resolved
@mathetake mathetake self-assigned this Feb 2, 2025
Signed-off-by: soma00333 <soma03432303@gmail.com>
@soma00333
Copy link
Contributor Author

Worked in the forked repo
image

@soma00333 soma00333 requested a review from mathetake February 3, 2025 00:57
@soma00333
Copy link
Contributor Author

I appreciate your quick review.
Please retake a look.

Comment on lines 11 to 27
check_title_length:
runs-on: ubuntu-latest
steps:
- name: Check issue title length
id: check_length
run: |
TITLE="${{ github.event.issue.title }}"
LENGTH=$(echo -n "$TITLE" | wc -m)

echo "Title: $TITLE"
echo "Length: $LENGTH"

if [ "$LENGTH" -ge 60 ]; then
echo "title_is_too_long=true" >> $GITHUB_OUTPUT
else
echo "title_is_too_long=false" >> $GITHUB_OUTPUT
fi
Copy link
Member

Choose a reason for hiding this comment

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

do this in

        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mathetake
Okay, I'll switch it to the script
Just to confirm, do we need two steps (1. Check 2. Comment) or just one step (1. Check and Comment)?

Copy link
Member

Choose a reason for hiding this comment

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

Just one step and do all in one script!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, now I got it.
I missed this comment #273 (comment)
Let me fix
Thank you for your quick response

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed here cb69514

Signed-off-by: soma00333 <soma03432303@gmail.com>
@soma00333
Copy link
Contributor Author

Confirmed it in the forked repo.
Now, the logic is implemented using actions-script in a single step, completing successfully with a green status regardless of the title length.

image

@soma00333 soma00333 requested a review from mathetake February 3, 2025 08:57
console.log(`Title: ${issueTitle}`);
console.log(`Length: ${length}`);

if (length >= 60) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this specific value chosen instead of the commonly used 72?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @leseb
Thank you for your comment
There is no particular reason. I think 72 would work just as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to clarify, a 72-character limit is common for commit messages, not GitHub issues. This is the first time I’ve seen such enforcement. IMO, if a bot must enforce a length, a more flexible cap (like 80 characters) would be better than something as restrictive as 60. My 2 cents.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Your opinion makes sense
We should consider this, thank you

@mathetake
Should we enforce a stricter character limit (current 60), or should it be more flexible (like 80)?
Since GitHub Actions only writes a comment on the issue, I think strict (60) is fine.

Copy link
Member

Choose a reason for hiding this comment

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

so i don't care about what is "right" but just i hate multi line issue titles. and as you guys see 72 is a typical characters for git commits, not issues. For that purpose, 60 satisfies and I guess 72 doesn't (GitHub UI can change at any moment without out control though.) So let's go ahead with 60 and see how other people say - i am 100% open to change it later!

Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

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

Thank you for multiple iterations @soma00333 + thanks @leseb for your input as always

@mathetake mathetake merged commit 17ecbc3 into envoyproxy:main Feb 3, 2025
17 checks passed
@soma00333
Copy link
Contributor Author

Thank you for your deep insight, both

ericmariasis pushed a commit to ericmariasis/ai-gateway that referenced this pull request Feb 7, 2025
**Commit Message**

This introduces a new GitHub Actions workflow to check the length of
issue titles and provide feedback if they exceed a specified limit.

**Related Issues/PRs (if applicable)**

Fixes envoyproxy#270

---------

Signed-off-by: soma00333 <soma03432303@gmail.com>
Signed-off-by: Eric Mariasis <ericmariasis829@gmail.com>
missBerg pushed a commit to melsal13/ai-gateway that referenced this pull request Feb 9, 2025
**Commit Message**

This introduces a new GitHub Actions workflow to check the length of
issue titles and provide feedback if they exceed a specified limit.

**Related Issues/PRs (if applicable)**

Fixes envoyproxy#270

---------

Signed-off-by: soma00333 <soma03432303@gmail.com>
Signed-off-by: Erica Hughberg <erica.sundberg.90@gmail.com>
daixiang0 pushed a commit to daixiang0/ai-gateway that referenced this pull request Feb 19, 2025
**Commit Message**

This introduces a new GitHub Actions workflow to check the length of
issue titles and provide feedback if they exceed a specified limit.

**Related Issues/PRs (if applicable)**

Fixes envoyproxy#270

---------

Signed-off-by: soma00333 <soma03432303@gmail.com>
Signed-off-by: Loong <long0dai@foxmail.com>
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.

Add a github actions bot to check issue title length check
3 participants