{"action":"created","comment":{"url":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments/24918956","id":24918956,"diff_hunk":"@@ -24,12 +25,22 @@ use FindBin qw($Bin);\n # after bumping the version please look at the instructions in the docs/Contributing.asciidoc file\n # on what scripts should be run and how\n our $VERSION = 24;\n+our $configname=\"$Bin/../lib/database.ini\";\n \n __PACKAGE__->load_namespaces;\n \n-my @paths = ( \"$Bin/../lib/database\", \"$Bin/../../lib/database\" );\n-unshift(@paths, dirname($ENV{OPENQA_CONFIG}).'/database') if ($ENV{OPENQA_CONFIG});\n-__PACKAGE__->config_paths(\\@paths);\n+\n+sub connect_db {\n+    my $mode = shift || $ENV{OPENQA_DATABASE} || 'production';\n+    CORE::state $schema;\n+    unless ($schema) {\n+        my %ini;\n+        #        print(\"ENV{OPENQA_DATABASE_CONFIG}=$ENV{OPENQA_DATABASE_CONFIG}\\n\");\n+        tie %ini, 'Config::IniFiles', ( -file => $ENV{OPENQA_DATABASE_CONFIG} || $configname );\n+        $schema=__PACKAGE__->connect($ini{$mode});","path":"lib/OpenQA/Schema/Schema.pm","position":29,"original_position":29,"commit_id":"e4c65a51a0cf5d8e84f8d226db75239c6a7c33a7","original_commit_id":"e4c65a51a0cf5d8e84f8d226db75239c6a7c33a7","user":{"login":"psladek","id":1746010,"avatar_url":"https://avatars.githubusercontent.com/u/1746010?v=3","gravatar_id":"","url":"https://api.github.com/users/psladek","html_url":"https://github.com/psladek","followers_url":"https://api.github.com/users/psladek/followers","following_url":"https://api.github.com/users/psladek/following{/other_user}","gists_url":"https://api.github.com/users/psladek/gists{/gist_id}","starred_url":"https://api.github.com/users/psladek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psladek/subscriptions","organizations_url":"https://api.github.com/users/psladek/orgs","repos_url":"https://api.github.com/users/psladek/repos","events_url":"https://api.github.com/users/psladek/events{/privacy}","received_events_url":"https://api.github.com/users/psladek/received_events","type":"User","site_admin":false},"body":"<blockquote>\r\nYeah, but is it needed? I don't think they are used anywhere in tests.\r\n</blockquote>\r\nyes, it is needed, for example t/api/06-products.t needs database.ini\r\n\r\n<blockquote>\r\nAFAIK they are loaded once on startup, I don't see where the problem is.\r\n</blockquote>\r\nIt could of course be done, but I think it is still clearer, in code, documentation and usage to have only one meaning for OPENQA_CONFIG. The only problem is backward compatibility..","created_at":"2015-02-18T17:08:57Z","updated_at":"2015-02-18T17:08:57Z","html_url":"https://github.com/os-autoinst/openQA/pull/165#discussion_r24918956","pull_request_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/165","_links":{"self":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments/24918956"},"html":{"href":"https://github.com/os-autoinst/openQA/pull/165#discussion_r24918956"},"pull_request":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/os-autoinst/openQA/pulls/165","id":28790980,"html_url":"https://github.com/os-autoinst/openQA/pull/165","diff_url":"https://github.com/os-autoinst/openQA/pull/165.diff","patch_url":"https://github.com/os-autoinst/openQA/pull/165.patch","issue_url":"https://api.github.com/repos/os-autoinst/openQA/issues/165","number":165,"state":"open","locked":false,"title":"Dbixdpnc","user":{"login":"psladek","id":1746010,"avatar_url":"https://avatars.githubusercontent.com/u/1746010?v=3","gravatar_id":"","url":"https://api.github.com/users/psladek","html_url":"https://github.com/psladek","followers_url":"https://api.github.com/users/psladek/followers","following_url":"https://api.github.com/users/psladek/following{/other_user}","gists_url":"https://api.github.com/users/psladek/gists{/gist_id}","starred_url":"https://api.github.com/users/psladek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psladek/subscriptions","organizations_url":"https://api.github.com/users/psladek/orgs","repos_url":"https://api.github.com/users/psladek/repos","events_url":"https://api.github.com/users/psladek/events{/privacy}","received_events_url":"https://api.github.com/users/psladek/received_events","type":"User","site_admin":false},"body":"action #5852 - remove DBIx::Class::Schema::Config\r\n\r\nloading database.ini via Config::IniFiles,\r\nmoving connect_db() moved from Utils.pm to Schema.pm","created_at":"2015-02-06T07:58:20Z","updated_at":"2015-02-18T17:08:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98ab147042f4210b8f1c22c6a8132a2052fc44eb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/165/commits","review_comments_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/165/comments","review_comment_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments/{number}","comments_url":"https://api.github.com/repos/os-autoinst/openQA/issues/165/comments","statuses_url":"https://api.github.com/repos/os-autoinst/openQA/statuses/e4c65a51a0cf5d8e84f8d226db75239c6a7c33a7","head":{"label":"psladek:dbixdpnc","ref":"dbixdpnc","sha":"e4c65a51a0cf5d8e84f8d226db75239c6a7c33a7","user":{"login":"psladek","id":1746010,"avatar_url":"https://avatars.githubusercontent.com/u/1746010?v=3","gravatar_id":"","url":"https://api.github.com/users/psladek","html_url":"https://github.com/psladek","followers_url":"https://api.github.com/users/psladek/followers","following_url":"https://api.github.com/users/psladek/following{/other_user}","gists_url":"https://api.github.com/users/psladek/gists{/gist_id}","starred_url":"https://api.github.com/users/psladek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psladek/subscriptions","organizations_url":"https://api.github.com/users/psladek/orgs","repos_url":"https://api.github.com/users/psladek/repos","events_url":"https://api.github.com/users/psladek/events{/privacy}","received_events_url":"https://api.github.com/users/psladek/received_events","type":"User","site_admin":false},"repo":{"id":29706912,"name":"openQA","full_name":"psladek/openQA","owner":{"login":"psladek","id":1746010,"avatar_url":"https://avatars.githubusercontent.com/u/1746010?v=3","gravatar_id":"","url":"https://api.github.com/users/psladek","html_url":"https://github.com/psladek","followers_url":"https://api.github.com/users/psladek/followers","following_url":"https://api.github.com/users/psladek/following{/other_user}","gists_url":"https://api.github.com/users/psladek/gists{/gist_id}","starred_url":"https://api.github.com/users/psladek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psladek/subscriptions","organizations_url":"https://api.github.com/users/psladek/orgs","repos_url":"https://api.github.com/users/psladek/repos","events_url":"https://api.github.com/users/psladek/events{/privacy}","received_events_url":"https://api.github.com/users/psladek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/psladek/openQA","description":"openQA web-frontend, scheduler and tools","fork":true,"url":"https://api.github.com/repos/psladek/openQA","forks_url":"https://api.github.com/repos/psladek/openQA/forks","keys_url":"https://api.github.com/repos/psladek/openQA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psladek/openQA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psladek/openQA/teams","hooks_url":"https://api.github.com/repos/psladek/openQA/hooks","issue_events_url":"https://api.github.com/repos/psladek/openQA/issues/events{/number}","events_url":"https://api.github.com/repos/psladek/openQA/events","assignees_url":"https://api.github.com/repos/psladek/openQA/assignees{/user}","branches_url":"https://api.github.com/repos/psladek/openQA/branches{/branch}","tags_url":"https://api.github.com/repos/psladek/openQA/tags","blobs_url":"https://api.github.com/repos/psladek/openQA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psladek/openQA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psladek/openQA/git/refs{/sha}","trees_url":"https://api.github.com/repos/psladek/openQA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psladek/openQA/statuses/{sha}","languages_url":"https://api.github.com/repos/psladek/openQA/languages","stargazers_url":"https://api.github.com/repos/psladek/openQA/stargazers","contributors_url":"https://api.github.com/repos/psladek/openQA/contributors","subscribers_url":"https://api.github.com/repos/psladek/openQA/subscribers","subscription_url":"https://api.github.com/repos/psladek/openQA/subscription","commits_url":"https://api.github.com/repos/psladek/openQA/commits{/sha}","git_commits_url":"https://api.github.com/repos/psladek/openQA/git/commits{/sha}","comments_url":"https://api.github.com/repos/psladek/openQA/comments{/number}","issue_comment_url":"https://api.github.com/repos/psladek/openQA/issues/comments/{number}","contents_url":"https://api.github.com/repos/psladek/openQA/contents/{+path}","compare_url":"https://api.github.com/repos/psladek/openQA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psladek/openQA/merges","archive_url":"https://api.github.com/repos/psladek/openQA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psladek/openQA/downloads","issues_url":"https://api.github.com/repos/psladek/openQA/issues{/number}","pulls_url":"https://api.github.com/repos/psladek/openQA/pulls{/number}","milestones_url":"https://api.github.com/repos/psladek/openQA/milestones{/number}","notifications_url":"https://api.github.com/repos/psladek/openQA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psladek/openQA/labels{/name}","releases_url":"https://api.github.com/repos/psladek/openQA/releases{/id}","created_at":"2015-01-22T23:58:16Z","updated_at":"2015-02-05T20:01:39Z","pushed_at":"2015-02-12T17:28:54Z","git_url":"git://github.com/psladek/openQA.git","ssh_url":"git@github.com:psladek/openQA.git","clone_url":"https://github.com/psladek/openQA.git","svn_url":"https://github.com/psladek/openQA","homepage":"http://openqa.opensuse.org/","size":12206,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"os-autoinst:master","ref":"master","sha":"9d5dfbcb5659f9e44fbc1df142ce1884bd81dc37","user":{"login":"os-autoinst","id":6918706,"avatar_url":"https://avatars.githubusercontent.com/u/6918706?v=3","gravatar_id":"","url":"https://api.github.com/users/os-autoinst","html_url":"https://github.com/os-autoinst","followers_url":"https://api.github.com/users/os-autoinst/followers","following_url":"https://api.github.com/users/os-autoinst/following{/other_user}","gists_url":"https://api.github.com/users/os-autoinst/gists{/gist_id}","starred_url":"https://api.github.com/users/os-autoinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/os-autoinst/subscriptions","organizations_url":"https://api.github.com/users/os-autoinst/orgs","repos_url":"https://api.github.com/users/os-autoinst/repos","events_url":"https://api.github.com/users/os-autoinst/events{/privacy}","received_events_url":"https://api.github.com/users/os-autoinst/received_events","type":"Organization","site_admin":false},"repo":{"id":20883829,"name":"openQA","full_name":"os-autoinst/openQA","owner":{"login":"os-autoinst","id":6918706,"avatar_url":"https://avatars.githubusercontent.com/u/6918706?v=3","gravatar_id":"","url":"https://api.github.com/users/os-autoinst","html_url":"https://github.com/os-autoinst","followers_url":"https://api.github.com/users/os-autoinst/followers","following_url":"https://api.github.com/users/os-autoinst/following{/other_user}","gists_url":"https://api.github.com/users/os-autoinst/gists{/gist_id}","starred_url":"https://api.github.com/users/os-autoinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/os-autoinst/subscriptions","organizations_url":"https://api.github.com/users/os-autoinst/orgs","repos_url":"https://api.github.com/users/os-autoinst/repos","events_url":"https://api.github.com/users/os-autoinst/events{/privacy}","received_events_url":"https://api.github.com/users/os-autoinst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/os-autoinst/openQA","description":"openQA web-frontend, scheduler and tools","fork":false,"url":"https://api.github.com/repos/os-autoinst/openQA","forks_url":"https://api.github.com/repos/os-autoinst/openQA/forks","keys_url":"https://api.github.com/repos/os-autoinst/openQA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/os-autoinst/openQA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/os-autoinst/openQA/teams","hooks_url":"https://api.github.com/repos/os-autoinst/openQA/hooks","issue_events_url":"https://api.github.com/repos/os-autoinst/openQA/issues/events{/number}","events_url":"https://api.github.com/repos/os-autoinst/openQA/events","assignees_url":"https://api.github.com/repos/os-autoinst/openQA/assignees{/user}","branches_url":"https://api.github.com/repos/os-autoinst/openQA/branches{/branch}","tags_url":"https://api.github.com/repos/os-autoinst/openQA/tags","blobs_url":"https://api.github.com/repos/os-autoinst/openQA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/os-autoinst/openQA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/os-autoinst/openQA/git/refs{/sha}","trees_url":"https://api.github.com/repos/os-autoinst/openQA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/os-autoinst/openQA/statuses/{sha}","languages_url":"https://api.github.com/repos/os-autoinst/openQA/languages","stargazers_url":"https://api.github.com/repos/os-autoinst/openQA/stargazers","contributors_url":"https://api.github.com/repos/os-autoinst/openQA/contributors","subscribers_url":"https://api.github.com/repos/os-autoinst/openQA/subscribers","subscription_url":"https://api.github.com/repos/os-autoinst/openQA/subscription","commits_url":"https://api.github.com/repos/os-autoinst/openQA/commits{/sha}","git_commits_url":"https://api.github.com/repos/os-autoinst/openQA/git/commits{/sha}","comments_url":"https://api.github.com/repos/os-autoinst/openQA/comments{/number}","issue_comment_url":"https://api.github.com/repos/os-autoinst/openQA/issues/comments/{number}","contents_url":"https://api.github.com/repos/os-autoinst/openQA/contents/{+path}","compare_url":"https://api.github.com/repos/os-autoinst/openQA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/os-autoinst/openQA/merges","archive_url":"https://api.github.com/repos/os-autoinst/openQA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/os-autoinst/openQA/downloads","issues_url":"https://api.github.com/repos/os-autoinst/openQA/issues{/number}","pulls_url":"https://api.github.com/repos/os-autoinst/openQA/pulls{/number}","milestones_url":"https://api.github.com/repos/os-autoinst/openQA/milestones{/number}","notifications_url":"https://api.github.com/repos/os-autoinst/openQA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/os-autoinst/openQA/labels{/name}","releases_url":"https://api.github.com/repos/os-autoinst/openQA/releases{/id}","created_at":"2014-06-16T12:23:22Z","updated_at":"2015-02-18T16:19:20Z","pushed_at":"2015-02-18T16:19:22Z","git_url":"git://github.com/os-autoinst/openQA.git","ssh_url":"git@github.com:os-autoinst/openQA.git","clone_url":"https://github.com/os-autoinst/openQA.git","svn_url":"https://github.com/os-autoinst/openQA","homepage":"http://openqa.opensuse.org/","size":14796,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":6,"forks":16,"open_issues":6,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/165"},"html":{"href":"https://github.com/os-autoinst/openQA/pull/165"},"issue":{"href":"https://api.github.com/repos/os-autoinst/openQA/issues/165"},"comments":{"href":"https://api.github.com/repos/os-autoinst/openQA/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/os-autoinst/openQA/statuses/e4c65a51a0cf5d8e84f8d226db75239c6a7c33a7"}}}}