Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Imagine Bundle Recipe #14

Merged
merged 1 commit into from
May 24, 2017
Merged

Add Imagine Bundle Recipe #14

merged 1 commit into from
May 24, 2017

Conversation

robfrawley
Copy link
Contributor

This pull request adds a Symfony Flex recipe for LiipImagineBundle, a popular image manipulation bundle that leverages the Imagine Library internally.

I am waiting for some reviews from my fellow bundle maintainers, so do not merge this immediately. Also, as there isn't much information or many examples on writing these recipes yet, I look forward to fielding reviews or change requests from this repository's maintainers, as well.

Hopefully, this bundle will land in the exciting Symfony Flex ecosystem shortly!

@robfrawley robfrawley force-pushed the master branch 4 times, most recently from db57f16 to 782f8e9 Compare May 6, 2017 05:20
@robfrawley
Copy link
Contributor Author

robfrawley commented May 6, 2017

I'm left a little confused by the automated pull request checker, which has somehow determined that the liip/imagine-bundle package does not exist with any available versions, despite its existence with a plethora of available versions: what am I getting wrong here?

The following errors occurred while validating the pull request: package "liip/imagine-bundle" does not have any available version on Packagist

@alexwilson
Copy link

Just to check, is it possible that this is because of our requirement on ext-gd?

@fabpot
Copy link
Member

fabpot commented May 6, 2017

There is a bug in the validator (the issue here is that there is no dev-master version on Packagist). I will fix it soon.

@alexwilson
Copy link

Ah, thanks @fabpot!

- Twig: <comment>{{ imagine_filter('my_thumbnails') }}</comment>
- PHP: <comment>$this->get('liip_imagine.cache.manager')->getBrowserPath('/relative/path/to/image.jpg', 'my_thumbnails');</comment>

* <fg=blue>Read</> the documentation at <comment>http://symfony.com/doc/current/bundles/LiipImagineBundle</>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use https:// when linking to symfony.com. Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add a check for that :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed; thanks!

@robfrawley robfrawley force-pushed the master branch 3 times, most recently from 6d8b53e to 910ac96 Compare May 6, 2017 17:54
- GET
requirements:
filter: "[A-z0-9_\\-]*"
path: .+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use 4 spaces instead of 2 to keep consistency with the rest of the codebase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

