Skip to content

Conversation

@raunakab
Copy link
Contributor

@raunakab raunakab commented Jul 22, 2025

Description

This PR updates the labeler job to spit out a better error message when title validation fails.

Addresses: https://linear.app/danswer/issue/DAN-2235/update-error-message-of-pr-labeler-job.

How Has This Been Tested?

CI refactor; no testing done.


Summary by cubic

Updated the PR title validation job to show a clearer error message when the title does not follow the Conventional Commits format.

  • Refactors
    • Replaced the old workflow with a new one that gives detailed feedback and examples when the PR title check fails.

@raunakab raunakab requested a review from a team as a code owner July 22, 2025 21:27
@vercel
Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 9:37pm

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic analysis

No issues found across 1 file. Review in cubic

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR refactors the PR labeler workflow by consolidating duplicate files and improving error messages for title validation failures. The change removes the empty .github/workflows/pr-labeller.yml file (note the double 'l') and adds a new .github/workflows/pr-labeler.yml file with enhanced functionality.

The new workflow validates PR titles against Conventional Commits format using a regex pattern that checks for standard prefixes like feat, fix, docs, etc. When validation fails, instead of providing a generic error message, the workflow now outputs a comprehensive, user-friendly message that includes:

  • Clear explanation of the Conventional Commits requirement
  • Reasoning behind the standard (changelog automation and project history)
  • A reference link to learn more about Conventional Commits
  • Concrete examples of valid PR titles

The workflow uses pull_request_target trigger with appropriate read permissions and runs the validation logic in a shell script. This change addresses Linear issue DAN-2235 and represents a typical DevOps improvement focused on developer experience - transforming unhelpful error messages into actionable guidance that helps developers understand and fix issues quickly.

Confidence score: 4/5

• This PR is very safe to merge as it only improves error messaging and removes duplicate files without changing core functionality
• High confidence because the changes are straightforward workflow improvements with clear intent and no complex logic
• The pr-labeler.yml file needs attention to verify the regex pattern and error message formatting are correct

2 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

Comment on lines +22 to +31
echo "::error::❌ Your PR title does not follow the Conventional Commits format.
This check ensures that all pull requests use clear, consistent titles that help automate changelogs and improve project history.

Please update your PR title to follow the Conventional Commits style.
Here is a link to a blog explaining the reason why we've included the Conventional Commits style into our PR titles: https://xfuture-blog.com/working-with-conventional-commits

**Here are some examples of valid PR titles:**
- feat: add user authentication
- fix(login): handle null password error
- docs(readme): update installation instructions"
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The multiline string in the echo command lacks proper quoting and may cause issues with shell interpretation of special characters like backticks and markdown formatting

@raunakab raunakab closed this Jul 22, 2025
@raunakab raunakab deleted the pr-labelel branch July 22, 2025 21:45
@raunakab
Copy link
Contributor Author

Closed in favour of: #5062. Typo in branch name 😭...

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants