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

is this lib compatible with HipChat enterprise? #22

Closed
pedrorijo91 opened this issue Jul 24, 2017 · 4 comments
Closed

is this lib compatible with HipChat enterprise? #22

pedrorijo91 opened this issue Jul 24, 2017 · 4 comments

Comments

@pedrorijo91
Copy link
Contributor

Hipchat provides a self hosted version (https://www.hipchat.com/data-center).

I'm still not sure if Hipchat enterprise maintains the same API (I would expect so).

From what I've seen (at https://github.com/poweld/hipchat-scala/search?utf8=%E2%9C%93&q=api-url&type=) it should be possible to use this lib with Hipchat enterprise/self-hosted. If so, this use case could be covered on the README file

@pedrorijo91
Copy link
Contributor Author

It is possible (and easy) to override the default api-url by adding the config to an application.conf file as stated at https://www.playframework.com/documentation/2.4.x/ProductionConfiguration#General-configuration

unfortunately this is not practical if we want to have "clients" for different instances in the same application.

I could do a PR which would allow to pass a base url explicitly, for instance something like:

class RoomNotifier(private[this] val apiToken: String, baseUrlOpt: Option[String] = None)(implicit executor: ExecutionContext) extends Logging {

  (...)

}

object RoomNotifier {
  val instanceUrl = baseUrlOpt.map(Common.url)
  private def url(roomIdOrName: String) = (instanceUrl.getOrElse(apiUrl) / "room" / roomIdOrName / "notification").POST
}

Let me know your thoughts about this

@pedrorijo91
Copy link
Contributor Author

Proof of Concept here: master...pedrorijo91:feature/customApiURL

Still need to test it, and there are probably some minor improvements to be done, and maybe other code style issues you'd prefer different. I will have a better look at my code tomorrow before doing a PR. In the meanwhile let me know if you find something you disagree :)

@poweld
Copy link
Owner

poweld commented Jul 25, 2017

This sounds like a good addition. I can't promise to review it until the weekend, so take your time with the PR. It looks like you're on a good track in your proof of concept.

@pedrorijo91
Copy link
Contributor Author

thanks for the heads up @poweld. I did the PR #23 this morning, let me know your thoughts when you find the time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants