Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Mapper package refactoring #216

Merged
merged 5 commits into from
Jan 22, 2018
Merged

Mapper package refactoring #216

merged 5 commits into from
Jan 22, 2018

Conversation

prymitive
Copy link
Contributor

To address comment from #207 some cleanups are needed, mostly around responsibilities of each sub-package, which this PR aims to resolve.
mapper is now a Alertmanager API response body -> unsee objects mapping code, which I think makes more sense, and it doesn't do any request handling anymore
transport was refactored to allow passing it to the Alertmanager instance (which we create for each AM upstream), so we no longer need to pass timeouts or tls.Config around.

This is 90% done, need to re-read changes here and likely cleanup a few things

@prymitive prymitive added this to the v0.9 milestone Jan 21, 2018
Mapper should only take input, decode it and map onto internal model instances
With this change we'll initialize Transport object for each Alertmanager and just call Read() on it when we need to use this transport to read from upstream Alertmanager
Fix bugs, add docstrings and let each mapper give us full url since it doesn't handle any http requests now (it just maps text to objects now)
@prymitive prymitive merged commit 90a517b into master Jan 22, 2018
@prymitive prymitive deleted the mapper-refactor branch January 22, 2018 19:39
prymitive added a commit that referenced this pull request Jan 25, 2018
Alertmanager 0.4.x silences endpoint uses pagination, code for this was incorrectly dropped in #216, re-add it. Requires a way for mapper packages to signal the need for passing query args to HTTP requests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants