diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8d7167a663b..dea38431e02 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,7 +5,7 @@ # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax -# The yoshi-php team is the default owner for anything not +# The cloud-sdk-php-team team is the default owner for anything not # explicitly taken by someone else. * @googleapis/cloud-sdk-php-team diff --git a/.github/workflows/major-version-approval.yaml b/.github/workflows/major-version-approval.yaml index cd6618b2e2a..19aa19e3822 100644 --- a/.github/workflows/major-version-approval.yaml +++ b/.github/workflows/major-version-approval.yaml @@ -1,4 +1,4 @@ -name: Major Version Release Requires 2+ yoshi-php Approvals +name: Major Version Release Requires 2+ Approvals on: pull_request: @@ -23,7 +23,7 @@ jobs: env: GH_TOKEN: ${{ secrets.SPLIT_TOKEN }} with: - script: | + script: | const { execSync } = require('child_process'); const requiredApprovals = 2; @@ -44,18 +44,18 @@ jobs: .map(review => review.user.login) ); if (approvals.size < requiredApprovals) { - core.setFailed(`Requires ${requiredApprovals}+ approvals from the yoshi-php team. Only ${approvals.size} total approvals found.`) + core.setFailed(`Requires ${requiredApprovals}+ approvals, only ${approvals.size} total approvals found.`) core.error('RE-RUN THIS WORKFLOW AFTER THE APPROVAL REQUIREMENTS ARE MET') return; } core.info(`Total approval count: ${approvals.size}`); // 2. Get team members - core.info('Fetching yoshi-php team members...'); - const teamMembersCmd = `gh api --paginate orgs/googleapis/teams/yoshi-php/members --jq '.[].login'`; + core.info('Fetching cloud-sdk-php-team team members...'); + const teamMembersCmd = `gh api --paginate orgs/googleapis/teams/cloud-sdk-php-team/members --jq '.[].login'`; const teamMembersOutput = execSync(teamMembersCmd, { encoding: 'utf8', env: process.env }); if (!teamMembersOutput.trim()) { - core.error('Could not fetch any members for the yoshi-php team.'); + core.error('Could not fetch any members for the cloud-sdk-php-team team.'); } const teamMembers = new Set(teamMembersOutput.trim().split('\n')); @@ -63,12 +63,12 @@ jobs: const matchingApprovals = [...approvals].filter(login => teamMembers.has(login)); const count = matchingApprovals.length; - core.info(`Found ${count} approval(s) from the yoshi-php team.`); + core.info(`Found ${count} approval(s) from the cloud-sdk-php-team team.`); if (count >= requiredApprovals) { - core.info(`Success: Requirement of ${requiredApprovals}+ yoshi-php approvals met with ${count} approvals.`); + core.info(`Success: Requirement of ${requiredApprovals}+ approvals met with ${count} approvals.`); } else { - core.setFailed(`Requires ${requiredApprovals}+ approvals from the yoshi-php team. Only ${count} yoshi-php approvals found.`); + core.setFailed(`Requires ${requiredApprovals}+ approvals, only ${count} cloud-sdk-php-team approvals found.`); core.error('RE-RUN THIS WORKFLOW AFTER THE APPROVAL REQUIREMENTS ARE MET') } } catch (error) { diff --git a/dev/src/Command/RepoComplianceCommand.php b/dev/src/Command/RepoComplianceCommand.php index 5feac19ad43..4f4b16a39a4 100644 --- a/dev/src/Command/RepoComplianceCommand.php +++ b/dev/src/Command/RepoComplianceCommand.php @@ -38,6 +38,7 @@ class RepoComplianceCommand extends Command { private const PACKAGIST_USERNAME = 'google-cloud'; + public const PHP_TEAM = 'cloud-sdk-php-team'; private GitHub $github; private Packagist $packagist; @@ -145,7 +146,7 @@ private function checkTeamCompliance(array $details) { return !empty(array_filter( explode("\n", $details['teams']), - fn ($team) => $team === 'yoshi-php: admin' + fn ($team) => $team === (self::PHP_TEAM . ': admin') )); } @@ -200,11 +201,12 @@ private function askFixTeamCompliance(InputInterface $input, OutputInterface $ou return false; } $question = new ConfirmationQuestion(sprintf( - 'Repo %s does not have "yoshi-php" as an admin. Would you like to add it? (Y/n)', - $repoName + 'Repo %s does not have "%s" as an admin. Would you like to add it? (Y/n)', + $repoName, + self::PHP_TEAM, ), true); if ($this->getHelper('question')->ask($input, $output, $question)) { - return $this->github->updateTeamPermission('googleapis', 'yoshi-php', $repoName, 'admin'); + return $this->github->updateTeamPermission('googleapis', self::PHP_TEAM, $repoName, 'admin'); } return false; } diff --git a/dev/src/Command/RepoSplitCommand.php b/dev/src/Command/RepoSplitCommand.php index b21008aa0ed..461b85cf337 100644 --- a/dev/src/Command/RepoSplitCommand.php +++ b/dev/src/Command/RepoSplitCommand.php @@ -45,6 +45,7 @@ class RepoSplitCommand extends Command const PARENT_TAG_NAME = 'https://github.com/%s/releases/tag/%s'; const EXEC_DIR = '.split'; const TOKEN_ENV = 'GH_OAUTH_TOKEN'; + private const PHP_TEAM = RepoComplianceCommand::PHP_TEAM; private string $rootPath; @@ -393,13 +394,13 @@ private function processComponent( } } - // Ensure "yoshi-php" is an admin - $ret = $github->updateTeamPermission('googleapis', 'yoshi-php', $repoName, 'admin'); + // Add team permission + $ret = $github->updateTeamPermission('googleapis', self::PHP_TEAM, $repoName, 'admin'); if ($ret) { - $output->writeln(sprintf('%s: Added "yoshi-php" as admin.', $componentId)); + $output->writeln(sprintf('%s: Added "%s" as admin.', $componentId, self::PHP_TEAM)); } else { - $output->writeln(sprintf('%s: Unable to add "yoshi-php" as admin.', $componentId)); + $output->writeln(sprintf('%s: Unable to add "%s" as admin.', $componentId, self::PHP_TEAM)); return false; }