Skip to content

Resolve "Revert to use a simpler check for `ee-files-location-check`"

What does this MR do?

Use a simpler method to find newly added files. See the issue #6243 (closed) for more detail.

Are there points in the code the reviewer needs to double check?

We could see the previous code with:

git cat-file -p 37e3f20723285363578f28786019d62ef3260741 scripts/ee-files-location-check

Which is:

# ...

new_files_in_this_branch_not_at_the_ee_top_level =
  run_git_command("diff canonical-ee/master...HEAD --name-status --diff-filter=A -- ./ ':!ee' | cut -f2").lines.map(&:strip)

# ...

ee_specific_files_in_ce_master_not_at_the_ee_top_level =
  run_git_command("diff FETCH_HEAD..HEAD --name-status --diff-filter=A -- ./ ':!ee' | cut -f2").lines.map(&:strip)

# ...

There's a slightly difference between the old one. Instead of comparing with EE master, we still use the merge-base between EE master and HEAD (EE fetch HEAD). This should reduce false result yet it's still very simple to do.

Why was this MR needed?

The current algorithm to minimize false result is too broken

Does this MR meet the acceptance criteria?

  • Tests added for this feature/bug
  • Conform by the code review guidelines
    • Has been reviewed by a Backend maintainer

What are the relevant issue numbers?

Closes #6243 (closed)

Merge request reports