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

Fix Pydantic warnings #3557

Merged
merged 9 commits into from
Sep 23, 2024
Merged

Fix Pydantic warnings #3557

merged 9 commits into from
Sep 23, 2024

Conversation

ammar92
Copy link
Contributor

@ammar92 ammar92 commented Sep 18, 2024

Changes

This PR fixes a few Pydantic deprecation warnings:

  • Misuse of deprecated functions
  • Misuse of extra keyword arguments in Field
  • Models with a schema field shadows out the internal BaseModule.schema field

Issue link

Closes #3507

QA notes

  • Check if you can create and update OOIs
  • Check the boefje setup/ variants view and validate that the schema gets saved

Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@ammar92 ammar92 marked this pull request as ready for review September 18, 2024 15:35
@ammar92 ammar92 requested a review from a team as a code owner September 18, 2024 15:35
Copy link
Contributor

@Donnype Donnype left a comment

Choose a reason for hiding this comment

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

Looks good! (Although I still find the old Pydantic API cleaner ^^)

@stephanie0x00
Copy link
Contributor

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.
  • I checked the logs for errors and/or warnings and made issues where necessary

What works:

Looks good from what I can see. Tasks are created and run as expected. Findings are created.

What doesn't work:

Bug or feature?:

n/a

@underdarknl underdarknl merged commit 1ba9bc6 into main Sep 23, 2024
38 checks passed
@underdarknl underdarknl deleted the fix/pydantic-warnings branch September 23, 2024 12:08
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.

The Boefje.schema field shadows out BaseModel.schema
4 participants