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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
aab8616
Use 'git diff foo1...foo2' syntax
gudmdharalds May 3, 2021
3a30772
Updating git command, adding statistics
gudmdharalds May 4, 2021
91688b3
Formatting of code
gudmdharalds May 4, 2021
b190c5c
Update README.md
gudmdharalds May 4, 2021
984eb16
Adding function to fetch diffs from GitHub API
gudmdharalds May 4, 2021
3f225a4
Cache support for local git diff function, fallback to GitHub API
gudmdharalds May 4, 2021
0094fb8
Change according to new usage of vipgoci_gitrepo_diffs_fetch()
gudmdharalds May 4, 2021
89fe4ae
Update to conform with new usage of functions
gudmdharalds May 4, 2021
8b5d333
Function was renamed, adding new tests and assertations
gudmdharalds May 4, 2021
e50dd6d
Renaming file to match function.
gudmdharalds May 4, 2021
1711118
Only add access token if longer than zero
gudmdharalds May 4, 2021
94af148
Fix test when no access token is available (hopefully)
gudmdharalds May 4, 2021
15aa47f
vipgoci_github_diffs_fetch_unfiltered(): Compatibility with local git…
gudmdharalds May 5, 2021
1159221
Initial import of unit-test
gudmdharalds May 5, 2021
6ffad6d
Trait class for common data
gudmdharalds May 5, 2021
1846b01
Alter tests to use common data trait.
gudmdharalds May 5, 2021
f607293
Define github-token, if not defined in INI
gudmdharalds May 5, 2021
02f163d
Define github-token, if not defined in INI
gudmdharalds May 5, 2021
631ebdd
Avoid unused variable
gudmdharalds May 5, 2021
9cbdc76
Adding namespace
gudmdharalds May 5, 2021
47ee4eb
Disable certain PHPCS tests
gudmdharalds May 5, 2021
8a5aabc
Define github-token, if not defined in INI
gudmdharalds May 5, 2021
490fd37
Define variables, adjust parameters for new usage
gudmdharalds May 5, 2021
f252e63
Define variables, adjust parameters for new usage
gudmdharalds May 5, 2021
afdc99e
Skip GitDiffsFetchUnfilteredTrait.php
gudmdharalds May 5, 2021
5fa6601
Log to IRC, rename function
gudmdharalds May 5, 2021
50a1359
Rename function
gudmdharalds May 5, 2021
6a06f9f
Rename file and tests
gudmdharalds May 5, 2021
94d2cee
Rename function, add data-source, add comment
gudmdharalds May 6, 2021
4bd8917
Add test, add data-source
gudmdharalds May 6, 2021
96e23f8
Adding constant for data-source
gudmdharalds May 6, 2021
1292c25
Renaming function
gudmdharalds May 6, 2021
f24dfb3
Adding new commits, and comment
gudmdharalds May 6, 2021
cb978db
Return with error when file is not part of patch
gudmdharalds May 6, 2021
9656cd1
Adding new commits for testing
gudmdharalds May 6, 2021
4b3cb9f
Log when no changed lines were available for file.
gudmdharalds May 6, 2021
ac6e8a4
Adding more assertions
gudmdharalds May 6, 2021
499e8de
Make documentation more specific.
gudmdharalds May 6, 2021
0d11f46
Remove variable assignment never used.
gudmdharalds May 6, 2021
2103e9a
Replace assertEquals() with assertSame()
gudmdharalds May 6, 2021
91388a0
Fixing tests
gudmdharalds May 6, 2021
af107d9
More fixes
gudmdharalds May 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update to conform with new usage of functions
  • Loading branch information
gudmdharalds committed May 4, 2021
commit 89fe4aedf9a1faf803ed10739db647047da07ed7
3 changes: 3 additions & 0 deletions ap-file-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ function vipgoci_ap_file_types(
foreach ( $prs_implicated as $pr_item ) {
$pr_diff = vipgoci_gitrepo_diffs_fetch(
$options['local-git-repo'],
$options['repo-owner'],
$options['repo-name'],
$options['token'],
$pr_item->base->sha,
$options['commit'],
true, // renamed files included
Expand Down
3 changes: 3 additions & 0 deletions ap-hashes-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ function vipgoci_ap_hashes_api_scan_commit(
*/
$pr_diff = vipgoci_gitrepo_diffs_fetch(
$options['local-git-repo'],
$options['repo-owner'],
$options['repo-name'],
$options['token'],
$pr_item->base->sha,
$options['commit'],
false, // exclude renamed files
Expand Down
3 changes: 3 additions & 0 deletions ap-nonfunctional-changes.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ function vipgoci_ap_nonfunctional_changes(
foreach ( $prs_implicated as $pr_item ) {
$pr_diff = vipgoci_gitrepo_diffs_fetch(
$options['local-git-repo'],
$options['repo-owner'],
$options['repo-name'],
$options['token'],
$pr_item->base->sha,
$options['commit'],
true, // renamed files included
Expand Down
3 changes: 3 additions & 0 deletions ap-svg-files.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ function vipgoci_ap_svg_files(
foreach ( $prs_implicated as $pr_item ) {
$pr_diff = vipgoci_gitrepo_diffs_fetch(
$options['local-git-repo'],
$options['repo-owner'],
$options['repo-name'],
$options['token'],
$pr_item->base->sha,
$options['commit'],
true, // include renamed files
Expand Down
3 changes: 3 additions & 0 deletions auto-approval.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,9 @@ function vipgoci_auto_approval_scan_commit(
foreach ( $prs_implicated as $pr_item ) {
$pr_diff = vipgoci_gitrepo_diffs_fetch(
$options['local-git-repo'],
$options['repo-owner'],
$options['repo-name'],
$options['token'],
$pr_item->base->sha,
$options['commit'],
true, // include renamed files
Expand Down
6 changes: 6 additions & 0 deletions phpcs-scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ function vipgoci_phpcs_scan_commit(

$pr_item_files_tmp = vipgoci_gitrepo_diffs_fetch(
$options['local-git-repo'],
$options['repo-owner'],
$options['repo-name'],
$options['token'],
$pr_item->base->sha,
$commit_id,
false, // exclude renamed files
Expand Down Expand Up @@ -781,6 +784,9 @@ function( $item ) {
*/
$file_changed_lines = vipgoci_patch_changed_lines(
$options['local-git-repo'],
$options['repo-owner'],
$options['repo-name'],
$options['token'],
$pr_item->base->sha,
$commit_id,
$file_name
Expand Down