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

Resolve issue with new git diff mechanism #166

Merged
merged 42 commits into from
May 7, 2021
Merged

Conversation

gudmdharalds
Copy link
Contributor

@gudmdharalds gudmdharalds commented May 3, 2021

Resolve a problem with the new git diff mechanism which in some cases can cause unexpected problems.

TODO:

  • Use git diff branch1...branch2 syntax
  • If git returns with fatal: bad object [commit-ID], fallback to GitHub API
    • Log to IRC when this happens
    • This will enable support for new commits outside of the current repository
    • Also, execution can continue, even if only partial repository is checked out
  • Note in README.md that vip-go-ci assumes a fully checked out repository
  • Update unit-tests
    • Add tests for vipgoci_github_diffs_fetch_unfiltered()
    • Rename GitRepoDiffsFetchUncachedTest.php to GitRepoDiffsFetchUnfilteredTest.php
    • Adjust GitRepoDiffsFetchUnfilteredTest.php
    • Adjust MiscPatchChangedLinesTest.php as well
      • Add more complex test
    • Adjust GitRepoDiffsFetchTest.php as well
      • Add test for commit-ID that is outside of the test-repository
    • Rename GitRepoDiffsFetchTest.php to GitDiffsFetchTest.php and vipgoci_gitrepo_diffs_fetch() to vipgoci_git_diffs_fetch()
    • Ensure GitRepoDiffsFetchUnfilteredTest.php and GitHubDiffsFetchUnfilteredTest.php use the same test-data, as they should return the same results
      • This effectively ensures that git diff via GitHub API and git diff via local repo returns the same data
  • Check automated unit-tests
  • Changelog entry
  • Run full-unit tests
  • Manual tests
    • Test with Pull-Request referring to another repository
    • Test with Pull-Request referring to local commit

@gudmdharalds gudmdharalds self-assigned this May 3, 2021
@gudmdharalds gudmdharalds changed the title Resolve issue with new git diff mechanism. Resolve issue with new git diff mechanism May 3, 2021
Copy link
Collaborator

@wpcomvip-vipgoci-bot wpcomvip-vipgoci-bot left a comment

Choose a reason for hiding this comment

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

phpcs scanning turned up:

🚫 2 errors

⚠️ 2 warnings


This bot provides automated PHP Linting and PHPCS scanning, read more here.

github-api.php Outdated Show resolved Hide resolved
tests/GitDiffsFetchUnfilteredTrait.php Show resolved Hide resolved
tests/GitHubDiffsFetchUnfilteredTest.php Show resolved Hide resolved
tests/GitHubDiffsFetchUnfilteredTest.php Show resolved Hide resolved
gudmdharalds added a commit that referenced this pull request May 7, 2021
@gudmdharalds gudmdharalds merged commit 4d4aaf0 into master May 7, 2021
gudmdharalds added a commit that referenced this pull request May 10, 2021
@gudmdharalds gudmdharalds added this to the 1.0.4 milestone May 11, 2021
@gudmdharalds gudmdharalds deleted the fix/git-diff-bug-1 branch May 24, 2021 10:54
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