pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

fix: when using remote resources, the related metrics tag name is wrong

Open cugykw opened this issue 1 year ago • 11 comments

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

cugykw avatar Mar 01 '24 02:03 cugykw

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.

tekton-robot avatar Mar 01 '24 02:03 tekton-robot

/test check-pr-has-kind-label

cugykw avatar Mar 04 '24 01:03 cugykw

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

tekton-robot avatar Mar 04 '24 01:03 tekton-robot

/test pull-tekton-pipeline-go-coverage-df

cugykw avatar Mar 04 '24 01:03 cugykw

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

tekton-robot avatar Mar 04 '24 01:03 tekton-robot

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

tekton-robot avatar Mar 04 '24 01:03 tekton-robot

/ok-to-test

dibyom avatar Mar 04 '24 17:03 dibyom

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

tekton-robot avatar Mar 04 '24 17:03 tekton-robot

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

tekton-robot avatar Mar 05 '24 01:03 tekton-robot

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

tekton-robot avatar Mar 05 '24 01:03 tekton-robot

/approve

chitrangpatel avatar May 14 '24 15:05 chitrangpatel

[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

Needs approval from an approver in each of these files:
  • ~~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

tekton-robot avatar May 16 '24 09:05 tekton-robot

/cherry-pick release-v0.59.x

afrittoli avatar May 17 '24 09:05 afrittoli

/cherry-pick release-v0.56.x

afrittoli avatar May 17 '24 09:05 afrittoli

/cherry-pick release-v0.53.x

afrittoli avatar May 17 '24 09:05 afrittoli

/cherry-pick release-v0.50.x

afrittoli avatar May 17 '24 09:05 afrittoli

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

tekton-robot avatar May 17 '24 09:05 tekton-robot

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

tekton-robot avatar May 17 '24 09:05 tekton-robot

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

tekton-robot avatar May 17 '24 09:05 tekton-robot

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

tekton-robot avatar May 17 '24 09:05 tekton-robot