Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Retry delay: Update flag, vars and docs to clarify #87

Merged
merged 1 commit into from
Jul 11, 2020

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Jul 11, 2020

BACKSTORY

As I went to start work towards implementing email notification
support per GH-3, I was struck by how unclear the arguments to the
emailNotifier function (and similarly, the teamsNotifier function)
were. The difference between config.NotifyMgrEmailNotificationDelay
and cfg.EmailNotificationDelay() were not immediately clear and it
took longer than I'd like to admit to fully backtrack and confirm
not only the original intent, but the current behavior surrounding
those settings.

This commit attempts to clarify not only the original intent, but the
purpose behind each related portion of code surrounding what I now
understand to be handling the rate limit and notification retry
delay.

CHANGES

  • documentation

    • README.md
      • update "feature" entry to emphasize configurable retries, but
        hard-coded notifications rate limit (hopefully soon to change)
    • configure.md
      • updated description
      • updated command-line flag name
      • updated environment variable name
      • updated help text/description for flag
    • doc.go
      • explicitly note that it is the retry delay that is configurable
  • configuration file

    • rename delay to retry_delay
    • add missing doc comments for each msteams section setting
  • code

    • search/replace across codebase to replace Delay with RetryDelay

      • this includes renaming the Delay field for the MSTeams type,
        and its associated flag, environment variable and TOML config
        file setting
    • replace sendDelay parameter with sendRateLimit to better
      communicate what the incoming value to teamsNotifier and
      emailNotifier is intended for

    • doc comments

      • fixes to correct wrong information
      • fixes to better communicate the intent and real behavior

REFERENCES

BACKSTORY

As I went to start work towards implementing email notification
support per GH-3, I was struck by how unclear the arguments to the
`emailNotifier` function (and similarly, the `teamsNotifier` function)
were. The difference between `config.NotifyMgrEmailNotificationDelay`
and `cfg.EmailNotificationDelay()` were not immediately clear and it
took longer than I'd like to admit to fully backtrack and confirm
not only the original intent, but the current behavior surrounding
those settings.

This commit attempts to clarify not only the original intent, but
the purpose behind each related portion of code surrounding what
I now understand to be handling the rate limit and notification
retry delay.

CHANGES

- documentation
  - README.md
    - update "feature" entry to emphasize configurable retries, but
      hard-coded notifications rate limit (hopefully soon to change)
  - configure.md
    - updated description
    - updated command-line flag name
    - updated environment variable name
    - updated help text/description for flag
  - doc.go
    - explicitly note that it is the retry delay that is configurable

- configuration file
  - rename `delay` to `retry_delay`
  - add missing doc comments for each msteams section setting

- code
  - search/replace across codebase to replace `Delay` with `RetryDelay`
    - this includes renaming the `Delay` field for the `MSTeams` type,
      and its associated flag, environment variable and TOML config
      file setting
  - replace `sendDelay` parameter with `sendRateLimit` to better
    communicate what the incoming value to `teamsNotifier` and
    `emailNotifier` is intended for

  - doc comments
    - fixes to correct wrong information
    - fixes to better communicate the intent and real behavior

REFERENCES

- refs GH-85
@atc0005 atc0005 added documentation Improvements or additions to documentation enhancement New feature or request notification msteams config labels Jul 11, 2020
@atc0005 atc0005 added this to the v0.2.1 milestone Jul 11, 2020
@atc0005 atc0005 self-assigned this Jul 11, 2020
@atc0005 atc0005 merged commit 513aec5 into master Jul 11, 2020
@atc0005 atc0005 deleted the i85-notification-delay-explanation-tweaks branch July 11, 2020 10:22
atc0005 added a commit that referenced this pull request Jul 11, 2020
SUMMARY

As a follow-up to GH-87, this commit exposes a new setting that
allows directly configuring the rate limit used for Teams
notifications. GH-3 will be responsible for exposing the same
setting for email notifications.

CHANGES

- update documentation to note new setting
  - README
  - GoDoc
  - configure

- configuration file
  - new `rate_limit` setting

- code
  - remove rate limit constants in favor of external settings (email
    rate limit setting scheduled for GH-3) and default const value if
    not specified externally
  - new `TeamsNotificationRateLimit` getter func
  - new `EmailNotificationRateLimit` getter func
    - stub only; further work scheduled for GH-3

REFERENCES

refs GH-87, GH-85, GH-19, GH-3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
config documentation Improvements or additions to documentation enhancement New feature or request msteams notification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant