Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have 2 libraries sypc and mimeparse which should not be in repo really. Adds an install check and removes the files. Note I believe this will break the bot on d.o......
This also means we don't have to update them
Comment | File | Size | Author |
---|---|---|---|
#78 | 1325572-libraries-integration-76.diff | 5.01 KB | heshanlk |
#71 | local-test-run.png | 16.38 KB | mradcliffe |
#69 | 1325572-services-with-the-libraries-69.patch | 5.1 KB | mradcliffe |
#65 | 1325572-services-with-the-libraries-63-do-not-test.diff | 4.33 KB | heshanlk |
#63 | 1325572-services-with-the-libraries-63.diff | 4.33 KB | heshanlk |
Comments
Comment #2
marcingy CreditAttribution: marcingy commentedComment #4
ygerasimov CreditAttribution: ygerasimov commentedI don't like the idea of removing these libraries. It will break the bot that we really don't like to do. In the next version of services we hopefully would be able to avoid these libraries by using Symfony components.
Moving the issue to postponed.
Comment #5
marcingy CreditAttribution: marcingy commentedThe point is more I don't believe these libraries should even be in the drupal repo - see http://drupal.org/node/422996
Comment #6
kylebrowning CreditAttribution: kylebrowning commentedIm kind of the same opinion. We just got our bot working and now its going to break again plus add an extra step to the install process.
I really don't mind continuing to apply patches for updates to these libraries, but I understand its a drupal rule to not put them in there.
Comment #7
marcingy CreditAttribution: marcingy commentedI agree it will be sad the bot won't work but given that we seem to be in violation of the rules for third party libraries I don't think we have any option
* had to be modified to work with Drupal and the modifications were not accepted by the original author. - I don't believe this is the case
* is generally difficult to find in the needed version. - Not at all links provided in the patch
* is no longer maintained by the original author. - The code seems to be maintained spyc certainly is.
Comment #8
ygerasimov CreditAttribution: ygerasimov commentedIf we decide to remove libraries we should have proper documentation in README.txt file.
@marcingy could you please add chapter for installation notes there.
Comment #9
marcingy CreditAttribution: marcingy commentedBefore I do that do we have agreement that we are taking them out - because if there is no agreement I am not going to waste my time adding info to a readme file ;)
Comment #10
marcingy CreditAttribution: marcingy commentedPatch with install instructions
Comment #11
kylebrowning CreditAttribution: kylebrowning commentedLooks great!
Comment #12
marcingy CreditAttribution: marcingy commentedComment #13
kevin.dutra CreditAttribution: kevin.dutra commentedFWIW, I'd suggest that those libraries be installed (and looked for) under sites/all/libraries rather than in a directory in the module. This avoids the hassle of having to replace the libraries every time a module update is installed. ...Maybe even directly integrate with the LibrariesAPI (http://drupal.org/project/libraries).
Comment #14
kylebrowning CreditAttribution: kylebrowning commentedI noticed this today as well, and I tend to agree.
Patches welcome!
Comment #15
marcingy CreditAttribution: marcingy commentedNo issue with me if we look to use the libraries project, yes it is an additional dependency but it makes logic sense because we are dealing with libraries after all.
Comment #17
dandirks CreditAttribution: dandirks commentedHere is a patch that adds Libraries API support for the YAML parser. Patch applies to D6 services 3.1.
Users will need to download spyc from http://code.google.com/p/spyc/downloads/list and put it in their sites/all/libraries/spyc folder.
Comment #18
dandirks CreditAttribution: dandirks commentedComment #19
kylebrowning CreditAttribution: kylebrowning commentedDoes libraries give the ability to require a dependency when certain conditions are met?
Do we need to remove the hook_requirments for the spyc library?
Also of note, the spyc is only needed for YAML so Id like to see this stuff only required when application/yaml response format is enabled in the Server Settings of the endpoint.
Comment #20
marcingy CreditAttribution: marcingy commentedThis also needs to be against d7 as we backport from there.
Comment #21
rypit CreditAttribution: rypit commentedI think the best approach is probably to use libraries api if it exists for all 3rd party libraries -- falling back to a hard coded or configurable location if it does not, and to keep all dependency checks in hook_requirements.
Comment #22
jobeirne CreditAttribution: jobeirne commentedAttached is a patch that decouples spyc (and, for that matter, YAML) from rest_server. The patch looks in both the libraries location and the old location (lib/spyc); if it detects spyc in either location, it uses that. If it doesn't detect spyc, it removes YAML from the rest_server options cleanly.
This introduces a new dependency on libraries to rest_server. I think this is a preferable trade-off since we are no longer hard-wiring a dependency on spyc.
I'm attaching one patch that is
git apply
-able. The other ("spyc-decoupling-makeable-1325572-22.patch") works with Drush make. I have tested this patch for all cases described above.Comment #23
kylebrowning CreditAttribution: kylebrowning commentedomg jobeirne++++
It would be nice if this came with tests that verify things work with YAML
And after that id say commit and port to 6.x
Comment #24
jobeirne CreditAttribution: jobeirne commentedWill do. Can I get commit access to add tests/update README, etc? I have plans to library-ize the rest of the dependencies as well.
Comment #25
kylebrowning CreditAttribution: kylebrowning commentedYou shouldn't need commit access to provide a patch just as you have done.
Comment #26
jobeirne CreditAttribution: jobeirne commentedNo problem, so long as the commits are attributed properly.
Comment #27
marcingy CreditAttribution: marcingy commentedCan we have this all on one line rather than randomly split between 3 lines
An extra space has been introduced
The doxygen should describe what a function does this does not
Also this does not meet drupal coding standards.
Comment #28
jobeirne CreditAttribution: jobeirne commented> multi-line string
Drupal standards indicate 80col should be respected. The string was broken up to accomodate this.
> extra space
Oops.
> insufficient doxygen
The @return line pretty clearly indicates exactly what the function does. I'm not sure what else to tell you. As a side note, you should probably look into semi-colons and other forms of punctuation.
> "drupal coding standards"
I'm not sure how the body of that function "doesn't meet Drupal coding standards." Could you elaborate?
Comment #29
marcingy CreditAttribution: marcingy commentedThe hard 80 column limit is only for doxygen and comments.
Internal function does not describe what it does, ther should a single line (under 80 characters) that provides a description of what the function does. @return should not be used for doing this.
With regards code standards please read http://drupal.org/coding-standards#controlstruct
Comment #30
jobeirne CreditAttribution: jobeirne commentedFrom the link you posted above:
There are no exceptions listed for strings or function calls that I have found.
As far as the control structures qualm, the standard does not mandate but only "strongly recommend[s]" braces.
Enjoy the patch.
Comment #31
marcingy CreditAttribution: marcingy commentedSo the patch is not going to be committed as it stands plan and simple, and given your comments above that makes this a won't fix.
Comment #32
marcingy CreditAttribution: marcingy commentedTo note the 80 character standards we introduced after drupal 7 was released - coding standards are not backwards comptable. Also core (in d8) continues to ignore the 80 character limit especially in areas such as t() and watchdog() the key is readability, hence the 'general' comment. In a similar way control structures also use {} for readability and to prevent breakages happening when code is amended.
Comment #33
jobeirne CreditAttribution: jobeirne commentedAlright, your changes have been made. Again, it'd be really nice if a non-patched Services could be used with programmatic builds. This patch allows that to happen.
Comment #34
marcingy CreditAttribution: marcingy commentedThank for that - I'm happy with patch now, there are some minor code layout issues but I'll tidy those up when I do the commit rather than bikesheding the issue. @kylebrowning could the tests be a follow up? Or maybe we could ask @cotto to test as I know he uses yaml.
Comment #35
RobLoachJust a note that lots has been going on in the Libraries API 2.x branch. Might be good to expose the yaml formatter in a separate module via
rest_server_response_formatters_alter()
.Comment #36
stovak CreditAttribution: stovak commentedgetting this error with the patch installed when turning on REST server.
If the rest server is not activated, you need to do a "module_load_include" or something to make sure the .module file is available to provide the function.
Comment #37
jobeirne CreditAttribution: jobeirne commentedAh, that's a big one. :)
I'll fix and re-roll.
Comment #38
jobeirne CreditAttribution: jobeirne commentedFixed. I tested an install on a clean instance of 7.
Comment #39
kylebrowning CreditAttribution: kylebrowning commentedIm fine with the tests as a later patch. this patch looks good to me and can be attributed to jobeirne with --author="jobeirne "
Comment #40
kylebrowning CreditAttribution: kylebrowning commentedComment #41
kylebrowning CreditAttribution: kylebrowning commentedI dont understand the differences between the patches though, which one would you like committed, also can you provide a 6.x patch as well?
Comment #42
jobeirne CreditAttribution: jobeirne commentedGood news. One patch is apply-able with drush make, one is apply-able with git's apply. I don't know 6.x very well --- all of my dev experience is in 7; if lacking a 6.x patch is a deal-breaker, I can look into it.
Comment #43
RobLoachAlthough I don't want to bike-shed the issue, I just wanted to point out that Drupal 8 is adopting some parts of Symfony. Considering that, it might be a good idea to switch over to Symfony YAML sometime. I've been putting some time into the Symfony module if you want to add some support for it in there itself.
Comment #44
kylebrowning CreditAttribution: kylebrowning commentedYeah Drupal 8 services is going to be an entirely different thing with the wscci and all most of this probably won't matter to us at that point and services will just be a REST provider of some sort.
Comment #45
MrMaksimize CreditAttribution: MrMaksimize commentedHey Guys,
Not sure what the current status is here. Currently the 7.x-3.1 tag does not include the spyc.php library, and downloading it into libraries does nothing and still breaks the install. The patches seem to fail too.
Thanks!!
Comment #46
MrMaksimize CreditAttribution: MrMaksimize commentedOh wait never mind, saw the message on the project page. Sorry about that :)
Comment #47
BassistJimmyJam CreditAttribution: BassistJimmyJam commentedIf this module is being installed before the libraries modules has actually been enabled (such as from an installation profile) then libraries_get_path() will not be available when rest_server_requirements() is actually installed. I added a module_load_include() to rest_server_requirements() to ensure the function is available.
Comment #48
marcingy CreditAttribution: marcingy commentedThis needs to be ported to d6 but is committed to d7. Thanks to everyone involved.
Comment #49
marcingy CreditAttribution: marcingy commentedComment #50
jobeirne CreditAttribution: jobeirne commentedThe commit is appreciated, but in the future it'd be nice if you used proper attribution for the commit ("--author=...").
Comment #51
marcingy CreditAttribution: marcingy commentedServices use the approach of attribution as detailed in this issue which is the drupal standard - http://drupal.org/node/52287, comma seperated list of all those involved. Until the standard is use the --author this project will not do that.
Comment #52
kylebrowning CreditAttribution: kylebrowning commentedAs an aside, i always apply git format-patch patches which include the author http://drupal.org/node/1146430
Comment #53
glennpratt CreditAttribution: glennpratt commentedThis patch seemed to apply to Git and tarball, so I skipped the makeable trend going in this thread.
Comment #54
kylebrowning CreditAttribution: kylebrowning commentedlooks good.
Comment #55
kylebrowning CreditAttribution: kylebrowning commentedComment #56
kylebrowning CreditAttribution: kylebrowning commentedFixed thanks guys!!!
Comment #58
heshanlkHere is some recommended way to use Libraries module for Services module. This is against 7.x-3.x branch.
Comment #60
marcingy CreditAttribution: marcingy commentedThis is already in d7
Comment #61
heshanlkThe way it #58 currently implemented is the standard usage of the Libraries module, it should implement the
hook_libraries_info()
to compatible with the other library functionality like drush libraries and all the other. This patch may does the same but in proper way withhook_libraries_info()
. Worth reviewing so changing to need review.Comment #62
marcingy CreditAttribution: marcingy commentedOk that makes sense. The patch has a number of style issues with tabs being used insteda of spaces and obviously there is the problem with failing tests, but what the patch is doing conceptually looks good.
Comment #63
heshanlkStyles issues has been fixed.
Comment #65
heshanlkWith do not test flag, since MySQL failed.
Comment #66
heshanlkComment #67
kylebrowning CreditAttribution: kylebrowning commentedAre tests currently failing? Why is this patch failing?
Comment #68
marcingy CreditAttribution: marcingy commentedTests are failing but the only 6 failures seem to be occuring not 165 as here
Comment #69
mradcliffeThe patch fails due to undefined function call because it was removed. It looks like the calls to the function should be removed and are not used anymore.
Let's see how it likes this.
Comment #71
mradcliffeDo we have another test that can't pass pifr-only? :(
Comment #72
mradcliffeI still only get 6 fails in another issue. Hmm...
Comment #73
kylebrowning CreditAttribution: kylebrowning commented#69: 1325572-services-with-the-libraries-69.patch queued for re-testing.
Comment #74
kylebrowning CreditAttribution: kylebrowning commented#69: 1325572-services-with-the-libraries-69.patch queued for re-testing.
Comment #76
heshanlk#63: 1325572-services-with-the-libraries-63.diff queued for re-testing.
Comment #77
kylebrowning CreditAttribution: kylebrowning commentedITs failing because it doesnt apply cleanly.
Comment #78
heshanlkHere is the new patch.
Comment #79
kylebrowning CreditAttribution: kylebrowning commentedComment #80
incaic CreditAttribution: incaic commentedThink there's a typo in rest_server.install.
change
to
so that the error message is shown only when spyc is not loaded?
Comment #81
heshanlkGood call.
Comment #82
kylebrowning CreditAttribution: kylebrowning commentedComment #84
rszrama CreditAttribution: rszrama commentedIs it just me or was this change never actually documented? I can't see any mention of it in the README.txt, docs, or project page.
Comment #85
mradcliffeIt was in the 3.1 release notes, but it was hard to notice.
Comment #86
rszrama CreditAttribution: rszrama commentedI just reviewed the release notes again, and I still don't see it though I'm sure it's in an issue title or something.
For such a huge change, it would be good to provide information at the top of the release notes above the changelog indicating an API change has taken place. See for example how I outline major changes in Commerce release notes: http://drupal.org/node/1819278 (including the note about the Drupal >= 7.15 dependency)
I really think the project page should be updated to include mention of the dependency on Libraries. And anywhere that you talk about downloading Spyc.php to the REST server module's lib folder, should that not be replaced with a mention of the sites/all/libraries/spyc directory? Or perhaps I don't even know what Spyc.php is for, because I put it in the libraries directory and haven't had any problems yet.
Additionally, the project page should be updated to remove the outdated reference to http://drupal.org/node/1313976.
I'd really like to standardize on the Services module for sites needing to build Drupal Commerce REST web services, but I'm wondering if I should be more involved to ensure the product documentation and maintenance is more complete / stable for our end users. It would be disappointing to recommend a solution that might sneak API changes / dependencies into minor releases every now and then. : P
Would you like me to reopen this issue or perhaps post a follow-up for documentation?
Comment #87
rszrama CreditAttribution: rszrama commentedAnother big API change came in #1154420: Readd support for rich options for resources - needed by auth mechanism that I completely missed, with the addition of an "operations" array as a wrapper around resource callbacks that wasn't there before. Ostensibly this is backwards compatible, because my test server never broke, but something like this should be declared in big letters at the top of a release. (Or better yet, relegated to a new branch of development.)
Comment #88
kylebrowning CreditAttribution: kylebrowning commentedId open a new task for documentation.
Ill make betty release notes in the future documenting changes like this.
THe operations array will fallback on the original api version and that documentation exists here http://drupalcode.org/project/services.git/blob/refs/heads/7.x-3.x:/serv...
Libraries is only required for YAML response format to work.
Comment #89
rszrama CreditAttribution: rszrama commentedlol Ok, then I've been worried about it for nothing. Doing all my work with JSON. : P
Comment #90
rszrama CreditAttribution: rszrama commentedOk, I see now the #api_version key, but I don't see anywhere where the differences in API versions are documented. Additionally, the docs do simply state that an operations array is required without any indication that the default API version in the absence of an #api_version parameter means that the operations array is not required.
I don't really think it's a great idea to have one hook with multiple response formats, but if you're going to do that, perhaps you should include two different doc blocks representing the format for the different versions of the API? Or at least some sort of inline notation about the differences.