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

[WAIT] Use metadataStore in the wait stage plugin #5520

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

t-kikuc
Copy link
Member

@t-kikuc t-kikuc commented Jan 30, 2025

What this PR does:

as title

Why we need it:

Which issue(s) this PR fixes:

Part of #5367

Does this PR introduce a user-facing change?:

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

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

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

Project coverage is 26.43%. Comparing base (6f4d443) to head (7113bd3).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/pipedv1/plugin/wait/deployment/wait.go 0.00% 28 Missing ⚠️
pkg/app/pipedv1/plugin/wait/deployment/server.go 0.00% 4 Missing ⚠️
pkg/app/pipedv1/plugin/wait/plugin.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5520      +/-   ##
==========================================
- Coverage   26.43%   26.43%   -0.01%     
==========================================
  Files         464      464              
  Lines       49786    49793       +7     
==========================================
  Hits        13163    13163              
- Misses      35569    35576       +7     
  Partials     1054     1054              

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

Comment on lines 92 to 105
func (s *deploymentServiceServer) retrieveStartTime(ctx context.Context, deploymentID, stageID string) (t time.Time) {
sec, err := s.metadataStore.GetStageMetadata(ctx, &pipedservice.GetStageMetadataRequest{
DeploymentId: deploymentID,
StageId: stageID,
Key: startTimeKey,
})
if err != nil {
s.logger.Error(fmt.Sprintf("failed to get stage metadata %s", startTimeKey), zap.Error(err))
return
}
ut, err := strconv.ParseInt(sec.Value, 10, 64)
if err != nil {
s.logger.Error(fmt.Sprintf("failed to parse stage metadata %s", startTimeKey), zap.Error(err))
return
Copy link
Contributor

Choose a reason for hiding this comment

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

[IMO]
I don't like naked returns, and named result parameters that don't clarify the usage of their return values.
ref; https://go.dev/wiki/CodeReviewComments#named-result-parameters

Copy link
Member Author

Choose a reason for hiding this comment

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

@Warashi
Thank you. I agree with you and have fixed it. 7113bd3

Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

👍

@t-kikuc t-kikuc merged commit e600dd9 into master Jan 31, 2025
16 of 18 checks passed
@t-kikuc t-kikuc deleted the plugin/wait-use-metadatastore branch January 31, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants