You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/11/20 21:40:42 UTC
[GitHub] rawlinp opened a new pull request #3047: Golang DB admin
rawlinp opened a new pull request #3047: Golang DB admin
URL: https://github.com/apache/trafficcontrol/pull/3047
#### 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?
- [ ] Documentation
- [ ] Grove
- [ ] Traffic Analytics
- [ ] Traffic Monitor
- [x] Traffic Ops
- [ ] Traffic Ops ORT
- [ ] Traffic Portal
- [ ] Traffic Router
- [ ] Traffic Stats
- [ ] Traffic Vault
- [ ] Other _________
#### What is the best way to verify this PR?
Pull down this PR locally and:
```
cd traffic_ops/app/db
go build admin.go
cd ..
db/admin <insert arg here>
```
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 build and copy the traffic_ops.rpm:
./pkg -v traffic_ops_build
cp dist/traffic_ops-* traffic_ops_db/test/docker/traffic_ops.rpm
```
To grab an initial DB dump and place it for the test, use the `<insert your TO hostname here>/api/1.3/dbdump` endpoint and copy the response to `traffic_ops_db/test/docker/initdb.d/`.
Then run the tests w/ docker-compose:
```
cd traffic_ops_db/test/docker
docker-compose build
docker-compose up --exit-code-from trafficops-db-admin
```
#### Check all that apply
- [x] This PR includes tests
- [ ] This PR includes documentation updates
- [ ] This PR includes an update to CHANGELOG.md
- [x] This PR includes all required license headers
- [ ] This PR includes a database migration (ensure that migration sequence is correct)
- [ ] This PR fixes a serious security flaw. Read more: [www.apache.org/security](http://www.apache.org/security/)
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services