Skip to content

optimize(hz): use relative path for grpc generated file#1022

Open
loveyana wants to merge 1 commit intocloudwego:developfrom
loveyana:fix/use-relative-path
Open

optimize(hz): use relative path for grpc generated file#1022
loveyana wants to merge 1 commit intocloudwego:developfrom
loveyana:fix/use-relative-path

Conversation

@loveyana
Copy link
Copy Markdown

@loveyana loveyana commented Dec 11, 2023

What type of PR is this?

optimize

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

go_package 使用相对路径去适配 grpc 的生成代码

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en: go_package use relative path to adapt 'grpc-generated code'

zh(optional): go_package 使用相对路径去适配 grpc 的生成代码

(Optional) Which issue(s) this PR fixes:

(Optional) The PR that updates user documentation:

@loveyana loveyana requested review from a team as code owners December 11, 2023 14:51
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 11, 2023

CLA assistant check
All committers have signed the CLA.

@FGYFFFF
Copy link
Copy Markdown
Contributor

FGYFFFF commented Dec 12, 2023

Please sign the CLA

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 12, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.60%. Comparing base (82f9bfa) to head (26dde13).
⚠️ Report is 201 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1022      +/-   ##
===========================================
+ Coverage    82.55%   82.60%   +0.05%     
===========================================
  Files           98       98              
  Lines         9974     9974              
===========================================
+ Hits          8234     8239       +5     
+ Misses        1244     1240       -4     
+ Partials       496      495       -1     

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

@welkeyever welkeyever changed the title fix: use relative path for grpc generated file fix(hz): use relative path for grpc generated file Dec 27, 2023
@welkeyever
Copy link
Copy Markdown
Member

Please fill the PR description according to the template. Here is a example: #1016

@FGYFFFF FGYFFFF changed the title fix(hz): use relative path for grpc generated file optimize(hz): use relative path for grpc generated file Jan 10, 2024
Comment thread cmd/hz/protobuf/plugin.go
}
// The file name must be the relative path, reference https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/compiler/plugin.proto#L122
if strings.HasPrefix(impt, "/") {
impt = impt[1:]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Removing the prefix “/” directly is not always right way to transfer absolute path to relative path?
An implicit premise is that the current work dir needs to be in "/"?

If there is something I missed please let me know🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants