profile
viewpoint

juampynr/syncdb 22

Import and export large Drupal databases faster using Drush

q0rban/drupal-coda-clips 9

Coda Clips for Drupal Development

q0rban/drupal-gittyup 6

Gittyup is a set of drush commands to update a Drupal install's git repo.

q0rban/drupal-follow 5

Add sitewide and per user follow links that link to various social networks.

q0rban/drupal-highslide 4

Drupal highslide module

q0rban/drupal-highslide-js 4

Highslide JS packaged separately for the highslide.module

q0rban/drupal-newsletter 3

A newsletter content type and custom template

q0rban/drupal-profiler 3

Profiler allows you to easily create new Drupal install profiles.

push eventtyphonius/acquia-php-sdk-v2

Adam Malone

commit sha 2990d10712ab1173741cf6f065a6c0662617e792

Removes pcov clobber from mutation testing.

view details

push time in 22 minutes

pull request commenttyphonius/acquia-php-sdk-v2

Adds PHP 8 to testing.

Codecov Report

Merging #113 (1f3f673) into master (9c82f28) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##              master      #113   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       238       238           
===========================================
  Files             82        82           
  Lines           1121      1148   +27     
===========================================
+ Hits            1121      1148   +27     
Impacted Files Coverage Δ Complexity Δ
src/Connector/Connector.php 100.00% <0.00%> (ø) 5.00% <0.00%> (ø%)
src/Response/IdesResponse.php 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Response/LogsResponse.php 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Response/TagsResponse.php 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Response/CronsResponse.php 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Response/RolesResponse.php 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Response/TeamsResponse.php 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Response/BackupsResponse.php 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Response/DomainsResponse.php 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Response/MembersResponse.php 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9c82f28...1f3f673. Read the comment docs.

typhonius

comment created time in an hour

push eventtyphonius/acquia-php-sdk-v2

Adam Malone

commit sha 1f3f6736e7bae740e76c2c84808be886cf98a8a0

Removes pcov clobber since we have updated to phpunit >= 7.

view details

push time in an hour

push eventtyphonius/acquia-php-sdk-v2

Adam Malone

commit sha 844ab4d93a92aa07645aa59a77244e335cec9fff

Removes 8.1 for now.

view details

push time in an hour

push eventtyphonius/acquia-php-sdk-v2

Adam Malone

commit sha f20292759f89cd0c3bee8d70ea996e8bdd3a5e1c

Updates dependencies.

view details

push time in an hour

pull request commenttyphonius/acquia-php-sdk-v2

Adds PHP 8 to testing.

Blocked by https://github.com/webmozart/path-util/pull/31

typhonius

comment created time in 2 hours

push eventtyphonius/acquia-php-sdk-v2

Adam Malone

commit sha be5575732c789c95b277d5bd3e91e67164b426d7

Updates phpunit.

view details

push time in 3 hours

PR opened typhonius/acquia-php-sdk-v2

Adds PHP 8 to testing.
+1 -1

0 comment

1 changed file

pr created time in 3 hours

create barnchtyphonius/acquia-php-sdk-v2

branch : php8

created branch time in 3 hours

startedgraphql-compose/graphql-compose

started time in 6 hours

startedgraphql-compose/graphql-compose-connection

started time in 6 hours

startedtaylorgoolsby/graphql-directive-connection

started time in 6 hours

startedconfuser/graphql-constraint-directive

started time in 6 hours

issue commenttyphonius/acquia-php-sdk-v2

Request linked resources directly from returned responses.

Commenting for myself later that it might be worth putting getLinkedResource on Client or in another trait.

eporama

comment created time in 18 hours

issue commenttyphonius/acquia-php-sdk-v2

Request linked resources directly from returned responses.

Ok, pretty mega restructure but I believe without any changes to end user code:

  • Created new CollectionResponse class which all collections will extend e.g. ApplicationsResponse, EnvironmentsResponse etc. CollectionResponse extends ArrayObject as collection classes did previously
  • Simplified all collection class constructors and moved the business logic into CollectionResponse
  • Created new LinkedResourceTrait trait which both GenericResponse and CollectionResponse use to get links
  • Passed more back from the trait so we have the response class which allows us to use self links
eporama

comment created time in 19 hours

push eventtyphonius/acquia-php-sdk-v2

Adam Malone

commit sha d835242aa807df47a5ca07bbe095f5441ea53112

Adds in CollectionResponse and trait for getting links.

view details

push time in 20 hours

issue commenttyphonius/acquia-php-sdk-v2

Request linked resources directly from returned responses.

One question (may be a separate issue) is how to refresh that notification so that you can loop until "completed"… We probably don't need it on a lot of objects, but notification is meant to change frequently, so having a method on the object to refresh or even to watch (doing the looping and discovery for you) would be the next step.

I think for the purposes of this library, implementing a watch/refresh function is probably best left to other packages extending it. The reason for this is that there will be a number of different configuration parameters that users may wish to alter for themselves e.g. how often to check a notification, how long to wait until a task is considered timed out, or if we even bother waiting for a response.

I feel like it would go beyond the scope of an SDK to determine how the user wishes to interact with the API beyond making requests and receiving responses. I'd be willing to reconsider if there's a reasonably simple, non-prescriptive way of doing it, but it feels more natural to keep it in a dependant library.

I've done similar in the logstream package for specifics around connecting to that service (this library just gets the logstream connection details) and in the cli package (which handles waiting for notifications). Code for that is below if you want to pinch it for acquia/cli or another package.

https://github.com/typhonius/acquia_cli/blob/master/src/Commands/AcquiaCommand.php#L152-L221

