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

feat: add support for reporting patch install events #71

Merged
merged 16 commits into from
Aug 11, 2023

Conversation

bryanoltman
Copy link
Contributor

@bryanoltman bryanoltman commented Aug 10, 2023

Description

Adds the PatchInstallEvent type and posts to the api/v1/patches/events endpoint when the engine reports a successful launch and we mark a patch as good.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Patch coverage: 98.59% and project coverage change: +0.08% 🎉

Comparison is base (d321ad0) 97.24% compared to head (a5eaaeb) 97.33%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #71      +/-   ##
==========================================
+ Coverage   97.24%   97.33%   +0.08%     
==========================================
  Files           9        9              
  Lines        1598     1725     +127     
==========================================
+ Hits         1554     1679     +125     
- Misses         44       46       +2     
Files Changed Coverage Δ
library/src/cache.rs 93.43% <ø> (ø)
library/src/updater.rs 97.42% <96.82%> (-0.23%) ⬇️
library/src/c_api.rs 99.49% <100.00%> (+<0.01%) ⬆️
library/src/network.rs 99.02% <100.00%> (+0.58%) ⬆️

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

@bryanoltman bryanoltman marked this pull request as ready for review August 10, 2023 21:51
Base automatically changed from bo/client-id to main August 11, 2023 15:23
bryanoltman and others added 3 commits August 11, 2023 13:16
Co-authored-by: Felix Angelov <felix@shorebird.dev>
Comment on lines +281 to +283
let patch_install_success_fn = config.network_hooks.patch_install_success_fn;
let url = &patches_events_url(&config.base_url);
patch_install_success_fn(url, request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let patch_install_success_fn = config.network_hooks.patch_install_success_fn;
let url = &patches_events_url(&config.base_url);
patch_install_success_fn(url, request)
let url = &patches_events_url(&config.base_url);
config.network_hooks.patch_install_success_fn(url, request)

nit but would this work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would need to be (config.network_hooks.patch_install_success_fn)(url, request), but yeah, that would work. I did it this way for consistency with the other functions in that file that use network hooks.

@bryanoltman bryanoltman merged commit 99f3005 into main Aug 11, 2023
@bryanoltman bryanoltman deleted the bo/report-patch-install branch August 11, 2023 17:56
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.

2 participants