Opened 5 years ago

Closed 5 years ago

#1377 closed defect (fixed)

Blacklist resources managed by ensure_dependencies.py in Git

Reported by: matze Assignee: AAlvz
Priority: P4 Milestone:
Module: Automation Keywords: infrastructure hg git
Cc: trev, fhd, poz2k4444, AAlvz Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/5934936779390976
https://github.com/mjhennig/adblockplus-infrastructure/pull/7

Description

Observed Behavior

When working with the new ensure_dependencies.py script and git(1), one currently needs to manually ensure that the contents of fetched modules are not added to the git index.

Possible Workarounds

Below please find a list of possible workarounds beside manually maintaining the module paths in a .gitignore file - without necessity of completeness but in order of recommendation:

  • Use git-update-index(1) in to blacklist the resource paths from being added to the index.
  • Manually maintain the destination paths in the .git/info/exclude file.
  • Create some fancy githooks(5) to circumvent the issue.

Expected Behavior

The ensure_dependencies.py script should *automagically* apply one of the aforementioned workarounds (except the .gitignore file solution, of course).

Change History (9)

comment:3 Changed 5 years ago by trev

  • Component changed from Unknown to Build-and-Release-Tools
  • Priority changed from Unknown to P4
  • Ready set

You shouldn't modify the copy in the infrastructure repository but rather the master in the buildtools repository.

comment:4 Changed 5 years ago by matze

  • Owner set to poz2k4444

We will, the Git version is only used for collaboration and testing right now. The patch-set for review will address the buildtools version, however.

comment:5 Changed 5 years ago by matze

  • Review URL(s) modified (diff)

comment:6 Changed 5 years ago by matze

  • Owner changed from poz2k4444 to AAlvz
  • Review URL(s) modified (diff)

In addition to the circumstances explained in the ticket description, there are also a few more cases that may need to be addressed:

  • When only one of the dependency versions is available (e.g. during development, when testing an upgrade to a more recent version or when waiting for the HG=>Git sync), it's possible that the script uses e.g. the Git dependencies although the root repository has been cloned via Mercurial (or vice-versa). In that case, the Mercurial mechanism of ignoring directories that feature a .hg sub-directory is circumvented, of course.
  • When working with both Mercurial and Git in the same directory (quite common, even in our office), it's actually the Python hashing algorithm that will decide whether the Mercurial or Git versions of the dependencies are preferred when updating. Thus, one may consider converting the repo_types variable into an ordered set or similar (it's currently a hash, although there's no need for string-associative access anywhere in the script).

Note that the first item is addressed in the first patch-set for review - in addition to the ticket's general changes -, while the latter is currently just a side-note to consider.

comment:7 Changed 5 years ago by matze

  • Status changed from new to reviewing

comment:8 Changed 5 years ago by matze

@trev @fhd
Please make sure the changes are pushed to the buildtools repo.

@AAlvz
As soon as the buildtools repo has been updated this ticket can be closed.

comment:9 Changed 5 years ago by trev

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.