github-api icon indicating copy to clipboard operation
github-api copied to clipboard

fix: fixed issue #1265

Open yixingz3 opened this issue 4 years ago • 1 comments

Description

Fixes issue #1265.

  • added null and empty check for 'ref' and throw IllegalArgumentException if null or empty is passed in. I'm not sure what would be the most appropriate type of exception to throw and would be very happy to change it if you see fits.
  • added tests to verify the issue is fixed

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 .
  • [x] 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.
  • [x] 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:
    • [x] 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."
  • [x] Enable "Allow edits from maintainers".

yixingz3 avatar Dec 05 '21 02:12 yixingz3

Codecov Report

Merging #1337 (800ab39) into main (68aeab2) will decrease coverage by 0.21%. The diff coverage is 100.00%.

:exclamation: Current head 800ab39 differs from pull request most recent head 3c031c5. Consider uploading reports for the commit 3c031c5 to get more accurate results

@@             Coverage Diff              @@
##               main    #1337      +/-   ##
============================================
- Coverage     78.40%   78.18%   -0.22%     
+ Complexity     2079     2047      -32     
============================================
  Files           201      200       -1     
  Lines          6354     6286      -68     
  Branches        357      356       -1     
============================================
- Hits           4982     4915      -67     
+ Misses         1164     1162       -2     
- Partials        208      209       +1     
Impacted Files Coverage Δ
src/main/java/org/kohsuke/github/GHWorkflow.java 90.00% <100.00%> (+0.71%) :arrow_up:
src/main/java/org/kohsuke/github/GHTeam.java 61.53% <0.00%> (-12.28%) :arrow_down:
src/main/java/org/kohsuke/github/GHPersonSet.java 35.71% <0.00%> (-7.15%) :arrow_down:
...c/main/java/org/kohsuke/github/GHOrganization.java 64.74% <0.00%> (-1.46%) :arrow_down:
.../org/kohsuke/github/GHRepositorySearchBuilder.java 81.57% <0.00%> (-0.48%) :arrow_down:
...rc/main/java/org/kohsuke/github/GHWorkflowRun.java 87.50% <0.00%> (-0.38%) :arrow_down:
src/main/java/org/kohsuke/github/GitHub.java 82.35% <0.00%> (ø)
src/main/java/org/kohsuke/github/GitUser.java 100.00% <0.00%> (ø)
...c/main/java/org/kohsuke/github/GHEventPayload.java 80.41% <0.00%> (ø)
...va/org/kohsuke/github/GHContentUpdateResponse.java 100.00% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 68aeab2...3c031c5. Read the comment docs.

codecov[bot] avatar Dec 07 '21 09:12 codecov[bot]