Skip to content

Comments

feat: Add CiDetectedErrorFormatter for improved error output in GitHub and TeamCity while using the friendly formatter#40

Merged
yamadashy merged 2 commits intoyamadashy:mainfrom
marcreichel:add-ci-detected-error-formatter
Jan 26, 2026
Merged

feat: Add CiDetectedErrorFormatter for improved error output in GitHub and TeamCity while using the friendly formatter#40
yamadashy merged 2 commits intoyamadashy:mainfrom
marcreichel:add-ci-detected-error-formatter

Conversation

@marcreichel
Copy link
Contributor

@marcreichel marcreichel commented Jan 21, 2026

This PR adds the CiDetectedErrorFormatter so the output includes the relevant annotations for GitHub or TeamCity based on the detected environment while still being able to use the friendly formatter in CI pipelines.


Open with Devin

@gemini-code-assist
Copy link

Summary of Changes

Hello @marcreichel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the utility of the FriendlyErrorFormatter by enabling it to automatically detect the continuous integration environment and output errors with relevant annotations. This allows developers to leverage the friendly, readable error output while also benefiting from the native error reporting features of platforms like GitHub and TeamCity, making CI pipeline failures more actionable and easier to diagnose.

Highlights

  • New Feature: CI-aware Error Formatting: The FriendlyErrorFormatter now integrates CiDetectedErrorFormatter to provide environment-specific error annotations for CI platforms like GitHub and TeamCity, enhancing error visibility in pipelines.
  • Dependency Injection Update: The CiDetectedErrorFormatter is now injected into the FriendlyErrorFormatter's constructor, ensuring proper dependency management.
  • Error Output Prioritization: The formatErrors method in FriendlyErrorFormatter now first calls the CI-detected formatter to output annotations, followed by its standard friendly output.
  • Test Coverage: Unit tests for FriendlyErrorFormatter have been updated to reflect the new constructor arguments and ensure the integration works as expected.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for CI-specific error formatting by integrating CiDetectedErrorFormatter. This is a great addition for better integration with CI systems like GitHub Actions and TeamCity. The implementation correctly injects the new formatter and calls it to produce the CI-specific output.

My main feedback is regarding testing. The new functionality is not currently covered by tests. I've left a suggestion in the test file to add tests that verify the output in simulated CI environments. This will ensure the feature works as expected and prevents future regressions.

Overall, a good feature addition. Addressing the testing gap will make it solid.

@marcreichel
Copy link
Contributor Author

marcreichel commented Jan 21, 2026

@yamadashy Let me know if I should add a test as @gemini-code-assist suggested. But in my opinion a test for this is unnecessary, because it's a feature coming from PHPStan and the test here may break in the future eventually if PHPStan changes the implementation/output.

@marcreichel marcreichel marked this pull request as ready for review January 21, 2026 15:04
@yamadashy
Copy link
Owner

yamadashy commented Jan 22, 2026

Hi @marcreichel !

Thanks for the first PR!
I'll review it later.

…b and TeamCity while using the friendly formatter
@yamadashy yamadashy force-pushed the add-ci-detected-error-formatter branch from 930304a to d4b7c8f Compare January 26, 2026 14:31
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View issue and 3 additional flags in Devin Review.

Open in Devin Review

…test

- Add service definitions for GithubErrorFormatter, TeamcityErrorFormatter,
  and CiDetectedErrorFormatter in extension.neon
- Fix testSummaryShowsSpecialIdentifierNotes to pass CiDetectedErrorFormatter
  parameter to FriendlyErrorFormatter constructor
@yamadashy
Copy link
Owner

@marcreichel
I just added a small fix for extension.neon and the test.

Everything else looks good, so I'll merge this. Will release soon!
Thanks for the contribution!

@yamadashy yamadashy merged commit ff8cbb5 into yamadashy:main Jan 26, 2026
18 checks passed
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.

2 participants