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

Mitigate Dr.CI stale comments on PyTorch PRs #5963

Merged
merged 6 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
95 changes: 21 additions & 74 deletions .github/workflows/update-drci-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,83 +10,30 @@ on:
jobs:
update-drci-comments:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
repo: [
ao,
audio,
data,
executorch,
pytorch,
rl,
text,
torchchat,
torchtune,
tutorials,
vision,
]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Retrieve rockset query results and update Dr. CI comments for the PyTorch repo
- name: Retrieve rockset query results and update Dr. CI comments
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=pytorch'

- name: Retrieve rockset query results and update Dr. CI comments for the Vision repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=vision'

- name: Retrieve rockset query results and update Dr. CI comments for the Text repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=text'

- name: Retrieve rockset query results and update Dr. CI comments for the Data repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=data'

- name: Retrieve rockset query results and update Dr. CI comments for the Audio repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=audio'

- name: Retrieve rockset query results and update Dr. CI comments for the Tutorials repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=tutorials'

- name: Retrieve the Rockset query results and update Dr. CI comments for the ExecuTorch repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=executorch'

- name: Retrieve the Rockset query results and update Dr. CI comments for the RL repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=rl'

- name: Retrieve the Rockset query results and update Dr. CI comments for the TorchTune repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=torchtune'

- name: Retrieve the Rockset query results and update Dr. CI comments for the torchao repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=ao'

- name: Retrieve the Rockset query results and update Dr. CI comments for the torchchat repo
run: |
curl --request POST \
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=torchchat'
--url 'https://www.torch-ci.com/api/drci/drci' \
--header 'Authorization: ${{ secrets.DRCI_BOT_KEY }}' \
--data 'repo=${{ matrix.repo }}' \
--silent --output /dev/null --show-error --fail
4 changes: 3 additions & 1 deletion torchci/lib/bot/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Context, Probot } from "probot";
import urllib from "urllib";

export function isTime0(time: string): boolean {
return dayjs.utc(time).valueOf() == 0;
const v = dayjs.utc(time).valueOf();
// NB: This returns NaN when the string is empty
return isNaN(v) || v === 0;
}

export const TIME_0 = "1970-01-01 00:00:00.000000000";
Expand Down
6 changes: 6 additions & 0 deletions torchci/pages/api/drci/drci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ export interface UpdateCommentBody {
repo: string;
}

// Attempt to set the maxDuration of this serveless function on Vercel https://vercel.com/docs/functions/configuring-functions/duration,
// also according to https://vercel.com/docs/functions/runtimes#max-duration, the max duration
// for an enterprise account is 900
export const maxDuration = 900;
export const dynamic = "force-dynamic";

export default async function handler(
req: NextApiRequest,
res: NextApiResponse<{
Expand Down