Skip to content

Conversation

@denik
Copy link
Contributor

@denik denik commented May 7, 2025

Changes

  • Embed struct by value not by pointer in all the resources.
  • Remove IsNil method from the resource interface and implementations (it's never true).

Why

Tests

Existing tests.

@denik denik temporarily deployed to test-trigger-is May 7, 2025 14:39 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 08:37 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 08:48 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 08:53 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 09:00 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 09:05 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 09:12 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 09:17 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 09:32 — with GitHub Actions Inactive
@denik denik changed the title WIP - embed struct, not ptr Embed struct, not pointer in resources May 8, 2025
@denik denik marked this pull request as ready for review May 8, 2025 09:33
@denik denik temporarily deployed to test-trigger-is May 8, 2025 10:32 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 12:23 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is May 8, 2025 12:23 — with GitHub Actions Inactive
@denik denik enabled auto-merge May 8, 2025 12:25
@denik denik added this pull request to the merge queue May 8, 2025
@denik denik removed this pull request from the merge queue due to a manual request May 8, 2025
@denik denik added this pull request to the merge queue May 8, 2025
@denik denik removed this pull request from the merge queue due to a manual request May 8, 2025
denik added 5 commits May 8, 2025 15:04
@denik denik force-pushed the denik/embed-struct-not-ptr branch from a1add45 to 9fa0be8 Compare May 8, 2025 13:05
@denik denik temporarily deployed to test-trigger-is May 8, 2025 13:05 — with GitHub Actions Inactive
@denik denik merged commit b03da56 into main May 8, 2025
9 of 10 checks passed
@denik denik deleted the denik/embed-struct-not-ptr branch May 8, 2025 13:08
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

Thanks, great simplification!


assert.Nil(t, b.Config.Resources.Volumes["nilVolume"])
assert.Nil(t, b.Config.Resources.Volumes["emptyVolume"].CreateVolumeRequestContent)
// assert.Nil(t, b.Config.Resources.Volumes["emptyVolume"].CreateVolumeRequestContent)
Copy link
Contributor

Choose a reason for hiding this comment

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

Dup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a dup (second line used to check inner pointer), should have been cleaned up.

ModelServingEndpoints: map[string]*resources.ModelServingEndpoint{
"my_model_serving_endpoint": {
CreateServingEndpoint: &serving.CreateServingEndpoint{},
CreateServingEndpoint: serving.CreateServingEndpoint{},
Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, with these structs being zero-initialized, the assignment can be removed entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. For context, most replacement were made with search-and-replace, so they look odd (AI tools were going back and forth on whether it should be a pointer or a struct, so I stopped using those for this).

I feel like there should be a linter to clean this up, but I could not find one.

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.

5 participants