Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fixes null commit date #985

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

Merged
merged 4 commits into from
Dec 29, 2020
Merged

Fixes null commit date #985

merged 4 commits into from
Dec 29, 2020

Conversation

lower-case
Copy link
Contributor

Description

Fixes #883

Method GHAuthor.getDate() was giving null because the date field was overridden in deprecated GHAuthor class but the field was populated only in GitUser class.

Before submitting a PR:

We love getting PRs, but we hate asking people for the same basic changes every time.

  • Push your changes to a branch other than master. Create your PR from that branch.
  • Add JavaDocs and other comments
  • Write tests that run and pass in CI. See CONTRIBUTING.md for details on how to capture snapshot data.
  • Run mvn clean compile locally. This may reformat your code, commit those changes.
  • Run mvn -D enable-ci clean install site locally. If this command doesn't succeed, your change will not pass CI.

When creating a PR:

  • Fill in the "Description" above.
  • Enable "Allow edits from maintainers".

@@ -0,0 +1,41 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

You might need to re-record. I don't see any use of this in the test.

GHRepository repo = gitHub.getRepository("hub4j/github-api");
GHCommit commit = repo.getCommit("ed4f9c8176866977677c99ac9668a8ce10231bc8");

assertNotNull(commit.getCommitShortInfo().getAuthoredDate());
Copy link
Member

@bitwiseman bitwiseman Nov 30, 2020

Choose a reason for hiding this comment

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

Please check for more than just not null. There is a known expected value that isn't going to change over time. Check for the correct value and that the two methods return the same value.

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!

Minor change to test data.

Also, there are other tests that return commit info. Please add some checks to other tests to verify this fix works on exiting tests and data.

@bitwiseman
Copy link
Member

@lower-case
Do you plan to continue work on this?

@bitwiseman bitwiseman merged commit dc615e4 into hub4j:master Dec 29, 2020
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.

GHCommit::ShortInfo::GHAuthor.getDate() returns null
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.