1
0
mirror of https://github.com/linkedin/oncall.git synced 2025-11-27 23:18:38 +02:00
Files
oncall/db/dummy_data.sql
Diego Cepeda af327b4e4a Py3 (#290)
* Py3 migration

* Update to Python 3 for CircleCI

* Fix auth bugs for python 3

Also fix notifier bug to check for active users

* Update notifier exception handling

Ignore role:target lookup failures from Iris, since these don't represent
problems with the underlying system, just that people have inactive users
on-call in the future.

* Add get_id param option (#246)

* add get_id param option

* removed superfluous select and simplified logic

* Flake8 typo (#247)

* Hide confusing team settings in an advanced dropdown

* Fix test fixtures

* Add "allow duplicate" scheduler in UI

Already in backend, so enable in FE too

* Add Dockerfile to run oncall in a container

* Move deps into a virtualenv.
Run app not as super user.
Mimick prod setup by using uwsgi

* Fix issue with Dockerfile not having MANIFEST.in and wrong passwords in (#257)

config

* Update to ubuntu:18.04 and python3 packages and executables

* Open config file as utf8

The default configuration file has utf8 characters, and python3
attempts to open the file as ASCII unless an alternate encoding
is specified

* Switch to the python3 uwsgi plugin

* Update print and os.execv statements for python3

Python3 throws an exception when the first argument to os.execv is empty:
ValueError: execv() arg 2 first element cannot be empty

The module documentation suggests that the first element should be the
name of the executed program:
https://docs.python.org/3.7/library/os.html#os.execv

* Map config.docker.yaml in to the container as a volume

./ops/entrypoint.py has the start of environment variable support
to specify a configuration file, but it is incomplete until we
update ./ops/daemons/uwsgi-docker.yaml or add environment support
to oncall-notifier and oncall-scheduler.

This commit allows users to map a specific configuration file in
to their container and have it used by all oncall programs.

* Convert line endings to match the rest of the project.

* Add mysql port to docker configuration

* Assume localhost mysql for default config.yaml

* Update python-dev package and MySQL root password

* Use password when configuring mysql

The project has started using a password on the mysql instance.
Once password auth is consistently working we can consider extracting
the hardcoded password into an env file that is optionally randomly
generated on initial startup.

* Fix preview for round-robin (#269)

* #275 fix for Python3 and Gunicorn load config

* Fixed E303 flake8

* Change encoding & collation + test  unicode name

Co-authored-by: Daniel Wang <dwang159@gmail.com>
Co-authored-by: ahm3djafri <42748963+ahm3djafri@users.noreply.github.com>
Co-authored-by: TK <tkahnoski+github@gmail.com>
Co-authored-by: Tim Freund <tim@freunds.net>
Co-authored-by: Rafał Zawadzki <bluszcz@bluszcz.net>
2020-01-15 15:38:25 -08:00

136 lines
4.1 KiB
SQL

-- Sample MySQL data. Can be loaded after initializing schema
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES
(1,'root',1,'God User',NULL,NULL,1),
(2,'manager',1,'Team Admin',NULL,NULL,0),
(3,'jdoe',1,'Juan Doş',NULL,NULL,0),
(4,'asmith',1,'Alice Smith',NULL,NULL,0);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `team` WRITE;
/*!40000 ALTER TABLE `team` DISABLE KEYS */;
INSERT INTO `team` VALUES (1,'Test Team','#team','team@example.com','US/Pacific',1,NULL,0,NULL);
/*!40000 ALTER TABLE `team` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `service` WRITE;
/*!40000 ALTER TABLE `service` DISABLE KEYS */;
INSERT INTO `service` VALUES (1,'test service');
/*!40000 ALTER TABLE `service` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `notification_setting` WRITE;
/*!40000 ALTER TABLE `notification_setting` DISABLE KEYS */;
INSERT INTO `notification_setting` VALUES
(1,4,1,1,1,86400,NULL),
(2,4,1,1,1,604800,NULL),
(3,2,1,1,1,86400,NULL),
(4,2,1,1,1,604800,NULL),
(7,3,1,1,1,86400,NULL),
(8,3,1,1,1,604800,NULL),
(9,4,1,1,3,NULL,1);
/*!40000 ALTER TABLE `notification_setting` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `roster` WRITE;
/*!40000 ALTER TABLE `roster` DISABLE KEYS */;
INSERT INTO `roster` VALUES (1,'Test Roster',1),(2,'Test Roster 2',1);
/*!40000 ALTER TABLE `roster` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `roster_user` WRITE;
/*!40000 ALTER TABLE `roster_user` DISABLE KEYS */;
INSERT INTO `roster_user` VALUES (1,3,1,0),(1,4,1,1),(2,2,1,0);
/*!40000 ALTER TABLE `roster_user` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `schedule` WRITE;
/*!40000 ALTER TABLE `schedule` DISABLE KEYS */;
INSERT INTO `schedule` VALUES (1,1,1,1,21,0,1496559600,NULL,1),(2,1,2,4,21,0,1496559600,NULL,1);
/*!40000 ALTER TABLE `schedule` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `schedule_event` WRITE;
/*!40000 ALTER TABLE `schedule_event` DISABLE KEYS */;
INSERT INTO `schedule_event` VALUES (1,1,205200,604800),(2,2,205200,604800);
/*!40000 ALTER TABLE `schedule_event` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `setting_role` WRITE;
/*!40000 ALTER TABLE `setting_role` DISABLE KEYS */;
INSERT INTO `setting_role` VALUES (1,1),(2,1),(3,1),(4,1),(7,1),(8,1),(9,1),(1,2),(2,2),(3,2),(4,2),(7,2),(8,2),(1,3),(2,3),(3,3),(4,3),(7,3),(8,3),(1,4),(2,4),(3,4),(4,4),(7,4),(8,4);
/*!40000 ALTER TABLE `setting_role` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `team_admin` WRITE;
/*!40000 ALTER TABLE `team_admin` DISABLE KEYS */;
INSERT INTO `team_admin` VALUES (1,2),(1,4);
/*!40000 ALTER TABLE `team_admin` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `team_service` WRITE;
/*!40000 ALTER TABLE `team_service` DISABLE KEYS */;
INSERT INTO `team_service` VALUES (1,1);
/*!40000 ALTER TABLE `team_service` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `team_user` WRITE;
/*!40000 ALTER TABLE `team_user` DISABLE KEYS */;
INSERT INTO `team_user` VALUES (1,2),(1,3),(1,4);
/*!40000 ALTER TABLE `team_user` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `user_contact` WRITE;
/*!40000 ALTER TABLE `user_contact` DISABLE KEYS */;
INSERT INTO `user_contact` VALUES
(1,3,'+1 111-111-1111'),
(1,4,'root'),
(1,2,'+1 111-111-1111'),
(1,1,'root@example.com'),
(2,3,'+1 222-222-2222'),
(2,4,'bsmith'),
(2,2,'+1 222-222-2222'),
(2,1,'bsmith@example.com'),
(3,3,'+1 333-333-3333'),
(3,4,'jdoe'),
(3,2,'+1 333-333-3333'),
(3,1,'jdoe@example.com'),
(4,3,'+1 444-444-4444'),
(4,4,'asmith'),
(4,2,'+1 444-444-4444'),
(4,1,'asmith@example.com');
/*!40000 ALTER TABLE `user_contact` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `event` WRITE;
/*!40000 ALTER TABLE `event` DISABLE KEYS */;
INSERT INTO `event` (`id`, `team_id`, `role_id`, `schedule_id`, `user_id`, `start`, `end`) VALUES
(1,1,1,1,3,1495555200,1496160000),
(2,1,1,1,4,1496160000,1496764800),
(3,1,1,1,3,1496764800,1497369600),
(7,1,4,2,2,1495555200,1496160000),
(8,1,4,2,2,1496160000,1496764800),
(9,1,4,2,2,1496764800,1497369600);
/*!40000 ALTER TABLE `event` ENABLE KEYS */;
UNLOCK TABLES;