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

Add CardsV2 Support to Google Chat #201

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Conversation

tpaulus
Copy link
Contributor

@tpaulus tpaulus commented Jul 21, 2023

This change adds support for Googles new CardSV2 format which replaces the now deprecated V1 format. The Google Generated shapes are now used for Message parsing to ensure complete coverage and accuracy between the docs and what the Google APIs expect.

Added unit tests and update docs to reflect these changes.

Fixes #158

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Patch coverage: 64.70% and project coverage change: +0.13% 🎉

Comparison is base (e80a8e9) 53.80% compared to head (32e9413) 53.93%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
+ Coverage   53.80%   53.93%   +0.13%     
==========================================
  Files          35       35              
  Lines        3249     3278      +29     
==========================================
+ Hits         1748     1768      +20     
- Misses       1244     1250       +6     
- Partials      257      260       +3     
Files Changed Coverage Δ
pkg/services/googlechat.go 61.36% <64.70%> (+2.14%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pims
Copy link

pims commented Jul 31, 2023

@zachaller @mayzhang2000 would one of you be able to dedicate some time to reviewing this PR in the near future?
The desired end goal is to have this functionality available in the next realease of argo-rollouts.

We’ve been running with this patch for a while now and it's working very well.

Thank you 🙏

@pasha-codefresh
Copy link
Member

@tpaulus could you please fix conflicts, also WDYT about support of two versions? ( v1 and v2 ).

@tpaulus
Copy link
Contributor Author

tpaulus commented Sep 18, 2023

PR has been rebased against master.

As for how V1 and V2 support works, there is a new Struct called cardsV2 which exposes the new shapes, while the original cards interface remains the same. The change is backwards compatible, while still enabling the new card items, which cannot be translated to the new interface because there is little to no overlap between V1 and V2 modules (thanks Google).

@pasha-codefresh
Copy link
Member

Yeah, but once people update notification engine in their argocd instances, their notifications will stop work until they migrate to new templating and so on

@tpaulus
Copy link
Contributor Author

tpaulus commented Sep 18, 2023

I'm not sure I follow, the V1 interface is still supported by the integration and nothing changed with the shape of the V1 integration other than using the Google Protobuffs for the notification, which are the same as what was previously there. The TestCardMessage_GoogleChat Unit Test shows that this still works, as the input remains unchanged.

@pasha-codefresh
Copy link
Member

Get it, @tpaulus , i will review it tomorrow and will back to you

@pasha-codefresh
Copy link
Member

Great job @tpaulus , thanks

@pasha-codefresh pasha-codefresh merged commit e564872 into argoproj:master Sep 20, 2023
5 checks passed
lol3909 pushed a commit to lol3909/notifications-engine that referenced this pull request Oct 19, 2023
Signed-off-by: Tom Paulus <[email protected]>
Signed-off-by: Anthony Mikhail <[email protected]>
pasha-codefresh added a commit that referenced this pull request Oct 19, 2023
… (#208)

* fix: oncePer condition only checked when ` when` condition is true

Signed-off-by: Anthony Mikhail <[email protected]>

* wip

Signed-off-by: Anthony Mikhail <[email protected]>

* wip

Signed-off-by: Anthony Mikhail <[email protected]>

* wip

Signed-off-by: Anthony Mikhail <[email protected]>

* add debuging

Signed-off-by: Anthony Mikhail <[email protected]>

* wip

Signed-off-by: Anthony Mikhail <[email protected]>

* Revert "wip"

This reverts commit 6313312.

Signed-off-by: Anthony Mikhail <[email protected]>

* wip

Signed-off-by: Anthony Mikhail <[email protected]>

* chore(deps): bump github.com/gregdel/pushover from 1.1.0 to 1.2.1 (#210)

Bumps [github.com/gregdel/pushover](https://github.com/gregdel/pushover) from 1.1.0 to 1.2.1.
- [Commits](gregdel/pushover@v1.1.0...v1.2.1)

---
updated-dependencies:
- dependency-name: github.com/gregdel/pushover
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Anthony Mikhail <[email protected]>

* GitHub Deployment - Allow Automerge configuration (#193)

* Allow AutoMerge configuration

Signed-off-by: Mike Splain <[email protected]>

* Add docs and test

Signed-off-by: Mike Splain <[email protected]>

* Fix default and docs

Signed-off-by: Mike Splain <[email protected]>

---------

Signed-off-by: Mike Splain <[email protected]>
Co-authored-by: pasha-codefresh <[email protected]>
Signed-off-by: Anthony Mikhail <[email protected]>

* Add GitHub Pull Request comments integration (#211)

* Add pull request comment to github service

Signed-off-by: bennesp <[email protected]>

* Add github pull request comment templater test

Signed-off-by: bennesp <[email protected]>

* Add github pull request comment docs

Signed-off-by: bennesp <[email protected]>

---------

Signed-off-by: bennesp <[email protected]>
Signed-off-by: Anthony Mikhail <[email protected]>

* chore(deps): bump codecov/codecov-action from 3 to 4 (#216)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Anthony Mikhail <[email protected]>

* revert to v3 (#218)

Signed-off-by: Anthony Mikhail <[email protected]>

* Add CardsV2 Support to Google Chat (#201)

Signed-off-by: Tom Paulus <[email protected]>
Signed-off-by: Anthony Mikhail <[email protected]>

* chore(deps): bump expr version and golang as required by expr 1.15 (#221)

* bump expr version

Signed-off-by: zachaller <[email protected]>

* upgrade go expr uses any

Signed-off-by: zachaller <[email protected]>

* use root go version

Signed-off-by: zachaller <[email protected]>

* add sum

Signed-off-by: zachaller <[email protected]>

* change for golang upgrade

Signed-off-by: zachaller <[email protected]>

---------

Signed-off-by: zachaller <[email protected]>
Signed-off-by: Anthony Mikhail <[email protected]>

* wip
Signed-off-by: Anthony Mikhail <[email protected]>

Signed-off-by: Anthony Mikhail <[email protected]>

* fix duplicate when using self-service (#227)

* fix duplicate when using self-service

Signed-off-by: May Zhang <[email protected]>

* fix duplicate when using self-service

Signed-off-by: May Zhang <[email protected]>

* fix tests

Signed-off-by: May Zhang <[email protected]>

* -s

Signed-off-by: May Zhang <[email protected]>

* add test cases

Signed-off-by: May Zhang <[email protected]>

* remove not used method

Signed-off-by: May Zhang <[email protected]>

---------

Signed-off-by: May Zhang <[email protected]>
Signed-off-by: Anthony Mikhail <[email protected]>

* Spelling (#220)

* spelling: available

Signed-off-by: Josh Soref <[email protected]>

* spelling: configuration

Signed-off-by: Josh Soref <[email protected]>

* spelling: emoji

Signed-off-by: Josh Soref <[email protected]>

* spelling: environment

Signed-off-by: Josh Soref <[email protected]>

* spelling: github

Signed-off-by: Josh Soref <[email protected]>

* spelling: notification

Signed-off-by: Josh Soref <[email protected]>

* spelling: overridden

Signed-off-by: Josh Soref <[email protected]>

* spelling: successfully

Signed-off-by: Josh Soref <[email protected]>

* spelling: unmarshal

Signed-off-by: Josh Soref <[email protected]>

* spelling: variable or

Signed-off-by: Josh Soref <[email protected]>

* spelling: variables are

Signed-off-by: Josh Soref <[email protected]>

* spelling: webhook

Signed-off-by: Josh Soref <[email protected]>

---------

Signed-off-by: Josh Soref <[email protected]>
Co-authored-by: pasha-codefresh <[email protected]>
Signed-off-by: Anthony Mikhail <[email protected]>

* Update documentation for Slack options (#209)

* Clarify option types

Signed-off-by: Andreas Lindhé <[email protected]>

* Sort alphabetically

Signed-off-by: Andreas Lindhé <[email protected]>

* Add missing `channels` and `sigingSecret` options

Signed-off-by: Andreas Lindhé <[email protected]>

* Convert list to Markdown table

Signed-off-by: Andreas Lindhé <[email protected]>

* Clarify `token` description

Signed-off-by: Andreas Lindhé <[email protected]>

* Add example column

Signed-off-by: Andreas Lindhé <[email protected]>

* Populate rest of example fields

Signed-off-by: Andreas Lindhé <[email protected]>

* Fix typo

Co-authored-by: Blake Pettersson <[email protected]>
Signed-off-by: Andreas Lindhé <[email protected]>

---------

Signed-off-by: Andreas Lindhé <[email protected]>
Co-authored-by: Blake Pettersson <[email protected]>
Co-authored-by: pasha-codefresh <[email protected]>
Signed-off-by: Anthony Mikhail <[email protected]>

* fix: avoid crashing in gitHubService.Send when repoURL has no / (#219)

Signed-off-by: Josh Soref <[email protected]>
Co-authored-by: pasha-codefresh <[email protected]>
Signed-off-by: Anthony Mikhail <[email protected]>

---------

Signed-off-by: Anthony Mikhail <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Mike Splain <[email protected]>
Signed-off-by: bennesp <[email protected]>
Signed-off-by: Tom Paulus <[email protected]>
Signed-off-by: zachaller <[email protected]>
Signed-off-by: May Zhang <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Andreas Lindhé <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Splain <[email protected]>
Co-authored-by: pasha-codefresh <[email protected]>
Co-authored-by: Benedetto Nespoli <[email protected]>
Co-authored-by: Tom Paulus <[email protected]>
Co-authored-by: Zach Aller <[email protected]>
Co-authored-by: May Zhang <[email protected]>
Co-authored-by: Josh Soref <[email protected]>
Co-authored-by: Andreas Lindhé <[email protected]>
Co-authored-by: Blake Pettersson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade Google chat integration to Cards V2
3 participants