pytorch/.github
Nikita Shulga 305fa22393 [GHF] Remove app { name databaseId} query (#160494)
From `PRCheckSuites` fragment, as it's causes security exception when used with new GITHUB_TOKEN, that will looks as follows
```
RuntimeError: GraphQL query
fragment PRReviews on PullRequestReviewConnection {
  nodes {
    author {
      login
    }
    bodyText
    createdAt
    authorAssociation
    editor {
      login
    }
    databaseId
    url
    state
  }
  pageInfo {
    startCursor
    hasPreviousPage
  }
}

fragment PRCheckSuites on CheckSuiteConnection {
  edges {
    node {
      app {
        name
        databaseId
      }
      workflowRun {
        workflow {
          name
          databaseId
        }
        databaseId
        url
      }
      checkRuns(first: 50) {
        nodes {
          name
          conclusion
          detailsUrl
          databaseId
          title
          summary
        }
        pageInfo {
          endCursor
          hasNextPage
        }
      }
      conclusion
    }
    cursor
  }
  pageInfo {
    hasNextPage
  }
}

fragment CommitAuthors on PullRequestCommitConnection {
  nodes {
    commit {
      authors(first: 2) {
        nodes {
          user {
            login
          }
          email
          name
        }
      }
      oid
    }
  }
  pageInfo {
    endCursor
    hasNextPage
  }
}

query ($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      closed
      isCrossRepository
      author {
        login
      }
      title
      body
      headRefName
      headRepository {
        nameWithOwner
      }
      baseRefName
      baseRefOid
      baseRepository {
        nameWithOwner
        isPrivate
        defaultBranchRef {
          name
        }
      }
      mergeCommit {
        oid
      }
      commits_with_authors: commits(first: 100) {
        ...CommitAuthors
        totalCount
      }
      commits(last: 1) {
        nodes {
          commit {
            checkSuites(first: 10) {
              ...PRCheckSuites
            }
            status {
              contexts {
                context
                state
                targetUrl
              }
            }
            oid
          }
        }
      }
      changedFiles
      files(first: 100) {
        nodes {
          path
        }
        pageInfo {
          endCursor
          hasNextPage
        }
      }
      reviews(last: 100) {
        ...PRReviews
      }
      comments(last: 5) {
        nodes {
          bodyText
          createdAt
          author {
            login
          }
          authorAssociation
          editor {
            login
          }
          databaseId
          url
        }
        pageInfo {
          startCursor
          hasPreviousPage
        }
      }
      labels(first: 100) {
        edges {
          node {
            name
          }
        }
      }
    }
  }
}
, args {'name': 'pytorch', 'owner': 'pytorch', 'number': 159820} failed: [{'type': 'FORBIDDEN', 'path': ['repository', 'pullRequest', 'commits', 'nodes', 0, 'commit', 'checkSuites', 'edges', 4, 'node', 'app'], 'extensions': {'saml_failure': False}, 'locations': [{'line': 26, 'column': 7}], 'message': 'Resource not accessible by integration'}]
```
But the same query works fine if executed using one's Personal Access Token

Updated mocks file by running
```
sed -i -e s/a32a7ca3a2f6e2c9de07aef821b0111539758b4ac254f8a3432af32314f94876/8e262b0495bd934d39dda198d4c09144311c5ddd6cca6a227194bd48dbfe7201/ gql_mocks.json
sed -i -e s/157add81c519f614388f3a67e287bdf4fbb1791e6d0bffe312e169d02ac2813f/28349cb4c891bbf85255fab2c33c770baf77c3e02b29ca9a0e4c6c97bed041db/ gql_mocks.json
sed '/"app": {/,+3d' gql_mocks-orig.json >gql_mocks.json
sed '/"app": null/d' gql_mocks-orig.json >gql_mocks.json
```

Undisable offending jobs

Fixes https://github.com/pytorch/pytorch/issues/159894
Pull Request resolved: https://github.com/pytorch/pytorch/pull/160494
Approved by: https://github.com/huydhn
ghstack dependencies: #160490, #160492
2025-08-13 03:46:39 +00:00
..
actions [CI] Switch ROCm MI300 GitHub Actions workflows from 2-GPU to 1-GPU runners (#158882) 2025-08-12 22:42:40 +00:00
ci_commit_pins [audio hash update] update the pinned audio hash (#160384) 2025-08-12 04:38:04 +00:00
ISSUE_TEMPLATE Update bug-report.yml (#154857) 2025-06-03 16:13:07 +00:00
requirements [EZ][BE] Remove unused conda-env-macOS-ARM64 (#160477) 2025-08-12 23:41:25 +00:00
scripts [GHF] Remove app { name databaseId} query (#160494) 2025-08-13 03:46:39 +00:00
templates [BE][EZ] Delete remains of split-build logic (#159990) 2025-08-07 01:59:30 +00:00
workflows [GHF] Remove app { name databaseId} query (#160494) 2025-08-13 03:46:39 +00:00
actionlint.yaml [CI] Switch ROCm MI300 GitHub Actions workflows from 2-GPU to 1-GPU runners (#158882) 2025-08-12 22:42:40 +00:00
auto_request_review.yml Remove voznesenskym from the list of autoreviewers (#118680) 2024-01-30 21:35:38 +00:00
label_to_label.yml [distributed] Enable H100 test for all distributed related changes (#156721) 2025-06-26 01:51:41 +00:00
labeler.yml [BE][AOTI] Remove duplicate schema for ExternKernelNode (#155867) 2025-06-14 02:03:27 +00:00
merge_rules.yaml [merge_rules] add some expected failure and skips (#159581) 2025-08-01 01:18:40 +00:00
nitpicks.yml Extend abi-stable nitpick message to all the c stable files (#145862) 2025-01-28 23:22:23 +00:00
PULL_REQUEST_TEMPLATE.md [BE] Extend linter to detect DOS newlines (#86973) 2022-10-15 00:20:42 +00:00
pytorch-circleci-labels.yml Add missing docker build to slow gradcheck label-triggered build (#61941) 2021-07-22 07:37:21 -07:00
pytorch-probot.yml CI for Windows Arm64 (#148753) 2025-07-23 16:12:20 +00:00
regenerate.sh Enable bazel builds on ciflow/default (#62649) 2021-08-03 11:05:41 -07:00
requirements-gha-cache.txt [CI] update flake8 and mypy lint dependencies (#158720) 2025-07-29 08:05:56 +00:00