Skip to content

Conversation

@yumosx
Copy link
Contributor

@yumosx yumosx commented Sep 26, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aligns the trace scope name with OpenTelemetry specification requirements by replacing the generic OTel package name with a specific Dubbo-related scope name.

  • Updates trace scope name to use a Dubbo-specific identifier instead of the generic OpenTelemetry package name
  • Removes dependency on the OTel SDK package and switches to local version constant
  • Improves code documentation and consistency with interface assertion patterns

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
filter/otel/trace/filter.go Updates tracer scope name and version constant, adds documentation comments, and improves variable naming
filter/otel/trace/attachment.go Improves interface assertion pattern and removes extra blank lines
common/constant/otel.go Replaces generic OTel package name constant with Dubbo-specific trace scope name

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

No-SilverBullet
No-SilverBullet approved these changes Sep 30, 2025
@AlexStocks
Copy link
Contributor

image Please fix the ci failure.

@yumosx
Copy link
Contributor Author

yumosx commented Oct 9, 2025

雨哥我的工作区是干净的, 这个 ci 我不清楚是为啥导致的

img_v3_02qt_b4f4d09a-5d11-4b64-924a-9133c59efc5g

@yumosx
Copy link
Contributor Author

yumosx commented Oct 9, 2025

这是那个 gpt 的解释


该 CI 工作失败的原因如下:

##[error]Process completed with exit code 1.
...
modified:   filter/otel/trace/attachment.go
no changes added to commit (use "git add" and/or "git commit -a")

原因

工作流尝试执行 git 操作时,filter/otel/trace/attachment.go 文件有本地修改但未被暂存或提交。这导致该步骤失败,通常工作流要求工作目录是干净的。

解决方法

1. 确保在运行工作流步骤前工作目录是干净的。
可在 workflow 的前面(比如 checkout 后)添加如下步骤,重置本地改动:

- name: Reset any local changes
  run: git reset --hard HEAD

2. 如果工作流过程中确实需要修改文件,请确保在需要时 add 并 commit,或者在继续之前还原这些修改。

3. 如果 filter/otel/trace/attachment.go 是工作流生成的文件,请确保它不会影响后续步骤。如果不需要跟踪该文件,可以把它加到 .gitignore

工作流修正示例

你可以在 .github/workflows/github-actions.yml 加入如下内容(ref: 3207557):

jobs:
  build:
    steps:
      - uses: actions/checkout@v3
      # 添加这个步骤
      - name: Reset local changes to ensure clean state
        run: git reset --hard HEAD
      # 其他步骤...

摘要:
失败原因是 filter/otel/trace/attachment.go 文件有未暂存的本地修改。请在工作流开始时加上 git reset --hard HEAD,保证工作目录干净。

如需更具体代码或想查看相关 workflow 文件,请告知!


是的,这个问题属于 GitHub CI/CD 工作流配置导致的。
具体来说,是因为在 CI 工作流过程中,filter/otel/trace/attachment.go 文件被修改了,但这些改动没有被暂存(git add)或提交(git commit),导致 git 检查工作区是否干净时失败(exit code 1)。

解决方法
你可以在 workflow(比如 .github/workflows/github-actions.yml)的开始部分,checkout 代码后,增加如下步骤,确保每次运行前都是干净的代码状态:

- name: Reset local changes to ensure clean state
  run: git reset --hard HEAD

这样能避免因本地未提交的文件修改导致 CI/CD 失败。

如果你有特殊需要的文件变更,要么在工作流中 add & commit,要么把相关文件加入 .gitignore

总结
这个问题本质是 CI/CD 配置和代码工作区管理有关,和 Go 代码逻辑无关,修正 workflow 配置即可。

@FoghostCn
Copy link
Contributor

FoghostCn commented Oct 16, 2025

雨哥我的工作区是干净的, 这个 ci 我不清楚是为啥导致的

img_v3_02qt_b4f4d09a-5d11-4b64-924a-9133c59efc5g

格式化下 filter/otel/trace/attachment.go

@sonarqubecloud
Copy link

@yumosx
Copy link
Contributor Author

yumosx commented Oct 18, 2025

格式化下 filter/otel/trace/attachment.go

done.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.61%. Comparing base (1a7b169) to head (59ccdbd).

Files with missing lines Patch % Lines
filter/otel/trace/filter.go 66.66% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3041      +/-   ##
===========================================
- Coverage    39.64%   39.61%   -0.04%     
===========================================
  Files          457      457              
  Lines        39075    39075              
===========================================
- Hits         15493    15480      -13     
- Misses       22318    22332      +14     
+ Partials      1264     1263       -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.

@AlexStocks AlexStocks merged commit afc686d into apache:develop Oct 18, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants