Remove obsolete workflows from XLA and TensorFlow

PiperOrigin-RevId: 648854692
This commit is contained in:
David Dunleavy 2024-07-02 15:04:14 -07:00 committed by TensorFlower Gardener
parent 47429c24c4
commit 6e39eb7869
4 changed files with 0 additions and 384 deletions

View File

@ -1,66 +0,0 @@
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
name: Trusted Partner PR
on:
pull_request_target:
permissions:
contents: read
jobs:
assign-partner-tags:
runs-on: ubuntu-latest
permissions:
# Needed to attach tags into the PR
issues: write
contents: write
pull-requests: write
if: |
github.event.pull_request.draft == false &&
github.event.sender.type == 'User'
steps:
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Trusted-Partners-PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./.github/workflows/trusted_partners.js');
const username = context.payload.pull_request.user.login;
const domain = await script.get_email_domain({github, username});
switch(domain) {
case "intel.com":
console.log(await script.filter({github, context, domain}));
break;
case "apple.com":
console.log(await script.filter({github, context, domain}));
break;
case "nvidia.com":
console.log(await script.filter({github, context, domain}));
break;
case "linaro.org":
console.log(await script.filter({github, context, domain}));
break;
case "arm.com":
console.log(await script.filter({github, context, domain}));
break;
case "google.com":
console.log("Googler. No action necessary");
break;
default:
console.log("Skip Trusted Partner Action");
}

View File

@ -1,121 +0,0 @@
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/** Get the domain of the user's email
@param {!object}
github enables querying for PR and also create issue using rest endpoint
username has the login username of the Pull Request Event
@return {string} Return the domain name of the user's email. Empty string if not found
*/
const get_email_domain = async ({github, username}) => {
const user = await github.rest.users.getByUsername({
username
});
if (user.status >= 400) {
console.log(user);
throw `Error Getting user data for ${username}`;
}
const email = user.data.email;
let domain = "";
if (email && email.lastIndexOf("@") != -1)
domain = email.substring(email.lastIndexOf("@") +1);
console.log(domain);
return domain;
};
/** For trusted parters like Intel, we want to auto-run tests
This allows us to reduce the delay to external partners
Add Labels - kokoro:force-run
The PR is also assigned to specific teams to fast track review
Additional reviewers can be added manually based on PR contents
@param {!object}
github enables querying for PR and also create issue using rest endpoint
context has the commit message details in the payload
@return {string} Returns the message with labels attached and assignees added
*/
const filter_action = async ({github, context, domain}) => {
const labels = ['kokoro:force-run'];
let assignees = [];
const title = context.payload.pull_request && context.payload.pull_request.title;
const lowercased_title = (title || '').toLowerCase();
const onednn_assignees = ['penpornk'];
if (lowercased_title.includes('onednn')) assignees = onednn_assignees;
const intel_windows_assignees = ['nitins17', 'learning-to-play'];
if (lowercased_title.includes('intel') &&
lowercased_title.includes('windows') && domain.includes('intel.com'))
assignees = intel_windows_assignees;
const apple_silicon_assignees = ['penpornk', 'nitins17'];
if (lowercased_title.includes('apple') &&
lowercased_title.includes('silicon') && domain.includes('apple.com'))
assignees = apple_silicon_assignees;
if (lowercased_title.includes('tf-trt') && domain.includes('nvidia.com')) {
assignees.push(
'DEKHTIARJonathan', 'meena-at-work', 'nluehr', 'pjannaty', 'poulsbo');
} else if (
lowercased_title.includes('nvidia') && domain.includes('nvidia.com')) {
if (lowercased_title.includes('jax')) {
assignees.push('hawkinsp', 'yashk2810', 'skye');
}
if (lowercased_title.includes('xla') || lowercased_title.includes('gpu')) {
assignees.push('cheshire', 'gcforster', 'reedwm', 'chsigg', 'xla-rotation');
}
if (lowercased_title.includes('tf')) {
assignees.push('rohan100jain', 'bfontain');
}
}
if (lowercased_title.includes('linaro') && domain.includes('linaro.org')) {
if (lowercased_title.includes('arm_ci')) {
assignees.push('nitins17', 'penpornk');
}
}
if (lowercased_title.includes('tf-mot') && lowercased_title.includes('arm') &&
domain.includes('arm.com')) {
assignees.push('rino20', 'yyoon', 'lenscloth');
}
const resp_label = await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels
});
if (resp_label.status >= 400) {
console.log(resp_label);
throw "Error adding labels to PR";
}
if (assignees.length > 0) {
const resp_assign = await github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: assignees
});
if (resp_assign.status >= 400) {
console.log(resp_assign);
throw "Error adding assignee to PR";
}
}
return `PR Updated successfully with Labels: ${labels} with Assignees: ${assignees}`;
};
module.exports = {
filter: filter_action,
get_email_domain
};

View File

@ -1,69 +0,0 @@
# Copyright 2023 The XLA Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
name: Trusted Partner PR
permissions:
# Needed to attach tags into the PR
issues: write
pull-requests: write
on:
pull_request_target:
jobs:
assign-partner-tags:
runs-on: ubuntu-latest
if: |
github.event.pull_request.draft == false &&
github.event.sender.type == 'User'
steps:
- name: Checkout repo
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Trusted-Partners-PR
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./.github/workflows/trusted_partners.js');
const username = context.payload.pull_request.user.login;
const domain = await script.get_email_domain({github, username});
switch(domain) {
case "intel.com":
console.log(await script.filter({github, context, domain}));
break;
case "apple.com":
console.log(await script.filter({github, context, domain}));
break;
case "nvidia.com":
console.log(await script.filter({github, context, domain}));
break;
case "linaro.org":
console.log(await script.filter({github, context, domain}));
break;
case "arm.com":
console.log(await script.filter({github, context, domain}));
break;
// Disable googler flow, so default reviewers are added for now
// case "google.com":
// console.log("Googler. No action necessary");
// break;
default:
// For now, add default reviewers to all PRs to ensure none are
// missed until further reviewer processes are setup.
console.log(await script.filter({github, context, domain}));
console.log("Default reviewers added");
// console.log("Skip Trusted Partner Action");
}

View File

@ -1,128 +0,0 @@
/**
* @license
* Copyright 2023 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
Get the domain of the user's email
@param {!object}
github enables querying for PR and also create issue using rest endpoint
username has the login username of the Pull Request Event
@return {string} Return the domain name of the user's email. Empty string if
not found
*/
const get_email_domain = async ({github, username}) => {
const user = await github.rest.users.getByUsername({username});
if (user.status >= 400) {
console.log(user);
throw `Error Getting user data for ${username}`;
}
const email = user.data.email;
let domain = '';
if (email && email.lastIndexOf('@') != -1)
domain = email.substring(email.lastIndexOf('@') + 1);
console.log(domain);
return domain;
};
/**
For trusted parters like Intel, we want to auto-run tests
This allows us to reduce the delay to external partners
Add Labels - kokoro:force-run
The PR is also assigned to specific teams to fast track review
Additional reviewers can be added manually based on PR contents
@param {!object}
github enables querying for PR and also create issue using rest endpoint
context has the commit message details in the payload
@return {string} Returns the message with labels attached and assignees added
*/
const filter_action = async ({github, context, domain}) => {
const labels = ['kokoro:force-run'];
let assignees = ['kamaljeeti', 'xla-rotation'];
const title =
context.payload.pull_request && context.payload.pull_request.title;
const lowercased_title = (title || '').toLowerCase();
const onednn_assignees = ['penpornk'];
if (lowercased_title.includes('onednn')) assignees = onednn_assignees;
const intel_windows_assignees = ['nitins17', 'learning-to-play'];
if (lowercased_title.includes('intel') &&
lowercased_title.includes('windows') && domain.includes('intel.com'))
assignees = intel_windows_assignees;
const apple_silicon_assignees = ['penpornk', 'nitins17'];
if (lowercased_title.includes('apple') &&
lowercased_title.includes('silicon') && domain.includes('apple.com'))
assignees = apple_silicon_assignees;
if (lowercased_title.includes('tf-trt') && domain.includes('nvidia.com')) {
assignees.push(
'DEKHTIARJonathan', 'meena-at-work', 'nluehr', 'pjannaty', 'poulsbo');
} else if (
lowercased_title.includes('nvidia') && domain.includes('nvidia.com')) {
if (lowercased_title.includes('jax')) {
assignees.push('hawkinsp', 'yashk2810', 'skye');
}
if (lowercased_title.includes('xla') || lowercased_title.includes('gpu')) {
assignees.push('cheshire', 'reedwm', 'xla-rotation');
}
if (lowercased_title.includes('tf')) {
assignees.push('rohan100jain', 'bfontain');
}
}
if (lowercased_title.includes('linaro') && domain.includes('linaro.org')) {
if (lowercased_title.includes('arm_ci')) {
assignees.push('nitins17', 'penpornk');
}
}
if (lowercased_title.includes('tf-mot') && lowercased_title.includes('arm') &&
domain.includes('arm.com')) {
assignees.push('rino20', 'yyoon', 'lenscloth');
}
// Add kokoro label if this was a trusted email that has automatic reviewers
// assigned.
if (assignees.length != 0) {
const resp_label = await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels
});
if (resp_label.status >= 400) {
console.log(resp_label);
throw 'Error adding labels to PR';
}
}
if (assignees.length > 0) {
const resp_assign = await github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: assignees
});
if (resp_assign.status >= 400) {
console.log(resp_assign);
throw 'Error adding assignee to PR';
}
}
return `PR Updated successfully with Labels: ${labels} with Assignees: ${
assignees}`;
};
module.exports = {
filter : filter_action, get_email_domain
};