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

Allow setting user agent, fallback to project-specific default value #134

Closed
atc0005 opened this issue Feb 7, 2022 · 1 comment · Fixed by #143 or #155
Closed

Allow setting user agent, fallback to project-specific default value #134

atc0005 opened this issue Feb 7, 2022 · 1 comment · Fixed by #143 or #155
Assignees
Labels
config documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Feb 7, 2022

Overview

Instead of submitting HTTP requests with the Go default user agent of Go-http-client/1.1, set a project-specific default value. Ideally it would reflect the specific release version of the project (e.g., v2.6.0), but for simplicity it is probably worth specifying a major version instead.

For example, perhaps use the major.minor version number to indicate when this fork first diverged from the upstream project: go-teams-notify/2.2

Additionally, add support for changing this project-specific default value from client code.

References

@atc0005 atc0005 added documentation Improvements or additions to documentation enhancement New feature or request config labels Feb 7, 2022
@atc0005 atc0005 added this to the Future milestone Feb 7, 2022
@atc0005 atc0005 self-assigned this Feb 7, 2022
@atc0005 atc0005 changed the title Override default user agent with project-specific value Allow setting user agent, fallback to project-specific default value Feb 7, 2022
@atc0005 atc0005 modified the milestones: Future, Next Release Feb 8, 2022
atc0005 added a commit that referenced this issue Feb 8, 2022
- Apply project-speciifc default user agent to override the
  Go default of `Go-http-client/1.1`
  - set version based on when this project first diverged from
    the parent project
- Offer override for client code

refs GH-134
atc0005 added a commit that referenced this issue Feb 8, 2022
- Apply project-speciifc default user agent to override the
  Go default of `Go-http-client/1.1`
  - set version based on when this project first diverged from
    the parent project
- Offer override for client code
- Add brief example to illustrate setting custom user agent

refs GH-134
atc0005 added a commit that referenced this issue Feb 25, 2022
OVERVIEW

- Revert "Allow overriding default http.Client"
- Revert "Set project-specific user agent, offer override"

REFERENCES

- 884e59f
- 26ac7b4
- GH-134
- GH-135
- GH-139
atc0005 added a commit that referenced this issue Feb 25, 2022
OVERVIEW

- Revert "Allow overriding default http.Client"
- Revert "Set project-specific user agent, offer override"

REFERENCES

- 884e59f
- 26ac7b4
- GH-134
- GH-135
- GH-139
atc0005 added a commit that referenced this issue Feb 25, 2022
OVERVIEW

- Revert "Allow overriding default http.Client"
- Revert "Set project-specific user agent, offer override"

REFERENCES

- 884e59f
- 26ac7b4
- GH-134
- GH-135
- GH-149
@atc0005 atc0005 reopened this Feb 25, 2022
@atc0005
Copy link
Owner Author

atc0005 commented Feb 25, 2022

Changes reverted via #151. Reopening to track implementation in next release.

@atc0005 atc0005 modified the milestones: v2.7.0, v2.8.0 Feb 25, 2022
atc0005 added a commit that referenced this issue Feb 25, 2022
Summary:

- deprecate the current `API` interface
- expose `TeamsClient` to take its place
- create common interfaces and helper code to abstract any specific
  Microsoft Teams message format
- create new `botapi` package (limited functionality)
- extend existing `MessageCard` type (where needed) type to support
  new behavior
- port existing `goteamsnotify.MessageCard` types/functions/methods to
  a new `messagecard` package and deprecate existing `MessageCard`
  functionality provided by the `goteamsnotify` "base" package
- update examples to reflect changes
- restore support for overriding default `http.Client`
- restore default project-specific user agent, support for
  overriding the default from client code

While making these changes I've refactored code and attempted to
clearly communicate which existing code/functionality is being
deprecated, all without introducing breaking changes for client code.

The `botapi` package added in this collection of changes is a minimal
implementation. This package is intended to provide limited user
mention functionality for channel updates as a "bridge" until future
`Adaptive Card` support can be implemented.

A future implementation of `Adaptive Card` support would provide a
more complete experience, presumably providing a superset of the
limited support in the `botapi` package and existing `MessageCard`
functionality.

refs GH-127
refs GH-134
refs GH-135
refs GH-154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
1 participant