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,TST] resolve refs when not run from a repo #35

Merged
merged 2 commits into from
Oct 29, 2020

Conversation

minrk
Copy link
Contributor

@minrk minrk commented Oct 29, 2020

Get the tests passing again (related to #28 since tests aren't run on CI right now)

  • test_cli was failing due to the repository transfer to executablebooks. Updating the repo URL in the test and expected output got it passing again
  • test_pr_split failed to resolve jupyter-book tags as dates because _validate_git_ref assumes the target repo is cloned and up-to-date in the current directory. This is fixed by unconditionally attempting to resolve refs via GitHub API, and falling back on date parsing when that fails for any reason. The result is that repos no longer need to be cloned to collect activity between refs.

previous behavior used `_valid_git_reference_check` which assumes the target repo is cloned and up-to-date in the current directory

Instead, always attempt to resolve refs with the GitHub API and only fallback on date parsing if it fails,
avoiding the need to clone the repo.
repo has been migrated from choldgraf/github-activity to executablebooks org

github-activity produces empty results when run on the old URL
@welcome
Copy link

welcome bot commented Oct 29, 2020

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.

Welcome to the EBP community! 🎉

"{0} not found as a ref or valid date format".format(
datetime_or_git_ref
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

As part of this refactoring, _valid_git_reference_check is no longer used. Can you delete its definition and the import of it as well?

Copy link
Collaborator

@consideRatio consideRatio Oct 29, 2020

Choose a reason for hiding this comment

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

It is very helpful that you write except Exception as datetime_error: even though datetime_error isn't used for readability, I'll remember this trick!

@choldgraf choldgraf merged commit 48054b6 into executablebooks:master Oct 29, 2020
@welcome
Copy link

welcome bot commented Oct 29, 2020

Congrats on your first merged pull request in this project! 🎉
congrats

Thank you for contributing, we are very proud of you! ❤️

@choldgraf
Copy link
Member

@minrk did you do some kind of dark magic to link this pr with #36 somehow? When I merged that one this seemed to auto merge. Am I just being silly and sleep deprived?!

@consideRatio
Copy link
Collaborator

@choldgraf it is GitHub that did the automagic, since you merged that and this PR contained all commits part of that, github realized that this can be considered merged as well.

@consideRatio
Copy link
Collaborator

I'll open a PR to resolve my comment

@choldgraf
Copy link
Member

I am so confused haha 😄

@consideRatio
Copy link
Collaborator

:D

What happened was that you merged PR B which contained commit 1, 2, and 3. But this PR, PR A, contained commit 1, and 2.

So, when you merged PR B, GitHub realized that it was equivalent to merging this first and then PR B, so it decided to consider this (PR A) merged.

@choldgraf
Copy link
Member

I had no idea that github was so smart about this!

@minrk minrk deleted the tests-pass branch October 30, 2020 07:29
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.

3 participants