Skip to content

Implement Livestate SDK#5626

Merged
t-kikuc merged 12 commits intomasterfrom
livestate-sdk
Mar 10, 2025
Merged

Implement Livestate SDK#5626
t-kikuc merged 12 commits intomasterfrom
livestate-sdk

Conversation

@Warashi
Copy link
Member

@Warashi Warashi commented Mar 6, 2025

What this PR does:

as title

Why we need it:

To implement the livestate feature with this SDK

Which issue(s) this PR fixes:

Part of #5530

Does this PR introduce a user-facing change?: No

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Warashi added 8 commits March 6, 2025 08:32
…gs in a single method

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
…Model

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
…l conversions

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
@codecov
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 72.95082% with 33 lines in your changes missing coverage. Please review.

Project coverage is 25.56%. Comparing base (a252de8) to head (f3b5a86).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
pkg/plugin/sdk/livestate.go 81.65% 20 Missing ⚠️
pkg/plugin/sdk/sdk.go 0.00% 10 Missing ⚠️
pkg/plugin/sdk/deployment.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5626      +/-   ##
==========================================
- Coverage   26.54%   25.56%   -0.99%     
==========================================
  Files         477      477              
  Lines       50666    50945     +279     
==========================================
- Hits        13450    13022     -428     
- Misses      36153    36918     +765     
+ Partials     1063     1005      -58     

☔ 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.

Warashi added 2 commits March 6, 2025 09:42
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
@Warashi Warashi marked this pull request as ready for review March 6, 2025 00:51
Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

Almost LGTM!
Please check one nit

}

func TestLivestatePluginServer_GetLivestate(t *testing.T) {
tests := []struct {
Copy link
Member

Choose a reason for hiding this comment

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

nit: add t.Parallel()

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you. Fixed on this commit.
cc8fb17

Comment on lines +116 to +124
deployTargets := make([]*DeployTarget[DeployTargetConfig], 0, len(request.GetDeployTargets()))
for _, name := range request.GetDeployTargets() {
dt, ok := s.deployTargets[name]
if !ok {
return nil, status.Errorf(codes.Internal, "the deploy target %s is not found in the piped plugin config", name)
}

deployTargets = append(deployTargets, dt)
}
Copy link
Member

Choose a reason for hiding this comment

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

[refactor] Let's convert this block into a function in another PR since the same logic appears in ExecuteStage(), etc.

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
@Warashi Warashi requested a review from t-kikuc March 7, 2025 01:10
t-kikuc
t-kikuc previously approved these changes Mar 7, 2025
Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

Let's try!

Copy link
Member

@ffjlabo ffjlabo left a comment

Choose a reason for hiding this comment

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

Almost LGTM
just add one nit commit

Co-authored-by: Yoshiki Fujikane <40124947+ffjlabo@users.noreply.github.com>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
@Warashi Warashi requested review from ffjlabo and t-kikuc March 10, 2025 08:20
@Warashi
Copy link
Member Author

Warashi commented Mar 10, 2025

@t-kikuc
Sorry, please re-review.

Copy link
Member

@ffjlabo ffjlabo left a comment

Choose a reason for hiding this comment

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

Sorry, forgot to approve 🙏
LGTM

@t-kikuc t-kikuc merged commit 6cfeb58 into master Mar 10, 2025
17 of 18 checks passed
@t-kikuc t-kikuc deleted the livestate-sdk branch March 10, 2025 09:39
@github-actions github-actions bot mentioned this pull request Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants