Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Refactor logging, flag handling #27

Closed
3 tasks
atc0005 opened this issue Apr 12, 2020 · 0 comments · Fixed by #31
Closed
3 tasks

Refactor logging, flag handling #27

atc0005 opened this issue Apr 12, 2020 · 0 comments · Fixed by #31
Assignees
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Apr 12, 2020

A minor refactoring to mirror what I've done with the atc0005/dnsc project:

  • small function to handle applying logging settings within the config subpackage instead of in main
  • small function to handle flags instead of including directly within the NewConfig() factory function
  • move hard-coded flag help text to constants block

I've already worked the first two into a prototype branch I'm working with, but I do not plan to merge that branch as-is to master; I'll need to port relevant portions of changes as separate Pull Requests, these changes included.

@atc0005 atc0005 added this to the v0.4.0 milestone Apr 12, 2020
@atc0005 atc0005 self-assigned this Apr 12, 2020
atc0005 added a commit that referenced this issue Apr 23, 2020
ADDED

- Add support for Microsoft Teams notifications
  - configurable retry, retry delay settings
  - rate-limited submissions to help prevent unintentional
    abuse of remote API
    - currently hard-coded, but will likely expose this as
      a flag in a future release

- Add monitoring/reporting of notification channels with pending items

- Add monitoring/reporting of notification statistics
  - total
  - pending
  - success
  - failure

- Capture `Ctrl+C` and attempt graceful shutdown

- Plumbed `context` throughout majority of application for
  cancellation and timeout functionality
  - still learning proper use of this package, so likely
    many mistakes that will need to be fixed in a future release

- Logging
  - add *many* more debug statements to help with troubleshooting

CHANGED

- Dependencies
  - Use `atc0005/go-teams-notify` package
    - fork of original package with current features and
      some additional changes not yet accepted upstream
  - Use `atc0005/send2teams` package
    - provides wrapper for upstream functionality with message
      retry, delayfunctionality
    - provides formatting helper functions
    - provides additional webhook URL validation
  - Drop indirect dependency
  - Update `golang/gddo`
  - Add commented entries to have Go use local copies of
    packages for fast prototyping work

FIXED

- GoDoc formatting
  - remove forced line-wrap which resulted in unintentional
    code block formatting of non-code content

- Refactor logging, flag handling
  - not user visible, so not recording as a "change"

- Manually flush `http.ResponseWriter` to (massively) speed up
  response time for client requests

- Move template parsing to `main()` in an effort to speed up
  endpoint response time for client requests

REFERENCES

- refs #19
  - partial work; stubbed out

- refs #21
- refs #26
- refs #27
- refs #28
atc0005 added a commit that referenced this issue Apr 23, 2020
ADDED

- Add support for Microsoft Teams notifications
  - configurable retry, retry delay settings
  - rate-limited submissions to help prevent unintentional
    abuse of remote API
    - currently hard-coded, but will likely expose this as
      a flag in a future release

- Add monitoring/reporting of notification channels with pending items

- Add monitoring/reporting of notification statistics
  - total
  - pending
  - success
  - failure

- Capture `Ctrl+C` and attempt graceful shutdown

- Plumbed `context` throughout majority of application for
  cancellation and timeout functionality
  - still learning proper use of this package, so likely
    many mistakes that will need to be fixed in a future release

- Logging
  - add *many* more debug statements to help with troubleshooting

CHANGED

- Dependencies
  - Use `atc0005/go-teams-notify` package
    - fork of original package with current features and
      some additional changes not yet accepted upstream
  - Use `atc0005/send2teams` package
    - provides wrapper for upstream functionality with message
      retry, delayfunctionality
    - provides formatting helper functions
    - provides additional webhook URL validation
  - Drop indirect dependency
  - Update `golang/gddo`
  - Add commented entries to have Go use local copies of
    packages for fast prototyping work

FIXED

- GoDoc formatting
  - remove forced line-wrap which resulted in unintentional
    code block formatting of non-code content

- Refactor logging, flag handling
  - not user visible, so not recording as a "change"

- Manually flush `http.ResponseWriter` to (massively) speed up
  response time for client requests

- Move template parsing to `main()` in an effort to speed up
  endpoint response time for client requests

REFERENCES

- refs #19
  - partial work; stubbed out

- refs #21
- refs #26
- refs #27
- refs #28
atc0005 added a commit that referenced this issue Apr 23, 2020
ADDED

- Add support for Microsoft Teams notifications
  - configurable retry, retry delay settings
  - rate-limited submissions to help prevent unintentional
    abuse of remote API
    - currently hard-coded, but will likely expose this as
      a flag in a future release

- Add monitoring/reporting of notification channels with pending items

- Add monitoring/reporting of notification statistics
  - total
  - pending
  - success
  - failure

- Capture `Ctrl+C` and attempt graceful shutdown

- Plumbed `context` throughout majority of application for
  cancellation and timeout functionality
  - still learning proper use of this package, so likely
    many mistakes that will need to be fixed in a future release

- Logging
  - add *many* more debug statements to help with troubleshooting

- Documentation
  - GoDoc coverage for new features
  - README update to give example of Teams coverage

CHANGED

- Dependencies
  - Use `atc0005/go-teams-notify` package
    - fork of original package with current features and
      some additional changes not yet accepted upstream
  - Use `atc0005/send2teams` package
    - provides wrapper for upstream functionality with message
      retry, delayfunctionality
    - provides formatting helper functions
    - provides additional webhook URL validation
  - Drop indirect dependency
  - Update `golang/gddo`
  - Add commented entries to have Go use local copies of
    packages for fast prototyping work

FIXED

- GoDoc formatting
  - remove forced line-wrap which resulted in unintentional
    code block formatting of non-code content

- Refactor logging, flag handling
  - not user visible, so not recording as a "change"

- Manually flush `http.ResponseWriter` to (massively) speed up
  response time for client requests

- Move template parsing to `main()` in an effort to speed up
  endpoint response time for client requests

REFERENCES

- refs #19
  - partial work; stubbed out

- refs #21
- refs #26
- refs #27
- refs #28

WIP: Update README example, add example teams submission screenshot
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant