{"action":"created","issue":{"url":"https://api.github.com/repos/iTXTech/Genisys/issues/1846","repository_url":"https://api.github.com/repos/iTXTech/Genisys","labels_url":"https://api.github.com/repos/iTXTech/Genisys/issues/1846/labels{/name}","comments_url":"https://api.github.com/repos/iTXTech/Genisys/issues/1846/comments","events_url":"https://api.github.com/repos/iTXTech/Genisys/issues/1846/events","html_url":"https://github.com/iTXTech/Genisys/pull/1846","id":174958296,"number":1846,"title":"Download PR-specified plugins in Travis-CI build","user":{"login":"SOF3","id":19623715,"avatar_url":"https://avatars.githubusercontent.com/u/19623715?v=3","gravatar_id":"","url":"https://api.github.com/users/SOF3","html_url":"https://github.com/SOF3","followers_url":"https://api.github.com/users/SOF3/followers","following_url":"https://api.github.com/users/SOF3/following{/other_user}","gists_url":"https://api.github.com/users/SOF3/gists{/gist_id}","starred_url":"https://api.github.com/users/SOF3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SOF3/subscriptions","organizations_url":"https://api.github.com/users/SOF3/orgs","repos_url":"https://api.github.com/users/SOF3/repos","events_url":"https://api.github.com/users/SOF3/events{/privacy}","received_events_url":"https://api.github.com/users/SOF3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-04T16:55:32Z","updated_at":"2016-09-05T08:00:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/iTXTech/Genisys/pulls/1846","html_url":"https://github.com/iTXTech/Genisys/pull/1846","diff_url":"https://github.com/iTXTech/Genisys/pull/1846.diff","patch_url":"https://github.com/iTXTech/Genisys/pull/1846.patch"},"body":"### Description\r\nThis pull request changes the Travis build script. The build will download a list of plugins specified in the pull request body, and run the test server with them. The plugin list section starts with this line:\r\n\r\n```markdown\r\n# Plugins to test with Travis-CI <!-- IGNORE THIS COMMENT - this comment is for INTERNAL use -->\r\n```\r\n\r\nFollowed by a plugin list, where plugins can be specified in these formats:\r\n\r\n```markdown\r\n- http://url.here\r\n- [file-name.php](https://url.here)\r\n```\r\n\r\nIf the former format is used, a file `Genisys-CI-Untitled-%d.%s` will be created, where `%d` is the line number - 1 of the line that specified the plugin in the pull request body, and `%s` is `php` or `phar`, detected in this algorithm:\r\n\r\n```vbs\r\nif __HALT_COMPILER exists in the file\r\nthen\r\n    attempt to create Phar object from this file\r\n    if UnexpectedValueException is thrown\r\n    then\r\n        implies that it is not a valid phar\r\n        set file extension to .php\r\n    else\r\n        set file extension to .phar\r\n    end if\r\nelse\r\n    set file extension to .php\r\nend if\r\n```\r\n\r\nThe plugin list section is terminated by:\r\n* a line exactly `<!-- END -->`  when trimmed\r\n* a line without visible characters (`strlen(trim($line)) === 0`)\r\n* a line that does not match any of the two formats above\r\n* end of file\r\n\r\nAnd skips but is not terminated by other lines starting with `<!-- `.\r\n\r\nExamples are present as followings:\r\n\r\n# Plugins to test with Travis-CI\r\n- https://gist.githubusercontent.com/SOF3/04cf1f3ced0d062a3bf7578ab086e692/raw/738f5aaaa6b58c6ba6a01b025a77f8affbcdb3a1/plugin.php\r\n<!-- This line should be skipped -->\r\n- https://gist.githubusercontent.com/SOF3/7ab7222ec3c76bd3c5dad73fc26b0cb4/raw/21a6f327b5cf550e1dbe77bb08d81ce1f3fb66f4/plugin.php\r\n<!-- END -->\r\n\r\n### Reason to modify\r\nTravis-CI is usually useless for pull requests related to plugin API. In order to maximize the usage of Travis-CI, this pull request allows future pull requests to validate that they work through attaching links to plugins that can test against their features. These can be instant script plugins on GitHub Gist/other pastebin sites, or preexisting plugins that are known to use a certain API feature.\r\n\r\nPlugins can also be created to stress test the server from different approaches.\r\n\r\n### Tests & Reviews\r\nI have tested `ciDlPlugins.php` and it works.\r\n\r\nI have **not** tested how the modified `.travis.yml` works on Travis-CI yet, especially when it comes to GitHub API rate limit. However, through careful manual inspection, it seems to be correct.\r\n\r\n### Possible enhancements/fixes\r\n- Load from attached files in pull request main comment\r\n- Fix issue about GitHub API rate limit on Travis-CI\r\n- Allow more syntax flexibility when listing the plugins\r\n- Extend this feature to normal commits (but probably would never get useful)\r\n- Setup a proxy page on a server officially specialized for Genisys, which will help access GitHub API with a private GitHub access token\r\n- Test server twice, once with plugins, once without plugins. Probably even checkout BASE and run test with plugins there as well."},"comment":{"url":"https://api.github.com/repos/iTXTech/Genisys/issues/comments/244682434","html_url":"https://github.com/iTXTech/Genisys/pull/1846#issuecomment-244682434","issue_url":"https://api.github.com/repos/iTXTech/Genisys/issues/1846","id":244682434,"user":{"login":"dktapps","id":14214667,"avatar_url":"https://avatars.githubusercontent.com/u/14214667?v=3","gravatar_id":"","url":"https://api.github.com/users/dktapps","html_url":"https://github.com/dktapps","followers_url":"https://api.github.com/users/dktapps/followers","following_url":"https://api.github.com/users/dktapps/following{/other_user}","gists_url":"https://api.github.com/users/dktapps/gists{/gist_id}","starred_url":"https://api.github.com/users/dktapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dktapps/subscriptions","organizations_url":"https://api.github.com/users/dktapps/orgs","repos_url":"https://api.github.com/users/dktapps/repos","events_url":"https://api.github.com/users/dktapps/events{/privacy}","received_events_url":"https://api.github.com/users/dktapps/received_events","type":"User","site_admin":false},"created_at":"2016-09-05T08:00:38Z","updated_at":"2016-09-05T08:00:38Z","body":"I think the intention is more along the lines of adding test plugins to test certain capabilities after modifications, written purely for this purpose. Currently the CI just runs, builds, shuts down. That does not pickup anything that breaks elsewhere unless it's something very basic like a syntax error. Used correctly, this can be used to demonstrate the results of changes made in a PR."}}
{"actor":{"display_login":"dktapps"}}