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: fix issue #1325 and add missing truncated field in the GHGist object #1339

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

SCHJonathan
Copy link

Description

  1. Fixes #1325 by adding a lazy download from the raw_url field of GHGistFile object if the gist file content is uninitialized.
  2. From the list public gist documentation, I found out we are missing the truncated field in the GHGist object and I added that field in this PR.

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".

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.

Thanks for contributing.

Sorry about all the comments. This is basically a good PR with test coverage an everything, but you ran it in a bunch of the gotchas of working in the library all at once.

I'm happy to answer any questions you might have about the comments.

@SCHJonathan
Copy link
Author

@bitwiseman. Thank you so much for your help and detailed comment, bitwiseman! All of those suggestions are super helpful and I have made revisions based on your suggestions!

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.

A few more bits of feedback.

src/main/java/org/kohsuke/github/GHGistFile.java Outdated Show resolved Hide resolved
src/main/java/org/kohsuke/github/GHGistFile.java Outdated Show resolved Hide resolved
Comment on lines 110 to 111
public void setOwner(GHUser owner) {
this.owner = owner;
}
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, why add this?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, why add this?

Sorry, the reason I am adding this setter is that I want to pass the owner object from the GHGist object to each GHGistFile object so that get content can use owner.root() to create request. At a second thought, probably defining a wrapUp method to set the owner as the GHGist object owning this current GHGistFile object would make more sense. I have make this revision accordingly. Thank you again for your suggestions.

@bitwiseman bitwiseman changed the title fix: fix issue #1325 and add missing the truncate field in the GHGist object fix: fix issue #1325 and add missing truncated field in the GHGist object Feb 14, 2022
@bitwiseman
Copy link
Member

@SCHJonathan
You're very close on this. Do you time to finish this PR in the next few days? I plan to do a release soon.

@bitwiseman bitwiseman self-requested a review April 10, 2022 02:57
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.

It looks like some test is failing.

@bitwiseman bitwiseman marked this pull request as draft April 22, 2022 00:34
@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 Nov 12, 2022
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.

Accessing Gists via getMyself().listGists() returns null data for Gist files
2 participants