including script to gather more metadta in buildbuddy #2260
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2260
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2260/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #1682
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1682
Original created: 2025-10-02T16:50:54Z
Original updated: 2025-10-02T17:05:39Z
Original head: carverauto/serviceradar:chore/buildbuddy_workspace_update
Original base: main
Original merged: 2025-10-02T17:05:35Z by @mfreeman451
PR Type
Enhancement
Description
Add workspace status script for BuildBuddy metadata collection
Configure Bazel to use workspace status command
Extract Git repository information and version tags
Diagram Walkthrough
File Walkthrough
workspace_status.sh
Add Git metadata extraction scriptscripts/workspace_status.sh
status
set -eo pipefail.bazelrc
Configure workspace status command.bazelrc
workspace_status.shscriptImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1682#issuecomment-3362155587
Original created: 2025-10-02T16:51:15Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Untrusted script execution
Description: Executing an external script via a relative path ('./tools/latest_version_tag.sh') during
build can be exploited if the path is writable or the script is untrusted; consider
pinning, validating existence, and using an absolute, repo-root-resolved path.
workspace_status.sh [34-34]
Referred Code
🎫 No ticket provided
Codebase context is not defined
Follow the guide to enable codebase context checks.
No custom compliance provided
Follow the guide to enable custom compliance check.
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1682#issuecomment-3362159284
Original created: 2025-10-02T16:52:29Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Improve script robustness and portability
To improve robustness and portability, replace
$(pwd)with%workspace%in.bazelrc, make internal script paths relative to the script's location, and usesedinstead ofperlto avoid a potential credential leak.Examples:
.bazelrc [33]
scripts/workspace_status.sh [16-34]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies multiple critical issues: a fragile path in
.bazelrcusing$(pwd), a potential credential leak due to a non-portableperldependency, and a non-robust relative path within the script.✅
Avoid potential credential leakSuggestion Impact:
The remove_url_credentials function was removed along with the rest of the script, eliminating the insecure perl fallback and thus addressing the credential leak risk by removing the code path entirely.code diff:
Replace the
perlcommand withsedin theremove_url_credentialsfunction toprevent a potential credential leak if
perlis not installed.scripts/workspace_status.sh [15-17]
[Suggestion processed]Suggestion importance[1-10]: 9
__
Why: This suggestion addresses a significant security risk of leaking credentials into build metadata if
perlis not present. The proposed fix usingsedis more portable and eliminates the insecure fallback.Use a workspace-relative path
In
.bazelrc, replace$(pwd)with%workspace%in theworkspace_status_commandtoensure the path to the script is always relative to the workspace root.
.bazelrc [33]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that using
$(pwd)is fragile and can cause build failures. Replacing it with the Bazel-specific%workspace%variable is the standard and more robust approach.