Pier Angelo Vendrame pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser

Commits:

3 changed files:

Changes:

  • .gitlab-ci.yml
    1 1
     stages:
    
    2
    -  - setup
    
    3 2
       - lint
    
    4 3
       - update-translations
    
    5 4
     
    
    6 5
     variables:
    
    7 6
       IMAGE_PATH: containers.torproject.org/tpo/applications/tor-browser/base:latest
    
    7
    +  LOCAL_REPO_PATH: /srv/apps-repos/${CI_PROJECT_NAME}.git
    
    8 8
     
    
    9 9
     include:
    
    10
    -  - local: '.gitlab/ci/setup.yml'
    
    11 10
       - local: '.gitlab/ci/lint.yml'
    
    12 11
       - local: '.gitlab/ci/update-translations.yml'

  • .gitlab/ci/lint.yml
    ... ... @@ -2,13 +2,9 @@
    2 2
       stage: lint
    
    3 3
       image: $IMAGE_PATH
    
    4 4
       interruptible: true
    
    5
    -  needs:
    
    6
    -    - job: setup-env
    
    7
    -      artifacts: true
    
    8
    -    - job: create-bundle
    
    9
    -      artifacts: true
    
    10 5
       variables:
    
    11 6
         MOZBUILD_STATE_PATH: "$CI_PROJECT_DIR/.cache/mozbuild"
    
    7
    +    # A copy of the repository already is available in the runner.
    
    12 8
         GIT_STRATEGY: "none"
    
    13 9
       cache:
    
    14 10
         paths:
    
    ... ... @@ -18,26 +14,21 @@
    18 14
         when: 'always'
    
    19 15
         # Share the cache throughout all pipelines running for a given branch
    
    20 16
         key: $CI_COMMIT_REF_SLUG
    
    17
    +  tags:
    
    18
    +    # Run these jobs in the browser dedicated runners.
    
    19
    +    - firefox
    
    21 20
       before_script:
    
    22
    -    # DEBUG: Are all artifacts here?
    
    23
    -    - ls -a
    
    24
    -    - mkdir app && cd app
    
    25
    -    # Initialize a fresh git repo
    
    26 21
         - git init
    
    27
    -    # Add app.bundle as the remote. All operations that communicate with the remote will be local.
    
    28
    -    - git remote add origin ../app.bundle
    
    29
    -    # shallow.txt contains the SHA of the base commit of the bundle.
    
    30
    -    # The bundle is shallow, therefore it's base commit will not have a parent.
    
    31
    -    # Adding the SHA of the base commit to .git/shallow tells git that it doesn't need
    
    32
    -    # to crash when it realizes said base commit doesn't have a parent.
    
    33
    -    - cp ../shallow.txt .git/shallow
    
    34
    -    # Finally, unpack the bundle. Time it for debugging purposes.
    
    35
    -    - time git pull origin $BRANCH_NAME
    
    22
    +    - git remote add local "$LOCAL_REPO_PATH"
    
    23
    +    - git fetch --depth 500 local
    
    24
    +    - git remote add origin "$CI_REPOSITORY_URL"
    
    25
    +    - git fetch origin ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
    
    26
    +    - git checkout ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
    
    36 27
     
    
    37 28
     eslint:
    
    38 29
       extends: .base
    
    39 30
       script:
    
    40
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l eslint
    
    31
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l eslint
    
    41 32
       rules:
    
    42 33
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    43 34
           changes:
    
    ... ... @@ -61,12 +52,12 @@ eslint:
    61 52
             - 'tools/lint/eslint/eslint-plugin-mozilla/**'
    
    62 53
             - 'tools/lint/eslint/eslint-plugin-spidermonkey-js/**'
    
    63 54
         # Run job whenever a commit is merged to a protected branch
    
    64
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    55
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    65 56
     
    
    66 57
     stylelint:
    
    67 58
       extends: .base
    
    68 59
       script:
    
    69
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l stylelint
    
    60
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l stylelint
    
    70 61
       rules:
    
    71 62
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    72 63
           changes:
    
    ... ... @@ -79,12 +70,12 @@ stylelint:
    79 70
             - '**/.stylelintignore'
    
    80 71
             - '**/*stylelintrc*'
    
    81 72
         # Run job whenever a commit is merged to a protected branch
    
    82
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    73
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    83 74
     
    
    84 75
     py-black:
    
    85 76
       extends: .base
    
    86 77
       script:
    
    87
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l black
    
    78
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l black
    
    88 79
       rules:
    
    89 80
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    90 81
           changes:
    
    ... ... @@ -98,12 +89,12 @@ py-black:
    98 89
             - 'pyproject.toml'
    
    99 90
             - 'tools/lint/black.yml'
    
    100 91
         # Run job whenever a commit is merged to a protected branch
    
    101
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    92
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    102 93
     
    
    103 94
     py-ruff:
    
    104 95
       extends: .base
    
    105 96
       script:
    
    106
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l ruff
    
    97
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l ruff
    
    107 98
       rules:
    
    108 99
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    109 100
           changes:
    
    ... ... @@ -117,12 +108,12 @@ py-ruff:
    117 108
             - 'tools/lint/python/ruff.py'
    
    118 109
             - 'tools/lint/python/ruff_requirements.txt'
    
    119 110
         # Run job whenever a commit is merged to a protected branch
    
    120
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    111
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    121 112
     
    
    122 113
     yaml:
    
    123 114
       extends: .base
    
    124 115
       script:
    
    125
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l yaml
    
    116
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l yaml
    
    126 117
       rules:
    
    127 118
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    128 119
           changes:
    
    ... ... @@ -132,12 +123,12 @@ yaml:
    132 123
             - '**/*.yaml'
    
    133 124
             - '**/.ymllint'
    
    134 125
         # Run job whenever a commit is merged to a protected branch
    
    135
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    126
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    136 127
     
    
    137 128
     shellcheck:
    
    138 129
       extends: .base
    
    139 130
       script:
    
    140
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l shellcheck
    
    131
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l shellcheck
    
    141 132
       rules:
    
    142 133
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    143 134
           changes:
    
    ... ... @@ -146,13 +137,13 @@ shellcheck:
    146 137
             - '**/*.sh'
    
    147 138
             - 'tools/lint/shellcheck.yml'
    
    148 139
         # Run job whenever a commit is merged to a protected branch
    
    149
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    140
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    150 141
     
    
    151 142
     clang-format:
    
    152 143
       extends: .base
    
    153 144
       script:
    
    154 145
         - ./mach configure --without-wasm-sandboxed-libraries --with-base-browser-version=0.0.0
    
    155
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l clang-format
    
    146
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l clang-format
    
    156 147
       rules:
    
    157 148
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    158 149
           changes:
    
    ... ... @@ -166,12 +157,12 @@ clang-format:
    166 157
             - '**/*.mm'
    
    167 158
             - 'tools/lint/clang-format.yml'
    
    168 159
         # Run job whenever a commit is merged to a protected branch
    
    169
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    160
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    170 161
     
    
    171 162
     rustfmt:
    
    172 163
       extends: .base
    
    173 164
       script:
    
    174
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l rustfmt
    
    165
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l rustfmt
    
    175 166
       rules:
    
    176 167
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    177 168
           changes:
    
    ... ... @@ -180,12 +171,12 @@ rustfmt:
    180 171
             - '**/*.rs'
    
    181 172
             - 'tools/lint/rustfmt.yml'
    
    182 173
         # Run job whenever a commit is merged to a protected branch
    
    183
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    174
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    184 175
     
    
    185 176
     fluent-lint:
    
    186 177
       extends: .base
    
    187 178
       script:
    
    188
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l fluent-lint
    
    179
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l fluent-lint
    
    189 180
       rules:
    
    190 181
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    191 182
           changes:
    
    ... ... @@ -195,12 +186,12 @@ fluent-lint:
    195 186
             - 'tools/lint/fluent-lint.yml'
    
    196 187
             - 'tools/lint/fluent-lint/exclusions.yml'
    
    197 188
         # Run job whenever a commit is merged to a protected branch
    
    198
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    189
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    199 190
     
    
    200 191
     localization:
    
    201 192
       extends: .base
    
    202 193
       script:
    
    203
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l l10n
    
    194
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l l10n
    
    204 195
       rules:
    
    205 196
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    206 197
           changes:
    
    ... ... @@ -212,12 +203,12 @@ localization:
    212 203
             - 'third_party/python/fluent/**'
    
    213 204
             - 'tools/lint/l10n.yml'
    
    214 205
         # Run job whenever a commit is merged to a protected branch
    
    215
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    206
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    216 207
     
    
    217 208
     mingw-capitalization:
    
    218 209
       extends: .base
    
    219 210
       script:
    
    220
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l mingw-capitalization
    
    211
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l mingw-capitalization
    
    221 212
       rules:
    
    222 213
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    223 214
           changes:
    
    ... ... @@ -229,12 +220,12 @@ mingw-capitalization:
    229 220
             - '**/*.h'
    
    230 221
             - 'tools/lint/mingw-capitalization.yml'
    
    231 222
         # Run job whenever a commit is merged to a protected branch
    
    232
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    223
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    233 224
     
    
    234 225
     mscom-init:
    
    235 226
       extends: .base
    
    236 227
       script:
    
    237
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l mscom-init
    
    228
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l mscom-init
    
    238 229
       rules:
    
    239 230
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    240 231
           changes:
    
    ... ... @@ -246,12 +237,12 @@ mscom-init:
    246 237
             - '**/*.h'
    
    247 238
             - 'tools/lint/mscom-init.yml'
    
    248 239
         # Run job whenever a commit is merged to a protected branch
    
    249
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    240
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    250 241
     
    
    251 242
     file-whitespace:
    
    252 243
       extends: .base
    
    253 244
       script:
    
    254
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l file-whitespace
    
    245
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l file-whitespace
    
    255 246
       rules:
    
    256 247
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    257 248
           changes:
    
    ... ... @@ -275,12 +266,12 @@ file-whitespace:
    275 266
             - '**/*.xhtml'
    
    276 267
             - 'tools/lint/file-whitespace.yml'
    
    277 268
         # Run job whenever a commit is merged to a protected branch
    
    278
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    269
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    279 270
     
    
    280 271
     test-manifest:
    
    281 272
       extends: .base
    
    282 273
       script:
    
    283
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l test-manifest-alpha -l test-manifest-disable -l test-manifest-skip-if
    
    274
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l test-manifest-alpha -l test-manifest-disable -l test-manifest-skip-if
    
    284 275
       rules:
    
    285 276
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    286 277
           changes:
    
    ... ... @@ -290,12 +281,12 @@ test-manifest:
    290 281
             - 'python/mozlint/**'
    
    291 282
             - 'tools/lint/**'
    
    292 283
         # Run job whenever a commit is merged to a protected branch
    
    293
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    284
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'
    
    294 285
     
    
    295 286
     trojan-source:
    
    296 287
       extends: .base
    
    297 288
       script:
    
    298
    -    - cat ../changedfiles.txt | xargs -d '\n' ./mach lint -l trojan-source
    
    289
    +    - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l trojan-source
    
    299 290
       rules:
    
    300 291
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    301 292
           changes:
    
    ... ... @@ -309,4 +300,4 @@ trojan-source:
    309 300
             - '**/*.rs'
    
    310 301
             - 'tools/lint/trojan-source.yml'
    
    311 302
         # Run job whenever a commit is merged to a protected branch
    
    312
    -    # - if: $CI_COMMIT_REF_PROTECTED == 'true'
    303
    +    - if: $CI_COMMIT_REF_PROTECTED == 'true'

  • .gitlab/ci/setup.yml deleted
    1
    -setup-env:
    
    2
    -  stage: setup
    
    3
    -  interruptible: true
    
    4
    -  variables:
    
    5
    -    GIT_STRATEGY: "none"
    
    6
    -  rules:
    
    7
    -    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_REF_PROTECTED == 'true'
    
    8
    -  script:
    
    9
    -    - |
    
    10
    -      if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ]; then
    
    11
    -        echo "BRANCH_NAME=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" > build.env
    
    12
    -      else
    
    13
    -        echo "BRANCH_NAME=$CI_COMMIT_REF_NAME" > build.env
    
    14
    -      fi
    
    15
    -  artifacts:
    
    16
    -    reports:
    
    17
    -      dotenv:
    
    18
    -        - build.env
    
    19
    -
    
    20
    -create-bundle:
    
    21
    -  stage: setup
    
    22
    -  # TODO: Find a better suited image, this one just has git.
    
    23
    -  image: python
    
    24
    -  needs:
    
    25
    -    - job: setup-env
    
    26
    -      artifacts: true
    
    27
    -  rules:
    
    28
    -    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_REF_PROTECTED == 'true'
    
    29
    -  variables:
    
    30
    -    GIT_DEPTH: "1"
    
    31
    -  interruptible: true
    
    32
    -  script:
    
    33
    -    # DEBUG: Check repository status.
    
    34
    -    - git status
    
    35
    -    # DEBUG: Check branches in repository
    
    36
    -    - git branch
    
    37
    -    # Force switch to a named branch. We force it in case there is already
    
    38
    -    # a branch with the same name from previous runs.
    
    39
    -    - git switch -C $BRANCH_NAME
    
    40
    -    # Create a git bundle -- this will generate the app.bundle file,
    
    41
    -    # which can be used as a git remote for offline fetching.
    
    42
    -    - git bundle create app.bundle $BRANCH_NAME
    
    43
    -    # Retain the SHA of the base of this shallow repository.
    
    44
    -    - cat .git/shallow > shallow.txt
    
    45
    -    # DEBUG: Check sizes.
    
    46
    -    - du -sh .git
    
    47
    -    - du -sh app.bundle
    
    48
    -    # Since this is the only job we have access to the Gitlab remote,
    
    49
    -    # let's get a list of changed files to use in the next jobs.
    
    50
    -    - .gitlab/ci/scripts/helpers.py --get-changed-files > changedfiles.txt
    
    51
    -  artifacts:
    
    52
    -    paths:
    
    53
    -      - app.bundle
    
    54
    -      - shallow.txt
    
    55
    -      - changedfiles.txt
    
    56
    -    expire_in: 1 hour