"copy-from-recipe": {
"etc/": "%ETC_DIR%/"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed; thanks for the review!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

methods:
- GET
requirements:
filter: "[A-z0-9_\\-]*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use single quotes everywhere too? 😆 It'll help in backslash escaping too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea; updated.

@robfrawley robfrawley force-pushed the master branch 2 times, most recently from 19e1408 to 9b26ae4 Compare May 6, 2017 18:10
@@ -0,0 +1,19 @@
liip_imagine_filter:
Copy link

@Koc Koc May 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible include @LiipImagineBundle/Resources/config/routing.xml instead of copy-pasting it content here?

Copy link
Contributor Author

@robfrawley robfrawley May 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is that the use of YAML here was an intentional choice made to lower the entry barrier for someone looking to, perhaps, edit the route paths; XML is generally more difficult for newcomers to follow or edit.

Assuming adding the following addition to the manifest.json results in the same auto-registration of the file, I agree, aside from my aforementioned comment.

"copy-from-package": {
    "Resources/config/routing.xml": "%ETC_DIR%/routing/"
}

Copy link
Contributor

@Pierstoval Pierstoval May 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that you could just use

liip_imagine:
    resource: '@LiipImagineBundle/Resources/config/routing.xml'

It's fairly enough to add routing config with flex

Copy link
Contributor Author

@robfrawley robfrawley May 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, except it doesn't allow for users to edit it easily.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so convert LiipImagineBundle routing to yaml and copy it?

Copy link
Contributor Author

@robfrawley robfrawley May 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That isn't something we can do until the next major release, as people rely on the current name for their own usage in pre-flex applications.

Let's move this discussion to liip/LiipImagineBundle#924 so as to not pollute the Flex maintainers with our internal discussions.

@robfrawley
Copy link
Contributor Author

@fabpot Is there a standard for enabling multiple package versions and avoiding duplication of files; every single recipe file for this bundle is exactly the same for both version 1.7 and 2.0.

For example, is the solution found at the following link acceptable, where I created a .default directory with all the recipe files and then symlinked ./1.7 and ./2.0 to ./.default/?

github.com/robfrawley/recipes-contrib/tree/feature-include-version-1.x-and-2.x/liip/imagine-bundle

Is this a suitable strategy, or is there an alternative standard, or should the files simply be duplicated in each version folder?

@Pierstoval
Copy link
Contributor

Pierstoval commented May 6, 2017

@robfrawley Take example of the PHPUnit recipe: https://github.com/symfony/recipes/blob/master/phpunit/phpunit/4.7/manifest.json

You can specify other versions that are compatible with this recipe.

But if files change, you'll have to create a new directory with a new manifest

@robfrawley
Copy link
Contributor Author

@Pierstoval Oh, wonderful; I don't know how I missed that. Thanks!

@robfrawley robfrawley force-pushed the master branch 3 times, most recently from be14e01 to 8bb6d4b Compare May 7, 2017 22:11
@robfrawley
Copy link
Contributor Author

robfrawley commented May 7, 2017

Please do not merge until liip/LiipImagineBundle#925 is merged and the newest release version, that is compatible with this recipe, 1.8.0 (see liip/LiipImagineBundle/pull/928) is released; will update once we're ready to go on our end. Update: we're ready to go!

@fabpot
Copy link
Member

fabpot commented May 8, 2017

Bug fix, validation does not pass now because the 1.8 version does not exist yet, which is expected.

@robfrawley
Copy link
Contributor Author

@fabpot You were right; I had thought the composer configuration was global, not per project; thanks for the clarification on that. The new PR deployment page is great, BTW.

At this point, this looks good from our end. I was able to successfully test both version 1.8 and 2.0. Let me know if you require any additional changes.

@robfrawley robfrawley changed the title [WIP] Add Imagine Bundle Recipe Add Imagine Bundle Recipe May 11, 2017
@stof
Copy link
Member

stof commented May 12, 2017

@robfrawley extras are not global

symfony-bot
symfony-bot previously approved these changes May 12, 2017
@robfrawley
Copy link
Contributor Author

robfrawley commented May 12, 2017

Does anyone following this thread want to approve this (other than me) now that auto-merging is enabled? I love that the contrib repository is user-moderated now! See #21 for additional information.

@fabpot
Copy link
Member

fabpot commented May 12, 2017

@robfrawley I would prefer to be the one who will approve this PR, the rules are still changing a bit, so better to wait a bit :)

@robfrawley
Copy link
Contributor Author

robfrawley commented May 12, 2017

@fabpot Apologies; I misunderstood the updated README.rst and didn't realize the changes were still in "flux". No worries; take your time! We're all just excited for Flex!

@fabpot
Copy link
Member

fabpot commented May 13, 2017

@robfrawley I think everything is ready now. So, for that PR to be merged, a Symfony Core team member or a member of the Liip organization must approve the PR (the member must be publicly listed on the Liip organization).

@robfrawley
Copy link
Contributor Author

robfrawley commented May 13, 2017

@lsmith77 Care to approve this PR for our Symfony Flex recipe? Thanks @fabpot for all the hard work!

@robfrawley
Copy link
Contributor Author

Hm; thanks for giving that a try @Pierstoval 🥇


* <fg=blue;options=bold>Read</> <fg=blue>the documentation and</> <fg=blue;options=bold>ask</> <fg=blue>for help:</>
- Documentation: <comment>https://symfony.com/doc/current/bundles/LiipImagineBundle</>
- Issue Tracker: <comment>https://github.com/liip/LiipImagineBundle/issues</>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is way too long. It should not replace proper documentation. It should only be used to indicate the immediate next steps to make it work, if any.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brought it down from 18 to 10 lines: is that more appropriate?

"copy-from-recipe": {
"etc/": "%ETC_DIR%/"
},
"version_aliases": ["2.0"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsupported key "version_aliases"

symfony-bot
symfony-bot previously approved these changes May 23, 2017

* <fg=blue;options=bold>Read</> <fg=blue>the documentation and</> <fg=blue;options=bold>ask</> <fg=blue>for help:</>
- Documentation: <comment>https://symfony.com/doc/current/bundles/LiipImagineBundle</>
- Issue Tracker: <comment>https://github.com/liip/LiipImagineBundle/issues</>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last paragraph should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@symfony-bot symfony-bot merged commit 60e6d43 into symfony:master May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants