8000 Provide configurations to store labels and Annotations in summary by khrm · Pull Request #880 · tektoncd/results · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Provide configurations to store labels and Annotations in summary #880

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 GitHu 8000 b? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

khrm
Copy link
Contributor
@khrm khrm commented Nov 11, 2024

This helps by enabling making query to Results Table which have less rows.
Also, we can avoid toast query if PipelineRuns are too large. Also, we can create index on these.
You can provide args to watcher summary_labels and summary_annotations to store these labels/annotations to Result.Annotation field.

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you review them:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Tested your changes locally (if this is a code change)
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add 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)
  • Release notes contain the string "action required" if the change requires additional action from users switching to the new release

Release Notes

You can provide args to watcher `summary_labels` and `summary_annotations` to store these labels/annotations to Result.Annotation field.
Top Level Resource name is always saved as object.metadata.name in annotation.  

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 11, 2024
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 11, 2024
Copy link
Contributor Author
@khrm khrm left a comment

Choose a reason for hiding this comment

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

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 11, 2024
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/watcher/results/results.go 82.5% 79.1% -3.4

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/watcher/results/results.go 82.5% 79.1% -3.4

@khrm khrm added this to the v0.13.0 milestone Nov 11, 2024
Copy link
Contributor Author
@khrm khrm left a comment

Choose a reason for hiding this comment

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

This helps by enabling making query to Results Table which has less
rows.
Also, we can avoid toast query if PipelineRuns are too large.
Also, we can create index on these.
@khrm
Copy link
Contributor Author
khrm commented Nov 11, 2024

/test pull-tekton-results-unit-tests

@khrm
Copy link
Contributor Author
khrm commented Nov 11, 2024

/test pull-tekton-results-unit-tests

Copy link
Member
@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 11, 2024
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 11, 2024
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/watcher/results/results.go 82.5% 79.1% -3.4

@tekton-robot tekton-robot merged commit fd1f289 into tektoncd:main Nov 11, 2024
6 checks passed
@khrm khrm deleted the IndexSummary branch November 11, 2024 09:16
@@ -154,6 +162,24 @@ func (c *Client) ensureResult(ctx context.Context, o Object, opts ...grpc.CallOp
}
res.Summary.Annotations = annotations
}
// Set the Result.Summary.Labels fields if the object in question contains the required labels.
summaryLabels := strings.Split(c.Config.SummaryLabels, ",")
if len(summaryLabels) > 0 && summaryLabels[0] != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you only check summaryLabels[0] != ""? What if summaryLabels[2] == ""?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are checking for empty "" string. Split function on empty string yields empty "" string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignor 4A60 ing generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0