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 multiple endpoints support #87

Merged
merged 2 commits into from
Sep 19, 2016
Merged

Conversation

degemer
Copy link
Member

@degemer degemer commented Aug 17, 2016

It uses the new dogapi feature to do so.
Tests are failing because the new dogapi gem with multiple endpoints
support is not yet released.

@olivielpeau
Copy link
Member

Looks good! Let's make the tests pass once the new dogapi gem is released :)

I've found a couple of other places that'll need an update too:

@olivielpeau olivielpeau added this to the 0.10.0 milestone Aug 18, 2016
@olivielpeau
Copy link
Member

Also, let's not forget to update the version constraint on dogapi since we'll need the new version: https://github.com/DataDog/chef-handler-datadog/blob/master/chef-handler-datadog.gemspec#L17

@degemer degemer force-pushed the quentin/multiple-endpoints branch 3 times, most recently from b2922d9 to a910c47 Compare August 24, 2016 19:56
end

# If not enough app_keys compared to api_keys
if app_keys.nil? || app_keys.length != api_keys.length
Copy link
Member

Choose a reason for hiding this comment

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

Do you need to re-test if app_keys.nil? ? It would have failed above

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, nice catch.

@yannmh
Copy link
Member

yannmh commented Aug 25, 2016

Looks good to me, and well tested 💚 .

# Validate endpoints config (urls, api_keys and application keys)
# fails if incorrect and nothing can be done
# Doesn't fail if at least one endpoint can be used
def validate_extra_endpoints(urls, api_keys, app_keys)
Copy link
Member

Choose a reason for hiding this comment

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

naming nitpick: I'd prefer validate_endpoints since it doesn't apply only to the extra endpoints

Copy link
Member Author

Choose a reason for hiding this comment

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

😮 , leftover from the previous version

Copy link
Member

Choose a reason for hiding this comment

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

@degemer Looks like you forgot to rename this method

@olivielpeau
Copy link
Member

Let's merge this once the tests pass! 🎆

@olivielpeau
Copy link
Member

@degemer Could you also rebase the PR please?

All the other code changes that'll ship with the next minor release have been merged to master.

It uses the new dogapi feature to do so.
Tests are failing because the new dogapi gem with multiple endpoints
support is not yet released.
@degemer degemer force-pushed the quentin/multiple-endpoints branch 2 times, most recently from 9b4497b to 8d79aea Compare September 8, 2016 21:13
@degemer
Copy link
Member Author

degemer commented Sep 8, 2016

Yay, rebased, fixed the nits, finally ready to 🚀 ! Last review @olivielpeau ?

@olivielpeau
Copy link
Member

@degemer Let's rename validate_extra_endpoints, otherwise this looks ready to 🚢

@degemer
Copy link
Member Author

degemer commented Sep 9, 2016

Humpf, I know why I forgot it, but this is vexing. 🔥

dogs
end

def convert_to_array(value_or_array)
Copy link
Member

Choose a reason for hiding this comment

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

this is not used anymore, let's remove it :)

Copy link
Member Author

Choose a reason for hiding this comment

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

🔥

@olivielpeau
Copy link
Member

Had 2 more comments for your consideration, apart from that I think we're getting there :)

The handler handles the multiple endpoints issues, since it has all the
information.

Require dogapi >= 1.23.0 for the endpoint configuration.
@degemer
Copy link
Member Author

degemer commented Sep 13, 2016

Thanks for the review, updated the PR!

@olivielpeau
Copy link
Member

LGTM! Let's merge once DataDog/chef-datadog#317 is ready too

@olivielpeau olivielpeau merged commit a634b26 into master Sep 19, 2016
@olivielpeau olivielpeau deleted the quentin/multiple-endpoints branch September 19, 2016 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants