Modernising a fork without deleting the fork
Two years on, three Telephony files are still in the repository, and one thing they used to do is still missing from what replaced them.
What was kept, and why
The wireless PCAP extractor is a fork of a Telephony-squad service, so moving it onto the shared
wireless pipeline meant replacing a build that worked. I renamed the old files instead of
deleting them. That is Telephony.Jenkinsfile.telephony (108 lines), Telephony.Makefile (38),
and Makefile.common — which git recorded as a rename to Telephony.Makefile.common (60). All
three are still in the tree.
That was not sentiment. The old build knew things the new one had to be told, and the quickest
way to find them was reading the old file beside the one replacing it. One example: the old
push target called the registry's artifact API first and refused a version that already
existed (a 200 on the artifact means stop).
push:
@curl -k -s -f https://$(REGISTRY)/api/v2.0/projects/$(REGISTRY_PROJECT)/\
repositories/$(REGISTRY_REPOSITORY)/artifacts/$(VERSION) >/dev/null 2>&1; \
if [ $(FORCE_PUSH) -eq 0 -a $$? -eq 0 ]; then \
echo >&2 "Version $(VERSION) already exists, bump the version before pushing"; \
exit 1; \
fi
The new push is one docker push with no guard. That is right here and would have been wrong
there: this repository pushes red (a rolling development tag, overwritten on every build),
where the old target pushed an immutable semver.
What the replacement dropped
The old Makefile.common was fetched during the build by cloning a separate makefile repository
into /tmp (clone, copy one file out, delete the clone). Removing that was the point of the
migration, and the new Makefile is 40 lines — no includes, no clone. The cost got itemised the
same afternoon, in a target I wrote and have not since replaced:
test:
echo "Not implemented yet"
Three checks went with it. Makefile.common ran mix test inside the built image, and
Telephony.Makefile ran mix coveralls as a test_coverage target. A lint target ran credo
out of a pinned container (elixir-credo:1.6.4-elixir1.13). The old Jenkinsfile ran the release
check and the coverage run in parallel, so both of them gated a merge.
The image scan is the only check that survived, and it survived by leaving the repository —
trivy client --remote came out of the Makefile because scanning belongs to the shared pipeline.
A fourth thing came along untouched: .trivyignore, 81 CVE lines added in December 2021
(ENGDESK-12511, Telephony squad); nobody has edited it since the fork, including me.
Where it actually runs
Dev deployment landed on the wireless_billing_dev host group (another service's hosts,
borrowed); the extractor needed somewhere to run before it needed hosts of its own. Production
got twelve lines nine days later, under CW-1515:
deploy:
instances : 1
cpu : 256
memory : 256
host_groups: ["wireless_pcap_extractor_prod"]
service:
- name: wireless-pcap-extractor
port: 1968
Deploy-time secrets took three attempts. Twenty-four environment variable names went in as a
plain list first. They were then commented out in favour of a deploy_custom_config.vault_secrets
block naming the same twenty-four keys. Three days later they were swapped back, once the ansible
project carried an env file. Both blocks are still in meta-dev.yml (one live, one commented),
which is an honest record of which way round it ended.
What it cost
The modernisation is real and narrow: one self-contained Makefile, a Jenkinsfile that went from 117 lines to nine, two deploy specs, and no build-time clone of another repository. It also left two things behind — a test target that prints a string, and a lint step nothing runs. Writing that down costs less than claiming the debt went away.