We adhere to the JSON HAL draft spec, so you can assume href will always contain the correct URL for a link, and all _links elements will have an href property.

It seems that the JSON HAL spec requires the href parameter so I'll put that back in. I've reread your message from earlier and realised that I misunderstood what you meant by the value being opaque - you didn't mean that the word 'href' could change but that the value itself could change. Since we're calling request() on the value stored in href, I think we're safe as I'm no longer trying to parse UUIDs from it. I'll also change back the code I had which specifically uses href.

The only weirdness you might run into is in parsing certain types of templated links, like the ones you see for pagination and filtering in collection responses. Those are designated with a "templated": true property:

I think your sample code below makes a lot of sense and will be relatively easy to implement, although I'll probably schedule that in a follow-up for this. We have access to $client when we're getting linked resources so it'll be a case of doing a $client->addOption('limit', 10) or similar from within the getLinkedResource function.

$limited_applications = $db->getLinkedResource($response->getLink('limit'), [
    'limit' => "limit=10",
]);

The self link is there to allow for API clients to "refresh" their view of a resource. In other words, something like this would be the expected way to poll the status of a notification:

I'll need to have a bit of a longer think about how I make this work as:

  • GenericResponse (and all child response classes) don't have access to the $client so can't make subsequent calls
  • CloudApiBase (and all child endpoint classes) don't have access to the returned response so can't tell what type of response we're working with

My thought for self was that I could get_class the response and use that to instantiate a new response of the same type. It's entirely possible that I'll need to rethink the architecture of this because at the moment getting linked resources is only available for single response objects rather than collections e.g. $application->get() but not $application->getAll(). The reason for this is that collections already extend ArrayObject because we use the functionality of that class to convert a number of returned results into a neat object of objects e.g. ApplicationsResponse containing many ApplicationResponse.

Ultimately however it would be beneficial to get linked resources from either though so I'll do some thinking of how I can alter things in a non-breaking way - perhaps this is where a trait would be useful...

eporama

comment created time in a day

push eventTugboatDemo/contenta

James Sansbury

commit sha 0e338976e4910bccbd2d3882ce8278da9312aed4

Add account details to .env.

view details

push time in a day

push eventTugboatDemo/contenta

James Sansbury

commit sha 0a0800d3df00a931af4d65edd41fff425ce2315e

Use Composer 1.

view details

push time in a day

create barnchTugboatDemo/contenta

branch : main

created branch time in a day

startedbrutusin/json-forms

started time in a day

startedduzyn/tufte-markdown

started time in a day

startedtmeasday/create-graphql-server

started time in a day

fork jmolivas/create-graphql-server

Generate your GraphQL server one type at a time

fork in a day

startedAzgaar/Fantasy-Map-Generator

started time in a day

issue commenttyphonius/acquia-php-sdk-v2

Request linked resources directly from returned responses.

The self link is there to allow for API clients to "refresh" their view of a resource:

$notification = $db_backups->getLinkedResource($notification->getLink('self'));
eporama

comment created time in a day

startedduzyn/iA-Writer-Template-Tufte

started time in a day

issue commenttyphonius/acquia-php-sdk-v2

Request linked resources directly from returned responses.

Okays, so this makes sense to get the notification object.

$notification = $db_backups->getLinkedResource($backup->getLink('notification'));

One question (may be a separate issue) is how to refresh that notification so that you can loop until "completed"… We probably don't need it on a lot of objects, but notification is meant to change frequently, so having a method on the object to refresh or even to watch (doing the looping and discovery for you) would be the next step.

eporama

comment created time in a day

issue commenttyphonius/acquia-php-sdk-v2

Request linked resources directly from returned responses.

We adhere to the [JSON HAL draft spec(https://tools.ietf.org/id/draft-kelly-json-hal-01.html#rfc.section.5), so you can assume href will always contain the correct URL for a link, and all _links elements will have an href property.

The only weirdness you might run into is in parsing certain types of templated links, like the ones you see for pagination and filtering in collection responses. Those are designated with a "templated": true property:

  "_links": {
    "self": {
      "href": "https://cloud.acquia.com/api/applications?limit=10"
    },
    "sort": {
      "href": "https://cloud.acquia.com/api/applications{?sort}",
      "templated": true
    },
    "filter": {
      "href": "https://cloud.acquia.com/api/applications{?filter}",
      "templated": true
    },
    "limit": {
      "href": "https://cloud.acquia.com/api/applications{?limit}",
      "templated": true
    },
    "parent": {
      "href": "https://cloud.acquia.com/api/"
    }
  },

It may be worth supporting those as an optional parameter:

// Retrieves https://cloud.acquia.com/api/applications?limit=10
$limited_applications = $db->getLinkedResource($response->getLink('limit'), [
    'limit' => "limit=10",
]);

// Retrieves https://cloud.acquia.com/api/applications
$limited_applications = $db->getLinkedResource($response->getLink('limit'));

Though it gets tricky because this would be a case where the link name doesn't tell you the correct response. Now that I think of it, there's a number of link names that are contextual in what they return:

  • self: same as original response
  • parent: 100% contextual, no way to know (I'll bring this back to the team to see if we can come up with something here for discovery)
  • sort: same type of collection as original response
  • limit: same type of collection as original response
  • filter: same type of collection as original response
  • next: same type of collection as original response
  • previous: same type of collection as original response
eporama

comment created time in 2 days

created repositorynerdhaus/eleventufte

"An Edward Tufte flavored starter kit for Eleventy

created time in 2 days

more