This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Conversation
Contributor
|
Refer to this link for build results (access rights to CI server needed): |
Member
|
Tested with a dummy migration and could see the up/down being tested |
dangogh
suggested changes
Dec 11, 2018
added 5 commits
December 11, 2018 13:02
To reduce dependency on all the TO Perl package requirements for running the db/admin.pl Perl script, rewrite it in Go.
Contributor
|
Refer to this link for build results (access rights to CI server needed): |
- moved .gitignore items into a .gitignore closer to the actual files - added workaround to use golang package in centos7 - fixed missing && in Dockerfile-db-admin RUN line
Contributor
|
Refer to this link for build results (access rights to CI server needed): |
dangogh
approved these changes
Dec 13, 2018
Member
|
tested in cdn-in-a-box -- all commands worked as advertised.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add a golang implementation of the TO db/admin.pl script. Vendor the gopkg.in/yaml.v2 package for parsing the dbconf.yml file (the config file for
goose). Build the golang executable into the TO rpm next to the db/admin.pl script. Add a deprecation warning to the db/admin.pl script to use the db/admin binary instead. Add a docker environment for running DB tests (uses the golang db/admin binary to test the sql migrations, seeds, patches, etc).Which TC components are affected by this PR?
What is the best way to verify this PR?
Pull down this PR locally and:
Go back and forth between using db/admin and db/admin.pl to verify that the behavior of the same arguments is the same for both.
Run the provided DB test using docker-compose (pass it a traffic_ops.rpm and initial DB dump from your local TO instance):
To grab an initial DB dump and place it for the test, use the
<insert your TO hostname here>/api/1.3/dbdumpendpoint and copy the response totraffic_ops_db/test/docker/initdb.d/.Then run the tests w/ docker-compose:
Check all that apply