Skip to content

Conversation

@bitwiseguy
Copy link
Collaborator

@bitwiseguy bitwiseguy commented Jun 4, 2025

This pr restructures the ops/internal/deployer package, adding some subpackages for better organization. This is one step towards addressing the issue identified here where its difficult to add a new state version. Follow-up steps will be to extract more duplicate code from the state/vX.go files into the state.state.go file. Instead of having a flat deployer package, we now have the following dir structure:

|_ deployer
   |_ opaque_map
   |_ state
      |_ configs

@bitwiseguy bitwiseguy requested a review from geoknee June 4, 2025 16:52
@bitwiseguy bitwiseguy marked this pull request as ready for review June 4, 2025 16:55
@bitwiseguy bitwiseguy requested a review from a team as a code owner June 4, 2025 16:55
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 37.83784% with 230 lines in your changes missing coverage. Please review.

Project coverage is 33.42%. Comparing base (f225919) to head (cf40685).

Files with missing lines Patch % Lines
ops/internal/deployer/state/v4.go 0.00% 93 Missing ⚠️
ops/internal/deployer/state/state.go 46.73% 41 Missing and 8 partials ⚠️
ops/internal/deployer/state/v2.go 67.39% 21 Missing and 9 partials ⚠️
ops/internal/deployer/opaque_map/opaque_map.go 0.00% 19 Missing ⚠️
ops/internal/deployer/state/v1.go 58.62% 8 Missing and 4 partials ⚠️
ops/internal/deployer/state/v3.go 50.00% 6 Missing and 3 partials ⚠️
ops/internal/deployer/deployer.go 30.00% 7 Missing ⚠️
ops/internal/deployer/state/opaque_state.go 0.00% 4 Missing ⚠️
ops/internal/manage/staging.go 20.00% 4 Missing ⚠️
ops/internal/manage/generate.go 60.00% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1064      +/-   ##
==========================================
- Coverage   33.82%   33.42%   -0.40%     
==========================================
  Files          46       51       +5     
  Lines        3752     3752              
==========================================
- Hits         1269     1254      -15     
- Misses       2338     2355      +17     
+ Partials      145      143       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

type OpDeployer struct {
binaryPath string
merger StateMerger
merger state.StateMerger
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't feel strongly, but there's an opportunity to rename here so we have e.g. state.Merger a la Effective Go guidelines https://go.dev/doc/effective_go#package-names . Same goes for many other symbols that have "state" in the name.

Comment on lines +1 to +3
package opaque_map

type OpaqueMap map[string]any
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could call the package opaque and the map Map ?

)
}

func (om OpaqueState) GetNumChains() (int, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

While we are considering Effective Go conventions, we might also want to drop all of the Get- and Read- prefixes from these methods?

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.

4 participants