Coder Social home page Coder Social logo

pickleweb's People

Contributors

jedibc avatar jubianchi avatar lyrixx avatar pborreli avatar pierrejoye avatar tarekdj avatar weltling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pickleweb's Issues

add CS bin command

Now that we have coke, it would be nice to add the respective commands to bin/ to fix CS or detect errors.

I can then use them as git prehook and stop on error

Composer/Packagist compatible API

For example:

. https://github.com/KnpLabs/packagist-api should work out of the box when using pickleweb

For what packagist does:
Quote from a discussion with Jordi:

It all starts with:

https://packagist.org/packages.json

Then provider-includes define a list of provider listings, e.g.:

p/provider-2013$%hash%.json: {
sha256: "41baf880b781a44db23b1e880f014e25cdc59939b381deb38f8d52d5a74ef717"
},

can be queried at:

https://packagist.org/p/provider-2013$41baf880b781a44db23b1e880f014e25cdc59939b381deb38f8d52d5a74ef717.json

And inside that, every provider like:

0x20h/monoconf: {
sha256: "b5bc3eac62b9f38814b140be994c268b7c1f3d9d32bea4dfc53ca15def1f27e1"
},

Can be found at the url defined by providers-url in the main file, i.e.:

https://packagist.org/p/0x20h/monoconf$b5bc3eac62b9f38814b140be994c268b7c1f3d9d32bea4dfc53ca15def1f27e1.json

And providers can also be found at just the package name without hash, which might be useful eventually so it's best if you also do it I guess:

That URL is hardcoded to /p/%name%.json

https://packagist.org/p/0x20h/monoconf.json

It's all done in https://github.com/composer/packagist/blob/master/src/Packagist/WebBundle/Package/SymlinkDumper.php for reference.

--- end of the quote

It should be done in a similar way but maybe simpler, from a tree structure point of view.

Coding Standards

What are the coding standards used for the project ?

My IDE (phpstorm) is configured with Symfony2 CS but I see @pierrejoye fixing the spaces between . on string concatenation ๐Ÿ˜›

As I've the habit of regularly launch the auto-format of the code, it would be usefull to know which CS is used and perhaps enforce verification via a tool like https://github.com/M6Web/Coke on build process on Travis CI.

Error in Docker PHP

Keep getting this error. Are we relying on the right images?

E: Failed to fetch http://http.debian.net/debian/pool/main/e/expat/libexpat1_2.1.0-6+b3_amd64.deb Error reading from server. Remote end closed connection [IP: 5.153.231.35 80]

E: Failed to fetch http://http.debian.net/debian/pool/main/l/less/less_458-3_amd64.deb Error reading from server. Remote end closed connection [IP: 5.153.231.35 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

UI for the frontend

For the UI:

public area

  • static pages generations
  • update on release/edit

Ideas

  • ideally the data are fetched from the json directly, without databases
  • search features can be implemented later using one of the popular index/search engine out there

dev area

  • login using github
  • login using bitbucket
  • login using google
  • register new package
  • edit custom meta, tags, etc.

Just some thoughts to get the TODOs :)

Vendors handling while supporting different dev platforms (github, bitbucket, etc.)

I might err, but currently we've also an issue with the vendors coming from different locations. Example situation

  • vendor0 is on github
  • vendor0 is on bitbucket

Those two are different people. Each of them has the same vendor0/extname. Here we currently run into the situation first with json handling in pickleweb as it's not separated by the vendor location. Say it would save to the same web/json/vendor0 for both vendors.

There's no issue created for pickle yet, but it also doesn't really handle the communication with pickleweb yet. So it would need to match with pickleweb anyway when implemented. In this regard also rmtools is affected, as it'll need to handle the vendors from different locations for uploading the windows builds.

The other sub case of this which needs to be handled is when the name in composer.json doesn't have a vendor. While it can be probably fixed for pickle convert, pickleweb might receive some hand made composer.json.

Upgrade to slim 3

