Skip to content

expose stage info created by buildpipeline phase to executestage phase. add null check for getDeploymentPluginMetadata #5910

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

Closed
wants to merge 2 commits into from

Conversation

hiep-tk
Copy link
Contributor

@hiep-tk hiep-tk commented Jun 2, 2025

What this PR does: as title

Why we need it: currently the script_run stages need more context to publish their stage already run status to the script_run_rollback so multiple rollbacks can be differentiated and selectively run

Which issue(s) this PR fixes: Part of #5901

Fixes #

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

Please describe your design on the issue in advance and submit the next draft PR because I cannot imagine what you are going to do.

Comment on lines 153 to 160
func (c *Client) GetDeploymentPluginMetadata(ctx context.Context, key string) (string, bool, error) {
resp, err := c.base.GetDeploymentPluginMetadata(ctx, &pipedservice.GetDeploymentPluginMetadataRequest{
DeploymentId: c.deploymentID,
PluginName: c.pluginName,
Key: key,
})
return resp.Value, err
if err != nil {
return "", false, err
}
return resp.Value, resp.Found, err
}
Copy link
Member

Choose a reason for hiding this comment

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

Please split the PR since this does not seem to be directly related to SCRIPT_RUN.

And please make consistent with other GetXxxMetadata() funcs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently this getxxxMetadata function's error checking is missing, which would cause nil pointer deref panic when the grpc call response with error. About the return signature of this format, it currently only extracts value property and not the found one, which would make it hard to differentiate, for example when the metadata is stored with empty value. Do you think the signature should stay as before, or as updated? @t-kikuc

Copy link

codecov bot commented Jun 2, 2025

Codecov Report

Attention: Patch coverage is 32.75862% with 117 lines in your changes missing coverage. Please review.

Project coverage is 54.90%. Comparing base (b7555ad) to head (f9530e1).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/pipedv1/plugin/scriptrun/plugin.go 32.88% 97 Missing and 3 partials ⚠️
pkg/app/pipedv1/plugin/scriptrun/options.go 43.75% 6 Missing and 3 partials ⚠️
pkg/app/pipedv1/plugin/scriptrun/main.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5910       +/-   ##
===========================================
+ Coverage   28.23%   54.90%   +26.67%     
===========================================
  Files         512       90      -422     
  Lines       55326     8771    -46555     
===========================================
- Hits        15620     4816    -10804     
+ Misses      38461     3625    -34836     
+ Partials     1245      330      -915     
Flag Coverage Δ
. ?
.-pkg-app-pipedv1-plugin-kubernetes 66.42% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 67.51% <ø> (ø)
.-pkg-app-pipedv1-plugin-scriptrun 32.36% <32.36%> (?)
.-pkg-app-pipedv1-plugin-wait 35.51% <ø> (ø)
.-pkg-plugin-sdk 50.92% <100.00%> (+0.02%) ⬆️
.-tool-actions-gh-release 19.23% <ø> (ø)
.-tool-actions-plan-preview 25.30% <ø> (?)
.-tool-codegen-protoc-gen-auth 0.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hiep-tk hiep-tk force-pushed the scriptrun branch 4 times, most recently from 2db8bee to 1d072f8 Compare June 23, 2025 07:45
@t-kikuc
Copy link
Member

t-kikuc commented Jul 2, 2025

@hiep-tk
Let's restart as a new PR!

@t-kikuc t-kikuc closed this Jul 2, 2025
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.

2 participants