henry pushed to branch tor-browser-140.2.0esr-15.0-1 at The Tor Project / Applications / Tor Browser

Commits:

2 changed files:

Changes:

  • .gitlab/ci/jobs/lint/helpers.py
    ... ... @@ -84,6 +84,10 @@ def get_list_of_changed_files():
    84 84
         if os.getenv("CI_PIPELINE_SOURCE") == "merge_request_event":
    
    85 85
             # For merge requests, the base_reference is the common ancestor between the MR and the target branch
    
    86 86
             base_reference = os.getenv("CI_MERGE_REQUEST_DIFF_BASE_SHA")
    
    87
    +        if not base_reference:
    
    88
    +            # Probably because there has been no overall change.
    
    89
    +            # See gitlab.com/gitlab-org/gitlab/-/issues/375047#note_2648459916
    
    90
    +            return []
    
    87 91
         else:
    
    88 92
             # When not in merge requests, the base reference is the Firefox tag
    
    89 93
             base_reference = get_firefox_tag(os.getenv("CI_COMMIT_BRANCH"))
    
    ... ... @@ -118,6 +122,8 @@ if __name__ == "__main__":
    118 122
         if args.get_firefox_tag:
    
    119 123
             print(get_firefox_tag(args.get_firefox_tag))
    
    120 124
         elif args.get_changed_files:
    
    121
    -        print("\n".join(get_list_of_changed_files()))
    
    125
    +        # Separate the file names with a 0 byte to be parsed by xargs -0. Also
    
    126
    +        # drop the trailing '\n'.
    
    127
    +        print("\0".join(get_list_of_changed_files()), end="")
    
    122 128
         else:
    
    123 129
             print("No valid option provided.")

  • .gitlab/ci/jobs/lint/lint.yml
    ... ... @@ -18,7 +18,7 @@ lint-all:
    18 18
         - firefox
    
    19 19
       script:
    
    20 20
         - ./mach configure --without-wasm-sandboxed-libraries --with-base-browser-version=0.0.0
    
    21
    -    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v
    
    21
    +    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -0 --no-run-if-empty ./mach lint -v
    
    22 22
       rules:
    
    23 23
         - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    
    24 24
         # Run job whenever a commit is merged to a protected branch