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

Clarify handling of empty payload input #291

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Nov 6, 2024

Changes

Make changes to clarify what happens when empty input is provided to encoded payload methods.

  • update doc comments and behavior of payload related methods to explicitly handle empty input vs using previous implicit behavior of underlying buffer field
    • (Plugin).AddPayloadBytes
    • (Plugin).AddPayloadString
    • (Plugin).SetPayloadBytes
    • (Plugin).SetPayloadString
  • add new tests to lock-in the intended behavior for empty input for those payload related methods
    • TestAddPayloadString_AppendsNothingWhenCalledWithEmptyInput
    • TestAddPayloadBytes_AppendsNothingWhenCalledWithEmptyInput
    • TestSetPayloadString_SetsInputSuccessfullyWhenCalledWithEmptyInput
    • TestSetPayloadBytes_SetsInputSuccessfullyWhenCalledWithEmptyInput

References

Make changes to clarify what happens when empty input is provided to
encoded payload methods.

- update doc comments and behavior of payload related methods to
  explicitly handle empty input vs using previous implicit behavior of
  underlying buffer field
  - `(Plugin).AddPayloadBytes`
  - `(Plugin).AddPayloadString`
  - `(Plugin).SetPayloadBytes`
  - `(Plugin).SetPayloadString`
- add new tests to lock-in the intended behavior for empty input for
  those payload related methods
  - `TestAddPayloadString_AppendsNothingWhenCalledWithEmptyInput`
  - `TestAddPayloadBytes_AppendsNothingWhenCalledWithEmptyInput`
  - `TestSetPayloadString_SetsInputSuccessfullyWhenCalledWithEmptyInput`
  - `TestSetPayloadBytes_SetsInputSuccessfullyWhenCalledWithEmptyInput`

refs GH-251
@atc0005 atc0005 added documentation Improvements or additions to documentation output/plugin plugin output intended for monitoring system ingest tests payload labels Nov 6, 2024
@atc0005 atc0005 added this to the v0.17.0 milestone Nov 6, 2024
@atc0005 atc0005 self-assigned this Nov 6, 2024
@atc0005 atc0005 merged commit de7347f into master Nov 6, 2024
31 checks passed
@atc0005 atc0005 deleted the i251-clarify-handling-of-empty-input branch November 6, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation output/plugin plugin output intended for monitoring system ingest payload tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant