pipeline
pipeline copied to clipboard
fix: when using remote resources, the related metrics tag name is wrong
fixes: #7730
Prior to this PR, when pipeline refers to a remote pipeline, in the pipeline-related metrics, the pipeline name tag will be set to 'anonymous'. Taskrun has the same situation.
This commit added some scenarios for obtaining pipeline or task names. When the pipeline or task name cannot be determined accurately, the value is obtained through the corresponding label.
/kind bug
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
- [x] Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
- [x] Has Tests included if any functionality added or changed
- [x] pre-commit Passed
- [x] Follows the commit message standard
- [x] Meets the Tekton contributor standards (including functionality, content, code)
- [x] Has a kind label. You can add one by adding a comment on this PR that contains
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep - [ ] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
- [ ] Release notes contains the string "action required" if the change requires additional action from users switching to the new release
Release Notes
NONE
Hi @cugykw. Thanks for your PR.
I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/test check-pr-has-kind-label
@cugykw: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/test check-pr-has-kind-label
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/test pull-tekton-pipeline-go-coverage-df
@cugykw: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/test pull-tekton-pipeline-go-coverage-df
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/pipelinerunmetrics/metrics.go | 82.9% | 83.8% | 0.9 |
| pkg/taskrunmetrics/metrics.go | 84.0% | 84.4% | 0.4 |
/ok-to-test
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/pipelinerunmetrics/metrics.go | 82.9% | 83.8% | 0.9 |
| pkg/taskrunmetrics/metrics.go | 84.0% | 84.4% | 0.4 |
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/pipelinerunmetrics/metrics.go | 82.9% | 83.8% | 0.9 |
| pkg/taskrunmetrics/metrics.go | 84.0% | 84.4% | 0.4 |
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/pipelinerunmetrics/metrics.go | 82.9% | 83.8% | 0.9 |
| pkg/taskrunmetrics/metrics.go | 84.0% | 84.4% | 0.4 |
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: chitrangpatel, khrm, vdemeester
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [chitrangpatel,vdemeester]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/cherry-pick release-v0.59.x
/cherry-pick release-v0.56.x
/cherry-pick release-v0.53.x
/cherry-pick release-v0.50.x
@afrittoli: new pull request created: #7955
In response to this:
/cherry-pick release-v0.59.x
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
@afrittoli: new pull request created: #7956
In response to this:
/cherry-pick release-v0.56.x
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
@afrittoli: new pull request created: #7957
In response to this:
/cherry-pick release-v0.53.x
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
@afrittoli: #7731 failed to apply on top of branch "release-v0.50.x":
Applying: Prior to this PR, when pipeline refers to a remote pipeline, in the pipeline-related metrics, the pipeline name tag will be set to 'anonymous'. Taskrun has the same situation.
Using index info to reconstruct a base tree...
M pkg/pipelinerunmetrics/metrics.go
M pkg/pipelinerunmetrics/metrics_test.go
M pkg/taskrunmetrics/metrics.go
M pkg/taskrunmetrics/metrics_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/taskrunmetrics/metrics_test.go
Auto-merging pkg/taskrunmetrics/metrics.go
Auto-merging pkg/pipelinerunmetrics/metrics_test.go
CONFLICT (content): Merge conflict in pkg/pipelinerunmetrics/metrics_test.go
Auto-merging pkg/pipelinerunmetrics/metrics.go
CONFLICT (content): Merge conflict in pkg/pipelinerunmetrics/metrics.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Prior to this PR, when pipeline refers to a remote pipeline, in the pipeline-related metrics, the pipeline name tag will be set to 'anonymous'. Taskrun has the same situation.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
In response to this:
/cherry-pick release-v0.50.x
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.