portkey

Portkey: from REPL to Serverless in one call
baptiste-from-paris 2018-07-08T13:28:21.000052Z

First successful request made with the query protocol 😄

1🦜
2018-07-08T15:32:01.000011Z

baptiste-from-paris 2018-07-08T15:33:25.000020Z

hello friends, So I’ve been working today on query protocol and requests (that I tried) are workgin

baptiste-from-paris 2018-07-08T15:34:22.000026Z

However there are two bugs: - I had to delete 0 arity function (I know how to solve this misconception but did not had the time)

baptiste-from-paris 2018-07-08T15:34:49.000073Z

- Error while generating 2 specs cloudformation & sns`

baptiste-from-paris 2018-07-08T15:35:57.000012Z

If you have some time @viesti (I know Christophe is on holidays), it would be awesome if you could test

baptiste-from-paris 2018-07-08T15:36:04.000080Z

it’s on the low-conform branch

baptiste-from-paris 2018-07-08T15:36:25.000030Z

here are the apis

baptiste-from-paris 2018-07-08T15:36:33.000057Z

#{"sdb" "sns" "elasticbeanstalk" "importexport" "email" "cloudsearch"
  "monitoring" "sts" "elasticloadbalancing" "elasticache" "redshift"
  "sqs" "elasticloadbalancingv2" "iam" "autoscaling" "rds"
  "cloudformation"}

viesti 2018-07-08T15:42:26.000016Z

might have a chance to look at it in the evening

viesti 2018-07-08T15:43:00.000063Z

was on holiday this week, next week at work and then 3 weeks on holiday

viesti 2018-07-08T16:28:38.000054Z

user=> (doc sns/list-topics)
-------------------------
portkey.aws.sns/list-topics
([] [list-topics-input])
  Returns a list of the requester's topics. Each call returns a limited list of
topics, up to 100. If there are more topics, a NextToken is also returned. Use
the NextToken parameter in a new ListTopics call to get further results.
Spec
  args: (? :portkey.aws.sns/list-topics-input)
  ret: (and :portkey.aws.sns/list-topics-response)
nil
user=> (sns/list-topics)
{:request-time 393, :repeatable? false, :protocol-version {:name "HTTP", :major 1, :minor 1}, :streaming? true, :chunked? false, :reason-phrase "OK", :headers {"x-amzn-RequestId" "f956b341-dab3-5905-8ee2-e0fde751a180", "Content-Type" "text/xml", "Content-Length" "404", "Date" "Sun, 08 Jul 2018 16:28:18 GMT", "Connection" "close"}, :orig-content-encoding nil, :status 200, :length 404, :body "&lt;ListTopicsResponse xmlns=\"<http://sns.amazonaws.com/doc/2010-03-31/\>"&gt;\n  &lt;ListTopicsResult&gt;\n    &lt;Topics&gt;\n      &lt;member&gt;\n        &lt;TopicArn&gt;arn:aws:sns:eu-west-1:262355063596:datomic-tiuhti-Compute-CS1UK5K6HXWP-dlq&lt;/TopicArn&gt;\n      &lt;/member&gt;\n    &lt;/Topics&gt;\n  &lt;/ListTopicsResult&gt;\n  &lt;ResponseMetadata&gt;\n    &lt;RequestId&gt;f956b341-dab3-5905-8ee2-e0fde751a180&lt;/RequestId&gt;\n  &lt;/ResponseMetadata&gt;\n&lt;/ListTopicsResponse&gt;\n", :trace-redirects []}

baptiste-from-paris 2018-07-08T16:29:21.000007Z

Yes cool

baptiste-from-paris 2018-07-08T16:29:44.000030Z

The post request are more hard to do but I checked every type

viesti 2018-07-08T16:31:14.000026Z

hum, is the ec2 protocol a variation of query?

viesti 2018-07-08T16:32:03.000051Z

and the body needs xml->edn

viesti 2018-07-08T16:32:15.000044Z

but huge progress 🙂

baptiste-from-paris 2018-07-08T16:36:20.000002Z

You have to share your emacs config

baptiste-from-paris 2018-07-08T16:36:25.000057Z

soo awesome

viesti 2018-07-08T16:36:29.000032Z

I don’t dare 😄

baptiste-from-paris 2018-07-08T16:36:37.000048Z

I am a 4 months emacs veteran ^^

baptiste-from-paris 2018-07-08T16:36:41.000031Z

But I love it

viesti 2018-07-08T16:37:00.000073Z

but luckily cider comes with spec browser that fits really nicely to the generated specs

baptiste-from-paris 2018-07-08T16:37:11.000022Z

I did not know that

baptiste-from-paris 2018-07-08T16:37:24.000048Z

and ec2 is a protocol in itself

baptiste-from-paris 2018-07-08T16:38:05.000052Z

also, I think it would be really helpful to write specs generator and put some in the doc

baptiste-from-paris 2018-07-08T16:38:18.000040Z

looking for documentation is painful today

viesti 2018-07-08T16:38:30.000001Z

did dare, might be dated and full of useless things, probably better to do package-list-packages and install cider 🙂 https://github.com/viesti/dotfiles/blob/master/.emacs

viesti 2018-07-08T16:40:32.000055Z

for amazon, have to first cut trail through marketing material, then to the technical docs

viesti 2018-07-08T16:41:19.000053Z

specs could use docstring support

viesti 2018-07-08T16:41:34.000044Z

I think Christophe had a stab at that direction

baptiste-from-paris 2018-07-08T16:41:38.000008Z

yes but we could write generators so that exercice works fully

viesti 2018-07-08T16:42:12.000026Z

yes, like for the SNS ARN in the above gif

baptiste-from-paris 2018-07-08T16:42:19.000056Z

for example

viesti 2018-07-08T16:42:23.000055Z

yup

viesti 2018-07-08T16:43:12.000024Z

sadly the json specs don’t go to that detail

baptiste-from-paris 2018-07-08T16:43:47.000049Z

it should be doable

baptiste-from-paris 2018-07-08T16:43:57.000058Z

but it’s not a priority

baptiste-from-paris 2018-07-08T16:45:46.000056Z

so ec2 and rest-xml should be almost the same

baptiste-from-paris 2018-07-08T16:46:10.000030Z

and then json has been done, I have to review it and put ther ser/req protocol

baptiste-from-paris 2018-07-08T16:46:21.000061Z

we could at least delete 100/200 lines of code

baptiste-from-paris 2018-07-08T16:46:31.000002Z

there are a lot of duplicates but it’s fine for now

baptiste-from-paris 2018-07-08T16:46:54.000028Z

also I think it would be best to split code into more files

viesti 2018-07-08T16:49:15.000045Z

yeah, have to figure out suitable blobs of dependencies

baptiste-from-paris 2018-07-08T16:50:17.000068Z

my opinion : 1) finish all protocol 2) then deser/resp 3) refactor / delete code 4) split into namespaces 5) cljs stuff 6) better docs 7) communicate

viesti 2018-07-08T16:55:21.000021Z

(interpose communicate-progress-or-ideas) also :)

baptiste-from-paris 2018-07-08T16:55:50.000034Z

lol, absolutely

baptiste-from-paris 2018-07-08T16:55:55.000083Z

I am not the very best for this

viesti 2018-07-08T17:59:03.000066Z

problem of all humanity, to transfer ideas of building things :)

viesti 2018-07-08T18:23:30.000036Z

but thinking out loud helps even