Upgrade/refactor to slim 3.

Quite a few changes but last bug thing I have been waiting for to go live.

Exception when registering a new package

Slim Application Error

The application could not run because of the following error:
Details
Type: ErrorException
Code: 8
Message: Undefined index: time
File: E:\repo_pickle\pickleweb\src\Entity\Extension.php
Line: 108
Trace
#0 E:\repo_pickle\pickleweb\src\Entity\Extension.php(108): Slim\Slim::handleErrors(8, 'Undefined index...', 'E:\repo_pickle...', 108, Array)
#1 E:\repo_pickle\pickleweb\src\Controller\PackageController.php(233): PickleWeb\Entity\Extension->setFromRepository(Object(PickleWeb\Repository\Github), Object(Composer\IO\BufferIO))
#2 [internal function]: PickleWeb\Controller\PackageController->registerPackageAction()
#3 E:\repo_pickle\pickleweb\vendor\akrabat\rka-slim-controller\RKA\Slim.php(79): call_user_func_array(Array, Array)
#4 [internal function]: RKA\Slim->RKA{closure}()
#5 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Route.php(468): call_user_func_array(Object(Closure), Array)
#6 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Slim.php(1357): Slim\Route->dispatch()
#7 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Middleware\Flash.php(85): Slim\Slim->call()
#8 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Middleware\MethodOverride.php(92): Slim\Middleware\Flash->call()
#9 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Middleware\PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#10 E:\repo_pickle\pickleweb\vendor\slim\slim\Slim\Slim.php(1302): Slim\Middleware\PrettyExceptions->call()
#11 E:\repo_pickle\pickleweb\src\Application.php(181): Slim\Slim->run()
#12 E:\repo_pickle\pickleweb\web\index.php(209): PickleWeb\Application->run()
#13 {main}

Invalid tag blocks all the subsequent tags from import

The way to reproduce:

  • in the extension imported into pickleweb, create and push tag test-tag-42
  • the github log says, pickleweb responded with exception containing: Invalid version string "test-tag-42"
  • create and push a valid tag, like 3.2.1
  • the github log says, pickleweb responded with
    {"status":"error","message":"weltling/imagick-3.2.1 error on import:Invalid version string "test-tag-42""}

Any subsequent tag will have similar error message, no exception thrown.

Tag version needs to be validated with composer.json

Currently there's no validation of the tag with the version in the composer.json. This difference, besides confusing, would cause the versions compiled/packaged be different from what is shown on the pickleweb site or in phpinfo().

This interfere with the pickle issue FriendsOfPHP/pickle#111 , so pickleweb could be using the pickle itself for the triple validation - tag, composer.json and the version in the header file (or any other way for different engines).

config.json

hi,

config.json should be in .gitignore and config.json.in added, to avoid pushing real id by mistake :)

github/bitbucket oauth

Little hack has been added, see https://github.com/FriendsOfPHP/pickleweb/blob/master/src/Action/AuthGithub.php

Ideas are:

  • use only github or bitbucket for auth
  • grab the profile
    . store it locally under /web/json/users/<github|other>/.json

As of now only github is done, so some data normalization is required.

I kept it like that for now as I like to focus mainly on the hooks, to grab release infos, register package, etc. The way it is stored is open as well, it works just fine for now, and easy to cache.

Feel free to totally rewamp that part or even use another OAuth component.

Search form submits to a non GUI page

When the search form contains some query text, then hitting enter submits the form to a URL like http://81fb0b33.ngrok.io/searchhtml/?search_query=aoeuoaeu which is just an empty page containing the text "null". The form submission should be most likely prevented as the search works per AJAX.

Difference in the github hook configuration impeds data delivery

While testing the pickleweb site, I've discovered, that it's not prepared for all the variants of the data delivery from github. Thus, under the option

  • Which events would you like to trigger this webhook?

when any of the options

  • Just the push event.
  • Send me everything.

