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

Web Analytics support #1348

Merged
merged 14 commits into from
Aug 15, 2023
Merged

Conversation

broswen
Copy link
Contributor

@broswen broswen commented Aug 2, 2023

Description

Add Web Analytics Support.
CC @cf-ypark

Has your change been tested?

Unit tests have been added that align with the documented API spec.
I have locally tested the changes with a personal zone.

Screenshots (if appropriate):

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented in cloudflare/api-schemas
    and relies on stable APIs.

Public API documentation is available: https://developers.cloudflare.com/api/operations/web-analytics-create-site

@gitguardian
Copy link

gitguardian bot commented Aug 2, 2023

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
- Generic High Entropy Secret 29bea61 web_analytics_test.go View secret
- Generic High Entropy Secret ee8cb4b web_analytics_test.go View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2023

changelog detected ✅

@broswen
Copy link
Contributor Author

broswen commented Aug 2, 2023

GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Detected hardcoded secret in your pull request
Guidelines to remediate hardcoded secrets
owl GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.Our GitHub checks need improvements? Share your feedbacks!

All of the tokens/ids are random and not from an actual account.

@jacobbednarz
Copy link
Member

yeah, ignore the GitGuardian stuff. it's really blunt at finding "issues".

web_analytics.go Outdated Show resolved Hide resolved
web_analytics.go Outdated Show resolved Hide resolved
web_analytics.go Outdated Show resolved Hide resolved
Copy link
Member

@jacobbednarz jacobbednarz left a comment

Choose a reason for hiding this comment

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

couple of minor style/convention changes but the majority looks good to me! you should also consider if you need to make the booleans all pointers - https://github.com/cloudflare/cloudflare-go/blob/master/docs/conventions.md#booleans

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2023

Codecov Report

Merging #1348 (ee8cb4b) into master (b9ac804) will increase coverage by 0.01%.
Report is 158 commits behind head on master.
The diff coverage is 48.56%.

@@            Coverage Diff             @@
##           master    #1348      +/-   ##
==========================================
+ Coverage   48.33%   48.35%   +0.01%     
==========================================
  Files         133      139       +6     
  Lines       13023    13609     +586     
==========================================
+ Hits         6295     6580     +285     
- Misses       5201     5402     +201     
- Partials     1527     1627     +100     
Files Changed Coverage Δ
access_application.go 72.72% <ø> (ø)
access_organization.go 53.84% <ø> (ø)
device_posture_rule.go 61.80% <ø> (ø)
load_balancing.go 59.40% <ø> (ø)
teams_accounts.go 53.84% <ø> (ø)
workers.go 63.15% <ø> (+3.69%) ⬆️
rulesets.go 30.46% <28.20%> (-4.18%) ⬇️
web_analytics.go 38.26% <38.26%> (ø)
logpush.go 51.81% <42.55%> (-0.30%) ⬇️
regional_tiered_cache.go 43.75% <43.75%> (ø)
... and 7 more

... and 114 files with indirect coverage changes

@jacobbednarz jacobbednarz merged commit f127360 into cloudflare:master Aug 15, 2023
9 of 11 checks passed
@jacobbednarz
Copy link
Member

thanks @broswen!

@github-actions github-actions bot added this to the v0.75.0 milestone Aug 15, 2023
github-actions bot pushed a commit that referenced this pull request Aug 15, 2023
@github-actions
Copy link
Contributor

This functionality has been released in v0.75.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants