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!: update to versioned exported trace format #157

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

drmorr0
Copy link
Contributor

@drmorr0 drmorr0 commented Nov 12, 2024

  • I certify that this PR does not contain any code that has been generated with GitHub Copilot or any other AI-based code generation tool, in accordance with this project's policies.

Description

This fixes a bug where if you track multiple resource types (Deployments and StatefulSets) for example, some of the objects get deleted on tracer startup, due to a mishandling of the Restart event.

This necessitated some changes to the trace file to track GVKs in addition to namespaced names of objects in its "index". Since I was in the code, I also took the opportunity here to update the format of the trace file to make it more future-proof. Trace files now include a version parameter, and are a dictionary of objects instead of just a list. This way I can add new fields or elements to the trace, and if you're running an old version of simkube they will be silently ignored. However, this change in format is a BREAKING CHANGE, hence this will bump SimKube to 2.0.

Testing done

  • make test; added a new test into the trace_store_test code that would catch the initial bug that triggered this change
  • manual testing; confirmed that simulations still run, export works, and xray still works.

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 91.07981% with 19 lines in your changes missing coverage. Please review.

Project coverage is 71.15%. Comparing base (d8880cb) to head (c74868b).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
sk-store/src/event_list.rs 75.00% 10 Missing ⚠️
sk-store/src/watchers/dyn_obj_watcher.rs 50.00% 7 Missing ⚠️
sk-store/src/pod_owners_map.rs 96.87% 1 Missing ⚠️
sk-store/src/store.rs 98.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #157      +/-   ##
==========================================
+ Coverage   70.04%   71.15%   +1.10%     
==========================================
  Files          49       51       +2     
  Lines        2691     2784      +93     
==========================================
+ Hits         1885     1981      +96     
+ Misses        806      803       -3     

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

@drmorr0 drmorr0 force-pushed the drmorr/fix-tracer-bug branch from 12a09b5 to 92bd3ec Compare November 14, 2024 16:54
@drmorr0 drmorr0 force-pushed the drmorr/fix-tracer-bug branch from 92bd3ec to cc19612 Compare November 15, 2024 05:08
@drmorr0 drmorr0 merged commit 80dbad6 into master Nov 15, 2024
8 checks passed
@drmorr0 drmorr0 deleted the drmorr/fix-tracer-bug branch November 15, 2024 23:32
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.

1 participant