is used, the payload json format is different. In this case pickleweb fails to parse it so no data update happens to the particular item. The only way i could bring the github data to be accepted right now is using the

  • Let me select individual events.

option and manually enabling the create event (in addition to the preselected push event). Here are the both different JSON format variants

https://gist.github.com/weltling/f97b1cc4630c071829f3
https://gist.github.com/weltling/13a075879eb91e922d61

Also note that if the create event is enabled manually, then after the tag creation the headers contain

  • X-GitHub-Event: create

otherwise it contains

  • X-GitHub-Event: push

Provide list of bundled extensions per PHP branch

A simple list of the extensions bundled in the core per major version.

pickle cmd line or composer can then fetch them to directly deal correctly with it and tell the user to either enable, install or rebuild them php, alternatively rebuild php.

The list will be:

[
'extname' => false,
'extname' => 'vendor/repo',
]

false means this extension is only maintained in core.
'vendor/repo' is the name of the extensions within pickle, so if an newer external release is available, it can be installed.

Files:
/json/php-core-5.4.json
/json/php-core-5.5.json
/json/php-core-5.6.json
/json/php-core-7.0.json

Github/Bitbucket hook

Once the API is in place, the hooks to automatically get new releases can be implemented.

Invalid search query freezes javascript UI

When typing the query hello/ into the search box, the server delivers 500 and the UI doesn't respond anymore. Same with typing a \ in there. So there are two issues:

  • UI freezes when server delivered 500, most likely because the server delivers not a valid json but a usual exception output
  • Some chars in the search query, at least known now - \ and /, need some special handling

Here's the exception delivered:

Slim Application Error

The application could not run because of the following error:
Details
Type: Elastica\Exception\ResponseException
Message: SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[dSbwdMkNQSmemFLsqt0NYg][packages][0]: SearchParseException[[packages][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }{[dSbwdMkNQSmemFLsqt0NYg][packages][1]: SearchParseException[[packages][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }{[dSbwdMkNQSmemFLsqt0NYg][packages][2]: SearchParseException[[packages][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }{[dSbwdMkNQSmemFLsqt0NYg][packages][3]: SearchParseException[[packages][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }{[dSbwdMkNQSmemFLsqt0NYg][packages][4]: SearchParseException[[packages][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":""}}}]]]; nested: QueryParsingException[[packages] Failed to parse query []]; nested: ParseException[Cannot parse '': Lexical error at line 1, column 2. Encountered: after : ""]; nested: TokenMgrError[Lexical error at line 1, column 2. Encountered: after : ""]; }]
File: /app/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php
Line: 158
Trace
#0 /app/vendor/ruflin/elastica/lib/Elastica/Request.php(168): Elastica\Transport\Http->exec(Object(Elastica\Request), Array)
#1 /app/vendor/ruflin/elastica/lib/Elastica/Client.php(603): Elastica\Request->send()
#2 /app/vendor/ruflin/elastica/lib/Elastica/Search.php(443): Elastica\Client->request('/_search', 'GET', Array, Array)
#3 /app/src/Controller/SearchController.php(58): Elastica\Search->search('')
#4 [internal function]: PickleWeb\Controller\SearchController->searchHtml()
#5 /app/vendor/akrabat/rka-slim-controller/RKA/Slim.php(79): call_user_func_array(Array, Array)
#6 [internal function]: RKA\Slim->RKA{closure}()
#7 /app/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#8 /app/vendor/slim/slim/Slim/Slim.php(1357): Slim\Route->dispatch()
#9 /app/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#10 /app/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#11 /app/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#12 /app/vendor/slim/slim/Slim/Slim.php(1302): Slim\Middleware\PrettyExceptions->call()
#13 /app/src/Application.php(181): Slim\Slim->run()
#14 /app/web/index.php(209): PickleWeb\Application->run()
#15 {main}

update hash on release

  • /json/vendor/repo%hash%.json and redo the link
  • update /packages.json

move the code from PackageController to a common place

Release happen in the github hook callback.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.