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 (119cb894cd)

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
version: 1
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: aws-provisioner-v1
      created: {$fromNow: ''}
      deadline: {$fromNow: '1 day'}
      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:28045b7ec0485ef363f8cb14f194008b47e9ede99f2ea40a1e945e921fce976e"
        features:
          taskclusterProxy: true
        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: servo-docker-worker
                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: servo-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}