socketry / cloudflare

An asynchronous Ruby wrapper for the CloudFlare V4 API.
MIT License
139 stars 88 forks source link

Support for the custom hostnames endpoint (local) #47

Closed ioquatix closed 5 years ago

ioquatix commented 5 years ago

Local copy of https://github.com/socketry/cloudflare/pull/45

ioquatix commented 5 years ago

@rdubya do you mind getting this working on this branch?

It should be running on local CI with my limited free account. I've emailed Cloudflare again and they said they will give me pro account or something. It's taking a long time. Turn around time is very poor.

Anyway.... from travis:

There was an error in the .travis.yml file from which we could not recover.
Environment variables definition is incorrect.
Please review https://docs.travis-ci.com/user/environment-variables, or contact us at support@travis-ci.com with the error ID: 6ea908c226154289b152a7e7ee64aff6

Did you change travis config with your own credentials?

rdubya commented 5 years ago

Thanks for the invite! Sure, I'll try to get this fixed up today.

rdubya commented 5 years ago

@ioquatix I got the tests all passing, there is still a failure in the one test because either something didn't get cleaned up correctly or the random values aren't random enough. I'll take a look at it next week unless you have an idea of how to fix it.

ioquatix commented 5 years ago

That's awesome.

I've received some feedback from Cloudflare:

The Pro plan doesn't connect to an account (test(at)oriontransfer.net), it connects to a zone/domain (oriontransfer.net). I know you are spinning up multiple websites on the account, such as cat.com and dog.com, to test concurrently, but maybe you could have one domain for some of the pro/waf testing and do other free level stuff on the throwaway domains

So, I'm thinking we need to adjust the tests a little bit.

The reason why the tests use different zones is because otherwise they clobber each other - e.g. two instances on travis trying to create and remove the same DNS entry.

We could probably use a shared zone... but we need to be more careful with the records we add and remove so that specs don't clobber each other.

rdubya commented 5 years ago

@ioquatix It looks like I got the tests cleaned up. I think changing the core of how the tests happen should probably be done in a separate ticket. I did some work towards that with the KV store endpoint stuff that I updated, so it may be easier once that is all in.

ioquatix commented 5 years ago

I am going to merge this and along with the next PR, I will them review all changes together before releasing a new version.

ioquatix commented 5 years ago

Released in v4.1.0

rdubya commented 5 years ago

Awesome, thanks!