Closed Bug 1159099 Opened 6 years ago Closed 6 years ago

Remove library_overrides

Categories

(Developer Services :: Mercurial: hg.mozilla.org, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gps, Unassigned)

References

Details

Attachments

(2 files, 1 obsolete file)

When hg.mozilla.org was split out from NFS, it appears https://hg.mozilla.org/hgcustom/library_overrides/ came into existence. This repository contains a "shadow copy" of hooks. Although, the files are different in one critical way: the content is commented out and the hooks no-op.

Deep in the bowels of /usr/local/bin/mirror-pull, PYTHONPATH is manually munged so that the directory containing the library_overrides clone comes before the directory containing the hooks themselves. When a hook runs, it finds the copy from library_overrides and no-ops.

This solution is haphazard and prone to failures. For example, when hooks are added, we need to add a corresponding hook to library_overrides so the real hook doesn't run. I can think of a handful of times we didn't do this.

I want to do away with library_overrides completely. In its place, we'll modify the actual hooks to know whether they are running on the master or a mirror. If they are running on a mirror, they'll no-op. The same hooks will run on all machines and everything will be consistent.
Duplicate of this bug: 1159237
mirror-pull also explicitly nullifies some hooks with '--config hook.foo=' which should be cleaned up
Attached file MozReview Request: bz://1159099/gps (obsolete) —
/r/7797 - hghooks: no-op during pulls (bug 1159099)
/r/7799 - ansible: remove references to library_overrides (bug 1159099)

Pull down these commits:

hg pull -r f20347b43cb03aae8ce4af1a1ca3824bdee94962 https://reviewboard-hg.mozilla.org/version-control-tools/
Attachment #8598852 - Flags: review?(bkero)
Assuming the two commits I just pushed get reviewed, deployment will look like the following:

1) deploy version-control-tools to hg.mo using existing Ansible deployment mechanism
2) update sysadmins Puppet to remove references to library_overrides and run Puppet on all machines
3) purge library_override directories from hosts (Puppet could also do this if it wanted)
Attachment #8598852 - Flags: review?(bkero) → review+
Comment on attachment 8598852 [details]
MozReview Request: bz://1159099/gps

https://reviewboard.mozilla.org/r/7795/#review6599

Ship It!
(In reply to Kendall Libby [:fubar] from comment #2)
> mirror-pull also explicitly nullifies some hooks with '--config hook.foo='
> which should be cleaned up

I /think/ this nullification can be removed once the new, more intelligent hooks are deployed.

Also, the nullification only works when hooks are installed under a specific name. If a hook is installed under a different name, nothing happens. Another reason why logic should be baked into the code and not a run-time override.
Attachment #8598852 - Attachment is obsolete: true
Attachment #8620170 - Flags: review+
Attachment #8620171 - Flags: review+
There are no references to library_overrides on v-c-t. The directories still exist on a few servers. But I expect these to get phases out as servers are reimaged over time.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.