-
Notifications
You must be signed in to change notification settings - Fork 77
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
Refactor use Absolute path for Makefile #2670
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request introduces modifications primarily to various Makefiles, focusing on updating path references to utilize the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
[CHATOPS:HELP] ChatOps commands.
|
[FOSSA] The scan result will be available at https://app.fossa.com/projects/custom%2B21465%2Fvald/refs/branch/refactor%2Fmakefile%2Fadd-absolute-path/c08cf5719843e0e2620ef48942c1fb95bc2d0559 |
Profile Report
|
ae7e07f
to
2481a88
Compare
Deploying vald with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
internal/net/grpc/errdetails/errdetails.go (1)
414-414
: LGTM! Consider usingfmt.Sprintf
for better readability.The change simplifies the string concatenation for stack entries, which is good. The use of
stack.ShortString()
instead ofstack.String()
is also an improvement, likely reducing the verbosity of the stack trace.For even better readability and performance, consider using
fmt.Sprintf
:debug.StackEntries = append(debug.GetStackEntries(), fmt.Sprintf("id: %d stack_trace: %s", i, stack.ShortString()))This approach is more idiomatic Go and can be slightly more efficient for string formatting.
internal/info/info.go (1)
303-306
: Consider usingpath.Base
for extracting the function name.Replacing the manual string manipulation with
path.Base
from thepath
package can improve code clarity and handle edge cases more robustly.Apply this diff to enhance the function name extraction:
-index := strings.LastIndex(funcName, "/") -if index != -1 { - funcName = funcName[index+1:] -} +funcName = path.Base(funcName)Remember to import the
path
package at the top of the file:+ "path"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (9)
- Makefile (2 hunks)
- Makefile.d/docker.mk (2 hunks)
- Makefile.d/functions.mk (0 hunks)
- Makefile.d/git.mk (1 hunks)
- Makefile.d/helm.mk (2 hunks)
- Makefile.d/k8s.mk (9 hunks)
- Makefile.d/proto.mk (1 hunks)
- internal/info/info.go (5 hunks)
- internal/net/grpc/errdetails/errdetails.go (1 hunks)
💤 Files with no reviewable changes (1)
- Makefile.d/functions.mk
🚧 Files skipped from review as they are similar to previous changes (5)
- Makefile
- Makefile.d/docker.mk
- Makefile.d/git.mk
- Makefile.d/k8s.mk
- Makefile.d/proto.mk
🔇 Additional comments (22)
Makefile.d/helm.mk (15)
40-40
: LGTM: Improved path robustnessThe use of
$(ROOTDIR)
in the helm package command ensures that the correct path is used regardless of the current working directory. This change improves the robustness of the Makefile.
47-47
: LGTM: Consistent path updateThe use of
$(ROOTDIR)
in the helm package command for vald-helm-operator is consistent with the previous change and provides the same benefits of improved path robustness.
55-55
: LGTM: Consistent path updateThe use of
$(ROOTDIR)
in the helm package command for vald-benchmark-operator maintains consistency with the previous changes and improves path robustness.
59-59
: LGTM: Consistent path updateThe use of
$(ROOTDIR)
in the helm package command for vald-readreplica maintains consistency with the previous changes and improves path robustness.
67-67
: LGTM: Consistent path updates for documentationThe use of
$(ROOTDIR)
in the paths for the Vald README and its dependencies ensures consistency with previous changes and improves the robustness of the documentation generation process.Also applies to: 70-73
77-77
: LGTM: Consistent path updates for vald-helm-operator documentationThe use of
$(ROOTDIR)
in the paths for the vald-helm-operator README and its dependencies maintains consistency with previous changes and ensures robust documentation generation.Also applies to: 80-83
87-87
: LGTM: Consistent path update for vald-readreplica documentationThe use of
$(ROOTDIR)
in the path for the vald-readreplica README maintains consistency with previous changes and ensures robust documentation generation.
90-90
: LGTM: Consistent path updates for vald-benchmark-operator documentationThe use of
$(ROOTDIR)
in the paths for the vald-benchmark-operator README and its dependencies maintains consistency with previous changes and ensures robust documentation generation.Also applies to: 92-95
99-102
: LGTM: Completed path updates for vald-readreplica documentationThe use of
$(ROOTDIR)
in the paths for the vald-readreplica README and its dependencies completes the modifications for this target, maintaining consistency and ensuring robust documentation generation.
115-115
: LGTM: Consistent path updates for Vald schema generationThe use of
$(ROOTDIR)
in the paths for the Vald schema and its dependency maintains consistency with previous changes and ensures robust schema generation.Also applies to: 117-118
123-123
: LGTM: Consistent path updates for vald-helm-operator schema generationThe use of
$(ROOTDIR)
in the paths for the vald-helm-operator schema and its dependency maintains consistency with previous changes and ensures robust schema generation.Also applies to: 125-126
131-131
: LGTM: Consistent path updates for vald-benchmark-job schema generationThe use of
$(ROOTDIR)
in the paths for the vald-benchmark-job schema and its dependency maintains consistency with previous changes and ensures robust schema generation.Also applies to: 133-134
139-139
: LGTM: Consistent path updates for vald-benchmark-scenario schema generationThe use of
$(ROOTDIR)
in the paths for the vald-benchmark-scenario schema and its dependency maintains consistency with previous changes and ensures robust schema generation.Also applies to: 141-142
147-147
: LGTM: Consistent path updates for vald-benchmark-operator schema generationThe use of
$(ROOTDIR)
in the paths for the vald-benchmark-operator schema and its dependency maintains consistency with previous changes and ensures robust schema generation.Also applies to: 149-150
Line range hint
40-150
: LGTM: Comprehensive path refactoring improves Makefile robustnessThis PR consistently updates all relevant paths in the Makefile to use
$(ROOTDIR)
. This change affects various targets including Helm chart packaging, documentation generation, and schema generation for multiple components (Vald, vald-helm-operator, vald-benchmark-operator, vald-readreplica, etc.).The refactoring improves the robustness of the Makefile by ensuring that correct paths are used regardless of the current working directory. This consistency across all targets enhances maintainability and reduces the risk of path-related errors.
Overall, these changes represent a positive improvement to the build system.
internal/info/info.go (7)
40-43
: Addition of 'valdReplacer' field enhances URL handling in stack traces.The introduction of the
valdReplacer *strings.Replacer
field to theinfo
struct allows for efficient and consistent URL replacements when generating stack traces. This enhances the functionality of theinfo
package by improving the accuracy of stack trace URLs.
119-126
: Definition of new constants improves code readability and maintainability.Introducing constants like
goSrc
,goMod
, andgoogleGolang
simplifies path handling and makes the code more readable. This practice reduces magic strings and potential errors from mistyped strings.
311-331
: Enhanced URL construction logic improves stack trace accuracy.The updated logic for generating URLs in the
getDetail
method correctly handles various cases, such as Go source files and Google libraries. This refinement ensures that stack trace URLs point to the exact locations in the respective repositories, aiding in debugging and navigation.
352-352
: Appropriate use ofvaldReplacer
for URL replacement.Using
i.valdReplacer.Replace
effectively replaces the relevant parts of the file path to construct accurate URLs for stack traces related to the Vald repository.
354-354
: Consistent URL replacement withvaldReplacer
.Continuing to utilize
i.valdReplacer.Replace
ensures consistent handling of file paths when generating URLs, which enhances maintainability.
420-422
: Lazy initialization ofvaldReplacer
prevents nil pointer dereference.By initializing
valdReplacer
within theprepare
method only if it isnil
, the code ensures thatvaldReplacer
is ready when needed without redundant initializations.
430-432
: Addition ofShortString
method provides concise stack trace representation.The
ShortString
method offers a succinct way to represent stack trace information, which can be useful for logging purposes where full details are unnecessary.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2670 +/- ##
==========================================
- Coverage 23.99% 23.98% -0.01%
==========================================
Files 539 539
Lines 47179 47195 +16
==========================================
+ Hits 11319 11321 +2
- Misses 35090 35105 +15
+ Partials 770 769 -1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: kpango <[email protected]>
…Makefile (#2673) * Refactor use Absolute path for Makefile (#2670) Signed-off-by: kpango <[email protected]> * Apply suggestions from code review Signed-off-by: Kiichiro YUKAWA <[email protected]> --------- Signed-off-by: kpango <[email protected]> Signed-off-by: Kiichiro YUKAWA <[email protected]> Co-authored-by: Yusuke Kato <[email protected]> Co-authored-by: Kiichiro YUKAWA <[email protected]>
Signed-off-by: kpango <[email protected]>
Signed-off-by: kpango <[email protected]>
Description
SSIA
Related Issue
Versions
Checklist
Special notes for your reviewer
Summary by CodeRabbit