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: CET-4500 git vulnerability methods not respecting basepaths #20

Closed
wants to merge 4 commits into from

Conversation

imundra
Copy link

@imundra imundra commented Aug 16, 2023

Description

Need to get rid of this annotation for my mocking in unit tests to work. The annotation creates another method with the same name and arguments but with a different return type (prevented by Java/Kotlin but allowed by the JVM), see raphw/byte-buddy#1162 for more details

This prevents mocking from working properly

Before submitting a PR:

  • Changes must not break binary backwards compatibility. If you are unclear on how to make the change you think is needed while maintaining backward compatibility, CONTRIBUTING.md for details.
  • Add JavaDocs and other comments as appropriate. Consider including links in comments to relevant documentation on https://docs.github.com/en/rest .
  • Add tests that cover any added or changed code. This generally requires capturing snapshot test data. See CONTRIBUTING.md for details.
  • Run mvn -D enable-ci clean install site locally. If this command doesn't succeed, your change will not pass CI.
  • Push your changes to a branch other than main. You will create your PR from that branch.

When creating a PR:

  • Fill in the "Description" above with clear summary of the changes. This includes:
  • All lines of new code should be covered by tests as reported by code coverage. Any lines that are not covered must have PR comments explaining why they cannot be covered. For example, "Reaching this particular exception is hard and is not a particular common scenario."
  • Enable "Allow edits from maintainers".

run: mvn --batch-mode deploy
run: mvn deploy -Dmaven.test.skip -Dspotless.check.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true -Djacoco.skip=true -Dspotbugs.skip -Dmaven.surefire.debug
Copy link
Author

@imundra imundra Aug 16, 2023

Choose a reason for hiding this comment

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

are we cool with changing this? doesn't look like the CI publishing is working right now so worth an update I think!
https://www.notion.so/cortexio/How-to-publish-Github-Api-e80324a13abf4497afaa67e0a215e53a

@imundra imundra requested review from eyalfoni and maddymanu August 16, 2023 20:42
Copy link

@maddymanu maddymanu left a comment

Choose a reason for hiding this comment

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

This feels like the wrong path forward.
This code is coming from a 3rd party API. We shouldn't modify it only to make mocking easier.

Could you share a sample PR for our internal code that isn't able to mock the vulnerability accurately?

@imundra
Copy link
Author

imundra commented Aug 16, 2023

This feels like the wrong path forward. This code is coming from a 3rd party API. We shouldn't modify it only to make mocking easier.

Could you share a sample PR for our internal code that isn't able to mock the vulnerability accurately?

This section here
Screenshot 2023-08-16 at 4 16 27 PM

Without removing this annotation, it says that it expects a string for the mocked return value rather than a URL

https://github.com/cortexapps/brain-backend/pull/3663/files

@imundra imundra closed this Aug 21, 2023
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