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

PR Summary by Sourcery includes info unrelated to PR #454

Closed
3 tasks done
alyssadai opened this issue Feb 17, 2025 · 1 comment
Closed
3 tasks done

PR Summary by Sourcery includes info unrelated to PR #454

alyssadai opened this issue Feb 17, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@alyssadai
Copy link

Checklist

Description

On a PR that updated a dependency version in our repo (Pydantic v1 to v2) and migrated the codebase to the new version's syntax, the initial "Summary by Sourcery" generated by the sourcery-ai bot was unusually verbose and contained a bunch of points unrelated to the changes in the PR.

See some examples highlighted below:
Image

Not sure if the extra info was somehow being extracted from Pydantic's own release notes, or somewhere else?

Upon re-generating the summary using @sourcery-ai summary, the second attempt was much shorter and closer to what I expected:

Summary by Sourcery

Upgrade the project to Pydantic v2, updating query models to use the new syntax and methods. This includes changes to type annotations, validation logic, and dependency updates.

Enhancements:

  • Improve validation of the is_control parameter by converting valid string values to boolean using BeforeValidator.
  • Use model_validator instead of root_validator for model validation.
  • Replace constr with Annotated and StringConstraints for type hinting and validation.

Build:

  • Upgrade Pydantic to version 2.10.6 and add required dependencies, including annotated-types, pydantic-settings, pydantic_core, and python-dotenv.
  • Update the typing extensions to 4.12.2.

Tests:

  • Add tests to ensure that valid is_control values are correctly parsed as booleans.

Any advice on how to prevent this from happening in the future would be appreciated!

Side question: is there any way to tell Sourcery to replace existing PR summaries/reviewer's guides/etc. that it has generated when the bot is re-triggered manually, instead of always adding a new comment or text block on top of what's already there? This could prevent PRs from becoming unnecessarily long and verbose. Can open a separate issue for this if needed.

Code snippet that reproduces issue

Debug Information

We are using the sourcery-ai GitHub app.

IDE Version:

Sourcery Version:

Operating system and Version:

@alyssadai alyssadai added the bug Something isn't working label Feb 17, 2025
@Hellebore
Copy link
Collaborator

Hi - we've now updated the model which should stop this from happening.

Could you create an issue with some more details and examples of the summary not being replaced? It should edit the existing comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants