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

Be a lot more flexible as for GHMemberChanges values #1821

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

gsmet
Copy link
Contributor

@gsmet gsmet commented Mar 20, 2024

Unfortunately, things are not consistent between added and edited for the member event.

added provide a permission of some sort and a role name (sometimes...) edited only provides permission and it's not exactly the same ones

For now, I think we need to return strings to avoid issues until GitHub adjusts the API.

@bitwiseman you were entirely right, it's a big mess. My tests didn't show it, I don't know exactly why, maybe it depends on the roles/repositories or if you are using GH or GH Enterprise.

I kept the backwards compatibility and did a translation that is as good as possible.

Unfortunately, I have a user who is blocked by this so if it makes sense to you and you think it goes in the right direction, I would appreciate it being merged and if you could release a new release (sorry I know it's annoying but this inconsistency is really problematic and it was hard to figure it out :/).

Unfortunately, things are not consistent between added and edited.

added provide a permission of some sort and a role name (sometimes...)
edited only provides permission and it's not exactly the same ones

For now, I think we need to return strings to avoid issues until GitHub
adjusts the API.
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 45.45455% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 80.64%. Comparing base (1aa7178) to head (092d254).
Report is 9 commits behind head on main.

Files Patch % Lines
.../main/java/org/kohsuke/github/GHMemberChanges.java 45.45% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1821      +/-   ##
============================================
- Coverage     80.66%   80.64%   -0.03%     
- Complexity     2342     2354      +12     
============================================
  Files           220      223       +3     
  Lines          7082     7185     +103     
  Branches        379      395      +16     
============================================
+ Hits           5713     5794      +81     
- Misses         1132     1145      +13     
- Partials        237      246       +9     

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

@gsmet
Copy link
Contributor Author

gsmet commented Mar 20, 2024

I think the bridge methods are causing the coverage issue. I added some tests in the bridge methods test.

@bitwiseman bitwiseman merged commit c2b2f4e into hub4j:main Mar 20, 2024
9 of 11 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