
henry pushed to branch mullvad-browser-140.2.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser Commits: f970b38c by henry at 2025-08-14T17:13:58+01:00 fixup! Add CI for Base Browser TB 44104: Do not run linter when a merge request has no overall change. We also use `\0` to separate file names, rather than `\n`. (cherry picked from commit 87c721a5889b1a2c4ecf9658afe72f78077fe8be) Co-authored-by: Henry Wilkes <henry@torproject.org> - - - - - 2 changed files: - .gitlab/ci/jobs/lint/helpers.py - .gitlab/ci/jobs/lint/lint.yml Changes: ===================================== .gitlab/ci/jobs/lint/helpers.py ===================================== @@ -84,6 +84,10 @@ def get_list_of_changed_files(): if os.getenv("CI_PIPELINE_SOURCE") == "merge_request_event": # For merge requests, the base_reference is the common ancestor between the MR and the target branch base_reference = os.getenv("CI_MERGE_REQUEST_DIFF_BASE_SHA") + if not base_reference: + # Probably because there has been no overall change. + # See gitlab.com/gitlab-org/gitlab/-/issues/375047#note_2648459916 + return [] else: # When not in merge requests, the base reference is the Firefox tag base_reference = get_firefox_tag(os.getenv("CI_COMMIT_BRANCH")) @@ -118,6 +122,8 @@ if __name__ == "__main__": if args.get_firefox_tag: print(get_firefox_tag(args.get_firefox_tag)) elif args.get_changed_files: - print("\n".join(get_list_of_changed_files())) + # Separate the file names with a 0 byte to be parsed by xargs -0. Also + # drop the trailing '\n'. + print("\0".join(get_list_of_changed_files()), end="") else: print("No valid option provided.") ===================================== .gitlab/ci/jobs/lint/lint.yml ===================================== @@ -18,7 +18,7 @@ lint-all: - firefox script: - ./mach configure --without-wasm-sandboxed-libraries --with-base-browser-version=0.0.0 - - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -0 --no-run-if-empty ./mach lint -v rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' # Run job whenever a commit is merged to a protected branch View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/f970... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/f970... You're receiving this email because of your account on gitlab.torproject.org.
participants (1)
-
henry (@henry)