DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Git (52ac5316ad)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
version: 1

# If and when switching to `reporting: checks-v1` here, also change the `statuses` route to `checks`
# in `CONFIG.routes_for_all_subtasks` in `etc/taskcluster/decision_task.py`

policy:
  # https://docs.taskcluster.net/docs/reference/integrations/taskcluster-github/docs/taskcluster-yml-v1#pull-requests
  pullRequests: public

  # NOTE: when updating this consider whether the daily hook needs similar changes:
# https://tools.taskcluster.net/hooks/project-servo/daily
tasks:
  $let:
    task_common:
      provisionerId:
        $if: "taskcluster_root_url == 'https://taskcluster.net'"
        then: aws-provisioner-v1
        else: proj-servo
      created: {$fromNow: ''}
      deadline: {$fromNow: '1 day'}
      priority: high
      extra:
        treeherder:
          machine: {platform: Linux}
          labels: [x64]
          symbol: Decision
      payload:
        maxRunTime: {$eval: '20 * 60'}
        # https://github.com/servo/taskcluster-bootstrap-docker-images#decision-task
        image: "servobrowser/taskcluster-bootstrap:decision-task@\
            sha256:7471a998e4462638c8d3e2cf0b4a99c9a5c8ca9f2ec0ae01cc069473b35cde10"
        features:
          taskclusterProxy: true
        artifacts:
          public/repo.bundle:
            type: file
            path: /repo.bundle
            expires: {$fromNow: '1 day'}
        env:
          GIT_URL: ${event.repository.clone_url}
          TASK_FOR: ${tasks_for}
        command:
          - /bin/bash
          - '--login'
          - '-e'
          - '-c'
          - >-
            git init repo &&
            cd repo &&
            git fetch --depth 1 "$GIT_URL" "$GIT_REF" &&
            git reset --hard "$GIT_SHA" &&
            python3 etc/taskcluster/decision_task.py
  in:
    - $if: "tasks_for == 'github-push'"
      then:
        $let:
          branch:
            $if: "event.ref[:11] == 'refs/heads/'"
            then: "${event.ref[11:]}"
        in:
          $if: "branch in ['auto', 'try', 'master'] || branch[:4] == 'try-'"
          then:
            $mergeDeep:
              - {$eval: "task_common"}
              - metadata:
                  name: "Servo: GitHub push decision task"
                  description: ""
                  owner: ${event.pusher.name}@users.noreply.github.com
                  source: ${event.compare}
                workerType:
                  $if: "taskcluster_root_url == 'https://taskcluster.net'"
                  then: servo-docker-worker
                  else: docker
                scopes:
                  - "assume:repo:github.com/servo/servo:branch:${branch}"
                routes:
                  $let:
                    treeherder_repo:
                      $if: "branch[:4] == 'try-'"
                      then: "servo-try"
                      else: "servo-${branch}"
                  in:
                    - "tc-treeherder.v2._/${treeherder_repo}.${event.after}"
                    - "tc-treeherder-staging.v2._/${treeherder_repo}.${event.after}"
                payload:
                  env:
                    GIT_REF: ${event.ref}
                    GIT_SHA: ${event.after}
                    TASK_OWNER: ${event.pusher.name}@users.noreply.github.com
                    TASK_SOURCE: ${event.compare}
    - $if: >-
        tasks_for == 'github-pull-request' &&
        event['action'] in ['opened', 'reopened', 'synchronize']
      then:
        $mergeDeep:
          - {$eval: "task_common"}
          - metadata:
              name: "Servo: GitHub PR decision task"
              description: ""
              owner: ${event.sender.login}@users.noreply.github.com
              source: ${event.pull_request.url}
            workerType:
              $if: "taskcluster_root_url == 'https://taskcluster.net'"
              then: servo-docker-untrusted
              else: docker-untrusted
            scopes:
              - "assume:repo:github.com/servo/servo:pull-request"
            routes:
              - "tc-treeherder.v2._/servo-prs.${event.pull_request.head.sha}"
              - "tc-treeherder-staging.v2._/servo-prs.${event.pull_request.head.sha}"
            payload:
              env:
                # We use the merge commit made by GitHub, not the PR’s branch
                GIT_REF: refs/pull/${event.pull_request.number}/merge
                # `event.pull_request.merge_commit_sha` is tempting but not what we want:
                # https://github.com/servo/servo/pull/22597#issuecomment-451518810
                GIT_SHA: FETCH_HEAD
                TASK_OWNER: ${event.sender.login}@users.noreply.github.com
                TASK_SOURCE: ${event.pull_request.url}