Skip to content

Add polymorphic deserialization for event account. #1522

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

Closed
wants to merge 7 commits into from

Conversation

bloslo
Copy link
Contributor

@bloslo bloslo commented Sep 18, 2022

Description

Add polymorphic deserialization for the GHAppInstallation account field.
Fixes #1497

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:
    • If this PR fixes one or more issues, include "Fixes #" lines for each issue.
    • Provide links to relevant documentation on https://docs.github.com/en/rest where possible.
  • 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".

@codecov
Copy link

codecov bot commented Sep 18, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.89%. Comparing base (5380f59) to head (1581500).
Report is 298 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1522   +/-   ##
=========================================
  Coverage     79.89%   79.89%           
  Complexity     2197     2197           
=========================================
  Files           209      209           
  Lines          6670     6670           
  Branches        364      364           
=========================================
  Hits           5329     5329           
  Misses         1127     1127           
  Partials        214      214           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bloslo
Copy link
Contributor Author

bloslo commented Sep 30, 2022

@bitwiseman Can you review my changes? I know checks are breaking, but this is because I change a method signature. I don't see how this can be avoided.

P.S. I used the StackOverflow link you referenced in the issue as a source to implement the changes.

@bitwiseman
Copy link
Member

@bloslo
To address API breaks, you'll need to use WithBridgeMethods annotations. They preserve binary compatibility while letting you update the source API. Usage is described in the source file and there are plenty of examples in this project.

Copy link
Member

@bitwiseman bitwiseman left a comment

Choose a reason for hiding this comment

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

Changes look good, nicely done!

Add bridge methods to fix API breaks. The bridge will need to be a custom conversion method. And you'll need to add a test that makes sure the scenario where someone calls the old GHUser method when the instance is now aGHOrganization still works the same as before. You don't have to improve the behavior, just make sure it isn't any more broken.

@Haarolean
Copy link
Contributor

@bitwiseman is there a chance to get this merged in?

@bitwiseman
Copy link
Member

@Haarolean
See my previous comment. There are API breaking changes that need to be addressed (using bridge methods) before this can be merged.

@bitwiseman bitwiseman added the work-abandoned There hasn't been any activity on the PR in a while. Another contributor might want to pick it up. label Jun 20, 2024
@bitwiseman bitwiseman closed this Jun 20, 2024
@anujhydrabadi
Copy link
Contributor

@bitwiseman any chance we can have this in the 2.x release? I'm happy to recover this PR and re-test or re-implement if needed, but looks complete otherwise, as we do not need to worry about backward compatibility.

@bitwiseman
Copy link
Member

bitwiseman commented Apr 30, 2025

@anujhydrabadi
Please proceed. We still need to consider backward compatibility to some degree. But start by recovering the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-abandoned There hasn't been any activity on the PR in a while. Another contributor might want to pick it up.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GHUser even when event comes from Organization type
4 participants