diff --git a/README.md b/README.md index d0cd3cefa..575d172fd 100644 --- a/README.md +++ b/README.md @@ -645,16 +645,6 @@ For example: {"post-generic-pr-support-comments":false} ``` -### Support labels - -`vip-go-ci` can put labels on pull requests indicating level of support provided. With this feature configured, `vip-go-ci` will attach a label to every new pull request that does not have it. For this to work, it will need access to a `repo-meta API` that needs to be available and `vip-go-ci` has to be configured to work with. - -This feature can be used in the following way: - -> ./vip-go-ci.php --set-support-level-label=true --set-support-level-field="support-level" --repo-meta-api-base-url="http://myrepometa-api.mycompany.is" --repo-meta-api-user-id=7334005 --repo-meta-api-access-token="MY-TOKEN" - -Note that by default, all support level labels have a prefix: `[Support Level]`. This can be changed by using the `--set-support-level-label-prefix` option. - ### IRC support `vip-go-ci` supports posting certain logged messages to a HTTP API that will eventually relay the information to a IRC channel. This can of course be any IRC-like system, as long as the HTTP API behaves the same. This is useful if you need to have some information submitted to a monitoring system, for instance. @@ -751,8 +741,8 @@ repo-meta-api-user-id= ; User ID for the meta API repo-meta-api-access-token= ; Access token for the meta API repo-owner= ; Repository owner for the test, should be found in meta API repo-name= ; Repository name for the test -support-level= ; Name of support level given by meta API -support-level-field-name= ; Support level field name in meta API +support-level= ; Name of support level given by meta API (only used in tests) +support-level-field-name= ; Support level field name in meta API (only used in tests) ``` This file is not included, and needs to be configured manually. diff --git a/main.php b/main.php index d518c35ac..1ba204b5b 100755 --- a/main.php +++ b/main.php @@ -205,12 +205,6 @@ function vipgoci_help_print() :void { "\t" . ' matches the criteria specified here.' . PHP_EOL . "\t" . ' See README.md for usage.' . PHP_EOL . PHP_EOL . - 'Support level configuration:' . PHP_EOL . - "\t" . '--set-support-level-label=BOOL Whether to attach support level labels to pull requests.' . PHP_EOL . - "\t" . ' Will fetch information on support levels from repo-meta API.' . PHP_EOL . - "\t" . '--set-support-level-label-prefix=STRING Prefix to use for support level labels. Should be longer than five letters.' . PHP_EOL . - "\t" . '--set-support-level-field=STRING Field in responses from repo-meta API which we use to extract support level.' . PHP_EOL . - PHP_EOL . 'Repo meta API configuration:' . PHP_EOL . "\t" . '--repo-meta-api-base-url=STRING Base URL to repo-meta API, containing support level and other' . PHP_EOL . "\t" . ' information.' . PHP_EOL . @@ -335,13 +329,6 @@ function vipgoci_options_recognized() :array { 'post-generic-pr-support-comments-branches:', 'post-generic-pr-support-comments-repo-meta-match:', - /* - * Support level configuration - */ - 'set-support-level-label:', - 'set-support-level-label-prefix:', - 'set-support-level-field:', - /* * Repo meta API configuration. */ @@ -1712,50 +1699,6 @@ function vipgoci_run_cleanup_irc( array &$options ) :void { */ } -/** - * Set support level label options. - * - * @param array $options Array of options. - * - * @return void - */ -function vipgoci_run_init_options_set_support_level_label( - array &$options -) :void { - /* - * Handle option for setting support - * labels. Handle prefix and field too. - */ - - vipgoci_option_bool_handle( - $options, - 'set-support-level-label', - 'false' - ); - - if ( - ( isset( $options['set-support-level-label-prefix'] ) ) && - ( strlen( $options['set-support-level-label-prefix'] ) > 5 ) - ) { - $options['set-support-level-label-prefix'] = trim( - $options['set-support-level-label-prefix'] - ); - } else { - $options['set-support-level-label-prefix'] = null; - } - - if ( - ( isset( $options['set-support-level-field'] ) ) && - ( strlen( $options['set-support-level-field'] ) > 1 ) - ) { - $options['set-support-level-field'] = trim( - $options['set-support-level-field'] - ); - } else { - $options['set-support-level-field'] = null; - } -} - /** * Set repo-meta API options. * @@ -2145,9 +2088,6 @@ function vipgoci_run_init_options( // Set options relating to generic PR support comments. vipgoci_run_init_options_post_generic_pr_support_comments( $options ); - // Set options relating to support level labels. - vipgoci_run_init_options_set_support_level_label( $options ); - // Set options relating to the repo-meta API. vipgoci_run_init_options_repo_meta_api( $options ); @@ -2770,13 +2710,6 @@ function vipgoci_run_scan( $prs_implicated ); - /* - * Add support level label, if: - * - configured to do so - * - data is available in repo-meta API - */ - vipgoci_support_level_label_set( $options ); - if ( true === $options['phpcs'] ) { /* * Verify that sniffs specified on command line diff --git a/support-level-label.php b/repo-meta-api.php similarity index 51% rename from support-level-label.php rename to repo-meta-api.php index 07ae38683..d03a3d43d 100644 --- a/support-level-label.php +++ b/repo-meta-api.php @@ -294,275 +294,3 @@ function vipgoci_repo_meta_api_data_match( return $ret_val; } -/** - * Attach support level label to - * pull requests, if configured to - * do so. Will fetch information - * about support-level from an API. - * - * @param array $options Options needed. - * - * @return bool Boolean true when label is set - * or is already set, false when - * should not be set or on failure. - */ -function vipgoci_support_level_label_set( - array $options -) :bool { - - if ( true !== $options['set-support-level-label'] ) { - vipgoci_log( - 'Not attaching support label to pull requests ' . - 'implicated by commit, as not configured ' . - 'to do so', - array( - 'set_support_level_label' - => $options['set-support-level-label'], - ) - ); - - return false; - } - - vipgoci_log( - 'Attaching support-level label to pull requests implicated by commit', - array( - 'repo_owner' => $options['repo-owner'], - 'repo_name' => $options['repo-name'], - 'commit' => $options['commit'], - 'repo_meta_api_base_url' => - ( ! empty( $options['repo-meta-api-base-url'] ) ? - $options['repo-meta-api-base-url'] : '' ), - ), - 0, - true - ); - - if ( - ( empty( $options['repo-meta-api-base-url'] ) ) - ) { - vipgoci_log( - 'Missing URL for repo-meta API, skipping' - ); - - return false; - } - - if ( - ( empty( $options['set-support-level-field'] ) ) - ) { - vipgoci_log( - 'Missing field for support level in repo-meta API, skipping' - ); - - return false; - } - - /* - * Get information from API about the - * repository, including support level. - */ - - $repo_meta_data = vipgoci_repo_meta_api_data_fetch( - $options['repo-meta-api-base-url'], - $options['repo-meta-api-user-id'], - $options['repo-meta-api-access-token'], - $options['repo-owner'], - $options['repo-name'] - ); - - /* - * Construct support-level label - * from information found in API, - * if available. - */ - - if ( ! empty( $options['set-support-level-label-prefix'] ) ) { - $support_label_prefix = $options['set-support-level-label-prefix']; - } else { - $support_label_prefix = '[Support Level]'; - } - - $support_label_from_api = ''; - - if ( - ( ! empty( - $repo_meta_data['data'] - ) ) - && - ( ! empty( - $repo_meta_data['data'][0][ $options['set-support-level-field'] ] - ) ) - ) { - /* - * Construct the label itself - * from prefix and support level - * found in API. - */ - $support_label_from_api = - $support_label_prefix . - ' ' . - ucfirst( - strtolower( - $repo_meta_data['data'][0][ $options['set-support-level-field'] ] - ) - ); - } - - $support_level_response = ( - isset( $repo_meta_data['data'][0][ $options['set-support-level-field'] ] ) ? - $repo_meta_data['data'][0][ $options['set-support-level-field'] ] : - '' - ); - - /* - * No support label found in API, so - * do not do anything. - */ - if ( empty( $support_label_from_api ) ) { - vipgoci_log( - 'Found no valid support level in repo-meta API, so not ' . - 'attaching any label (nor removing)', - array( - 'repo_owner' => $options['repo-owner'], - 'repo_name' => $options['repo-name'], - 'repo_meta_api_base_url' => $options['repo-meta-api-base-url'], - 'support_level_response' => $support_level_response, - ) - ); - - return false; - } else { - vipgoci_log( - 'Found valid support level in API, making alterations as needed', - array( - 'repo_owner' => $options['repo-owner'], - 'repo_name' => $options['repo-name'], - 'repo_meta_api_base_url' => $options['repo-meta-api-base-url'], - 'support_level_response' => $support_level_response, - 'support_label_from_api' => $support_label_from_api, - ) - ); - } - - /* - * Get pull requests associated with the - * commit and repository. - */ - $prs_implicated = vipgoci_github_prs_implicated( - $options['repo-owner'], - $options['repo-name'], - $options['commit'], - $options['token'], - $options['branches-ignore'], - $options['skip-draft-prs'] - ); - - /* - * Loop through each pull request, - * remove any invalid support levels - * and add a correct one. - * - * If everything is correct, will not - * make any alterations. - */ - foreach ( $prs_implicated as $pr_item ) { - $pr_correct_support_label_found = false; - - /* - * Get labels for PR. - */ - $pr_item_labels = - vipgoci_github_pr_labels_get( - $options['repo-owner'], - $options['repo-name'], - $options['token'], - $pr_item->number - ); - - /* - * If no found, substitute boolean for empty array. - */ - if ( false === $pr_item_labels ) { - $pr_item_labels = array(); - } - - /* - * Loop through each label found for - * pull request, figure out if is support - * label, remove if not the same as is supposed - * to be set. - */ - foreach ( - $pr_item_labels as $pr_item_label - ) { - if ( strpos( - $pr_item_label->name, - $support_label_prefix . ' ' - ) !== 0 ) { - /* - * Not support level - * label, skip. - */ - continue; - } - - if ( $pr_item_label->name === $support_label_from_api ) { - $pr_correct_support_label_found = true; - - /* - * We found correct support label - * associated, note that for later - * use. - */ - continue; - } - - /* - * All conditions met; is support level - * label, but incorrect one, so remove label. - */ - vipgoci_github_pr_label_remove( - $options['repo-owner'], - $options['repo-name'], - $options['token'], - $pr_item->number, - $pr_item_label->name, - false - ); - } - - if ( true === $pr_correct_support_label_found ) { - /* - * Add support label if found in API but - * not if correct one is associated on - * GitHub already. - */ - vipgoci_log( - 'Correct support label already attached to pull request, skipping', - array( - 'repo_owner' => $options['repo-owner'], - 'repo_name' => $options['repo-name'], - 'support_label_from_api' => $support_label_from_api, - ) - ); - } elseif ( false === $pr_correct_support_label_found ) { - /* - * A support label was found in API and - * a correct one was not associated on - * GitHub already, so add one. - */ - vipgoci_github_label_add_to_pr( - $options['repo-owner'], - $options['repo-name'], - $options['token'], - $pr_item->number, - $support_label_from_api - ); - } - } - - return true; -} - - diff --git a/requires.php b/requires.php index 729658203..a8ab9bbc0 100644 --- a/requires.php +++ b/requires.php @@ -31,10 +31,10 @@ require_once __DIR__ . '/output-security.php'; require_once __DIR__ . '/phpcs-scan.php'; require_once __DIR__ . '/reports.php'; +require_once __DIR__ . '/repo-meta-api.php'; require_once __DIR__ . '/results.php'; require_once __DIR__ . '/skip-file.php'; require_once __DIR__ . '/statistics.php'; -require_once __DIR__ . '/support-level-label.php'; require_once __DIR__ . '/svg-scan.php'; // Require file that executes vipgoci_run(). diff --git a/tests/integration/SupportLevelLabelMetaApiDataFetchTest.php b/tests/integration/RepoMetaApiRepoMetaApiDataFetchTest.php similarity index 56% rename from tests/integration/SupportLevelLabelMetaApiDataFetchTest.php rename to tests/integration/RepoMetaApiRepoMetaApiDataFetchTest.php index ff0affabf..714ae5ceb 100644 --- a/tests/integration/SupportLevelLabelMetaApiDataFetchTest.php +++ b/tests/integration/RepoMetaApiRepoMetaApiDataFetchTest.php @@ -1,23 +1,46 @@ null, - 'repo-meta-api-user-id' => null, - 'repo-meta-api-access-token' => null, +namespace Vipgoci\Tests\Integration; - 'repo-owner' => null, - 'repo-name' => null, +use PHPUnit\Framework\TestCase; - 'support-level' => null, - 'support-level-field-name' => null, +/** + * Class that implements the testing. + * + * @runTestsInSeparateProcesses + * @preserveGlobalState disabled + */ +final class RepoMetaApiRepoMetaApiDataFetchTest extends TestCase { + /** + * Options for repo meta API. + * + * @var $options_meta_api_secrets + */ + private array $options_meta_api_secrets = array( + 'repo-meta-api-base-url' => null, + 'repo-meta-api-user-id' => null, + 'repo-meta-api-access-token' => null, + 'repo-owner' => null, + 'repo-name' => null, + 'support-level' => null, + 'support-level-field-name' => null, ); + /** + * Setup function. Require files, etc. + * + * @return void + */ protected function setUp(): void { + require_once __DIR__ . '/IncludesForTests.php'; + vipgoci_unittests_get_config_values( 'repo-meta-api-secrets', $this->options_meta_api_secrets, @@ -37,15 +60,24 @@ protected function setUp(): void { } } + /** + * Tear down function. Unset variables. + * + * @return void + */ protected function tearDown(): void { - $this->options_meta_api_secrets = null; - $this->options = null; + unset( $this->options_meta_api_secrets ); + unset( $this->options ); } /** + * Test common usage of the function. + * + * @return void + * * @covers ::vipgoci_repo_meta_api_data_fetch */ - public function testMetaApiDataFetch() { + public function testMetaApiDataFetch() :void { $options_test = vipgoci_unittests_options_test( $this->options, array( 'repo-meta-api-user-id', 'repo-meta-api-access-token' ), @@ -70,19 +102,13 @@ public function testMetaApiDataFetch() { ) > 0 ); - $this->assertTrue( - ( ! empty( - $repo_meta_data['data'][0][ - $this->options['support-level-field-name'] - ] - ) ) + $this->assertNotEmpty( + $repo_meta_data['data'][0][ $this->options['support-level-field-name'] ] ); $this->assertSame( $this->options['support-level'], - $repo_meta_data['data'][0][ - $this->options['support-level-field-name'] - ] + $repo_meta_data['data'][0][ $this->options['support-level-field-name'] ] ); /* diff --git a/tests/integration/SupportLevelLabelRepoMetaApiDataMatchTest.php b/tests/integration/RepoMetaApiRepoMetaApiDataMatchTest.php similarity index 98% rename from tests/integration/SupportLevelLabelRepoMetaApiDataMatchTest.php rename to tests/integration/RepoMetaApiRepoMetaApiDataMatchTest.php index 8d2d3f0bd..ce4650fc9 100644 --- a/tests/integration/SupportLevelLabelRepoMetaApiDataMatchTest.php +++ b/tests/integration/RepoMetaApiRepoMetaApiDataMatchTest.php @@ -4,7 +4,7 @@ use PHPUnit\Framework\TestCase; -final class SupportLevelLabelRepoMetaApiDataMatchTest extends TestCase { +final class RepoMetaApiRepoMetaApiDataMatchTest extends TestCase { var $options_meta_api_secrets = array( 'repo-meta-api-base-url' => null, 'repo-meta-api-user-id' => null, diff --git a/tests/integration/SupportLevelLabelSetTest.php b/tests/integration/SupportLevelLabelSetTest.php deleted file mode 100644 index 73270f870..000000000 --- a/tests/integration/SupportLevelLabelSetTest.php +++ /dev/null @@ -1,262 +0,0 @@ - null, - 'repo-meta-api-user-id' => null, - 'repo-meta-api-access-token' => null, - - 'support-level' => null, - 'support-level-field-name' => null, - ); - - var $options_git = array( - 'git-path' => null, - 'github-repo-url' => null, - 'repo-name' => null, - 'repo-owner' => null, - ); - - protected function setUp(): void { - vipgoci_unittests_get_config_values( - 'repo-meta-api-secrets', - $this->options_meta_api_secrets, - true - ); - - vipgoci_unittests_get_config_values( - 'git', - $this->options_git - ); - - $this->options = array_merge( - $this->options_meta_api_secrets, - $this->options_git - ); - - $this->options['branches-ignore'] = array(); - - $this->options['token'] = - vipgoci_unittests_get_config_value( - 'git-secrets', - 'github-token', - true // Fetch from secrets file - ); - - $this->options['commit'] = - vipgoci_unittests_get_config_value( - 'repo-meta-api', - 'commit-support-level-set-test' - ); - - $this->options['set-support-level-label-prefix'] = - '[MySupport Level]'; - - $this->options['skip-draft-prs'] = false; - - // This can be an empty string, set to empty if null. - if ( null === $this->options['repo-meta-api-user-id'] ) { - $this->options['repo-meta-api-user-id'] = ''; - } - - // This can be an empty string, set to empty if null. - if ( null === $this->options['repo-meta-api-access-token'] ) { - $this->options['repo-meta-api-access-token'] = ''; - } - } - - protected function tearDown(): void { - $this->options_meta_api_secrets = null; - $this->options_git = null; - $this->options = null; - } - - protected function _findPrsImplicated() { - return vipgoci_github_prs_implicated( - $this->options['repo-owner'], - $this->options['repo-name'], - $this->options['commit'], - $this->options['token'], - $this->options['branches-ignore'] - ); - } - - /* - * Loop through each PR, count - * number of support-level labels - * found and return. - */ - - protected function _findSupportLabelstoPrs() { - $support_labels_cnt = 0; - - $prs_implicated = $this->_findPrsImplicated(); - - foreach ( $prs_implicated as $pr_item ) { - $pr_item_labels = vipgoci_github_pr_labels_get( - $this->options['repo-owner'], - $this->options['repo-name'], - $this->options['token'], - $pr_item->number, - null, - true // Avoid cache - ); - - /* - * False can indicate none was found. - */ - - if ( false === $pr_item_labels ) { - continue; - } - - foreach( $pr_item_labels as $label_item ) { - if ( - $this->options['set-support-level-label-prefix'] . ' ' . ucfirst( strtolower( $this->options['support-level'] ) ) - === - $label_item->name - ) { - $support_labels_cnt++; - } - } - } - - return $support_labels_cnt; - } - - /** - * @covers ::vipgoci_support_level_label_set - */ - public function testSupportLevelSet1() { - $options_test = vipgoci_unittests_options_test( - $this->options, - array( 'repo-meta-api-user-id', 'repo-meta-api-access-token' ), - $this - ); - - $this->options['set-support-level-label'] = false; - - $this->options['set-support-level-field'] = - $this->options['support-level-field-name']; - - $level_label = vipgoci_support_level_label_set( - $this->options - ); - - $this->assertFalse( - $level_label - ); - - $support_labels_cnt = $this->_findSupportLabelstoPrs(); - - $this->assertSame( - 0, - $support_labels_cnt - ); - } - - /** - * @covers ::vipgoci_support_level_label_set - */ - public function testSupportLevelSet2() { - $options_test = vipgoci_unittests_options_test( - $this->options, - array( 'repo-meta-api-user-id', 'repo-meta-api-access-token' ), - $this - ); - - if ( -1 === $options_test ) { - return; - } - - $this->options['set-support-level-label'] = true; - - $this->options['set-support-level-field'] = - $this->options['support-level-field-name']; - - /* - * Get any PRs attached, verify we got at least one. - */ - $prs_implicated = $this->_findPrsImplicated(); - - $this->assertNotEmpty( - $prs_implicated - ); - - /* - * Look for support labels, should be none. - */ - $support_labels_cnt = $this->_findSupportLabelstoPrs(); - - $this->assertSame( - 0, - $support_labels_cnt - ); - - /* - * Attempt to set support level label. - */ - $level_label_ret = vipgoci_support_level_label_set( - $this->options - ); - - $this->assertTrue( - $level_label_ret - ); - - /* - * Loop through each PR, looking for - * support level label. Then delete any - * we find to clean up. - */ - - $this->assertNotEmpty( - $prs_implicated - ); - - foreach ( $prs_implicated as $pr_item ) { - $pr_item_labels = vipgoci_github_pr_labels_get( - $this->options['repo-owner'], - $this->options['repo-name'], - $this->options['token'], - $pr_item->number, - null, - true // Avoid cache - ); - - $this->assertNotEmpty( - $pr_item_labels - ); - - $found_support_level_label = false; - - foreach( $pr_item_labels as $label_item ) { - if ( - $this->options['set-support-level-label-prefix'] . ' ' . ucfirst( strtolower( $this->options['support-level'] ) ) === - $label_item->name - ) { - /* - * Clean up label and indicate we found it. - */ - vipgoci_github_pr_label_remove( - $this->options['repo-owner'], - $this->options['repo-name'], - $this->options['token'], - $pr_item->number, - $label_item->name - ); - - $found_support_level_label = true; - } - } - - $this->assertTrue( - $found_support_level_label - ); - } - } -} diff --git a/tests/unit/MainRunInitOptionsSetSupportLevelLabelTest.php b/tests/unit/MainRunInitOptionsSetSupportLevelLabelTest.php deleted file mode 100644 index ae511ae6d..000000000 --- a/tests/unit/MainRunInitOptionsSetSupportLevelLabelTest.php +++ /dev/null @@ -1,88 +0,0 @@ -options = array(); - } - - /** - * Clear variable. - */ - protected function tearDown() :void { - unset( $this->options ); - } - - /** - * Check if default options for support level label - * are correctly provided. - * - * @covers ::vipgoci_run_init_options_set_support_level_label - */ - public function testRunInitOptionsSetSupportLevelLabelDefault() :void { - $this->options = array( - 'set-support-level-label' => null, - 'set-support-level-label-prefix' => '', - 'set-support-level-field' => '', - ); - - vipgoci_run_init_options_set_support_level_label( - $this->options - ); - - $this->assertSame( - array( - 'set-support-level-label' => false, - 'set-support-level-label-prefix' => null, - 'set-support-level-field' => null, - ), - $this->options - ); - } - - /** - * Check if custom options for support level label - * are correctly provided. - * - * @covers ::vipgoci_run_init_options_set_support_level_label - */ - public function testRunInitOptionsSetSupportLevelLabelCustom() :void { - $this->options = array( - 'set-support-level-label' => 'true', - 'set-support-level-label-prefix' => ' testing123 ', - 'set-support-level-field' => ' testingABC ', - ); - - vipgoci_run_init_options_set_support_level_label( - $this->options - ); - - $this->assertSame( - array( - 'set-support-level-label' => true, - 'set-support-level-label-prefix' => 'testing123', - 'set-support-level-field' => 'testingABC', - ), - $this->options - ); - } -} diff --git a/tests/unit/OptionsReadRepositoryConfigFileTest.php b/tests/unit/OptionsReadRepositoryConfigFileTest.php index 44bb51251..e1b7cff85 100644 --- a/tests/unit/OptionsReadRepositoryConfigFileTest.php +++ b/tests/unit/OptionsReadRepositoryConfigFileTest.php @@ -129,6 +129,6 @@ private function getOverritableMock(): array { * @return array */ private function getOptionsMock(): array { - return json_decode( '{"repo-owner":"any","repo-name":"any","commit":"any","token":"any","local-git-repo":"any","phpcs-path":"any","phpcs":true,"enforce-https-urls":false,"repo-options":true,"env-options":[],"branches-ignore":[],"phpcs-standard":["WordPress-VIP-Go"],"phpcs-sniffs-include":[],"phpcs-sniffs-exclude":[],"phpcs-runtime-set":[],"phpcs-skip-folders":[],"review-comments-ignore":[],"dismissed-reviews-exclude-reviews-from-team":[],"phpcs-severity":1,"php-path":"php","test-api":false,"svg-checks":false,"svg-scanner-path":"invalid","debug-level":0,"max-exec-time":0,"review-comments-max":10,"review-comments-total-max":200,"skip-large-files-limit":15000,"skip-draft-prs":false,"phpcs-skip-folders-in-repo-options-file":false,"phpcs-skip-scanning-via-labels-allowed":false,"lint":true,"lint-modified-files-only":true,"skip-large-files":true,"lint-skip-folders-in-repo-options-file":false,"dismiss-stale-reviews":false,"dismissed-reviews-repost-comments":true,"review-comments-sort":false,"review-comments-include-severity":false,"phpcs-standard-file":false,"skip-execution":false,"autoapprove":false,"autoapprove-php-nonfunctional-changes":false,"autoapprove-filetypes":[],"post-generic-pr-support-comments":false,"post-generic-pr-support-comments-on-drafts":false,"post-generic-pr-support-comments-string":null,"post-generic-pr-support-comments-skip-if-label-exists":null,"post-generic-pr-support-comments-branches":[],"post-generic-pr-support-comments-repo-meta-match":[],"set-support-level-label":false,"set-support-level-label-prefix":null,"set-support-level-field":null,"repo-meta-api-user-id":null,"repo-meta-api-access-token":null,"lint-skip-folders":[],"repo-options-allowed":["skip-execution","skip-draft-prs","review-comments-sort","review-comments-include-severity","phpcs","phpcs-severity","post-generic-pr-support-comments","phpcs-sniffs-include","phpcs-sniffs-exclude","test-api","svg-checks","autoapprove","autoapprove-php-nonfunctional-changes","lint-modified-files-only"],"autoapprove-label":false}', true ); + return json_decode( '{"repo-owner":"any","repo-name":"any","commit":"any","token":"any","local-git-repo":"any","phpcs-path":"any","phpcs":true,"enforce-https-urls":false,"repo-options":true,"env-options":[],"branches-ignore":[],"phpcs-standard":["WordPress-VIP-Go"],"phpcs-sniffs-include":[],"phpcs-sniffs-exclude":[],"phpcs-runtime-set":[],"phpcs-skip-folders":[],"review-comments-ignore":[],"dismissed-reviews-exclude-reviews-from-team":[],"phpcs-severity":1,"php-path":"php","test-api":false,"svg-checks":false,"svg-scanner-path":"invalid","debug-level":0,"max-exec-time":0,"review-comments-max":10,"review-comments-total-max":200,"skip-large-files-limit":15000,"skip-draft-prs":false,"phpcs-skip-folders-in-repo-options-file":false,"phpcs-skip-scanning-via-labels-allowed":false,"lint":true,"lint-modified-files-only":true,"skip-large-files":true,"lint-skip-folders-in-repo-options-file":false,"dismiss-stale-reviews":false,"dismissed-reviews-repost-comments":true,"review-comments-sort":false,"review-comments-include-severity":false,"phpcs-standard-file":false,"skip-execution":false,"autoapprove":false,"autoapprove-php-nonfunctional-changes":false,"autoapprove-filetypes":[],"post-generic-pr-support-comments":false,"post-generic-pr-support-comments-on-drafts":false,"post-generic-pr-support-comments-string":null,"post-generic-pr-support-comments-skip-if-label-exists":null,"post-generic-pr-support-comments-branches":[],"post-generic-pr-support-comments-repo-meta-match":[],"repo-meta-api-user-id":null,"repo-meta-api-access-token":null,"lint-skip-folders":[],"repo-options-allowed":["skip-execution","skip-draft-prs","review-comments-sort","review-comments-include-severity","phpcs","phpcs-severity","post-generic-pr-support-comments","phpcs-sniffs-include","phpcs-sniffs-exclude","test-api","svg-checks","autoapprove","autoapprove-php-nonfunctional-changes","lint-modified-files-only"],"autoapprove-label":false}', true ); } } diff --git a/unittests.ini.dist b/unittests.ini.dist index 5419df64c..c2e2afe1e 100644 --- a/unittests.ini.dist +++ b/unittests.ini.dist @@ -124,6 +124,3 @@ commit-test-options-read-repo-file-with-file-2=fe24a89ee9e9184681c6482ca60af57cc commit-test-options-read-repo-file-with-file-3=1615b03f6997878feb1a25926631c4165e2efeec commit-test-options-read-repo-file-with-file-5=9a13bbec0cc2c7557539076f0125cc396fab22c1 -[repo-meta-api] -commit-support-level-set-test=4e56c433e2e7c0de62e333cdf719949ea0a1ccb5 -