Skip to content

docs(tektonresult): document that watcher.logs_api is needed to store logs - #3884

Open
pujitha24 wants to merge 1 commit into
tektoncd:mainfrom
pujitha24:auto/issue-2600
Open

pujitha24 wants to merge 1 commit into
tektoncd:mainfrom
pujitha24:auto/issue-2600

Conversation

@pujitha24

@pujitha24 pujitha24 commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Documents that setting the top-level logs_api: true on a TektonResult (or result.logs_api on TektonConfig) only enables the logs API on the Results API server. The tekton-results-watcher forwards TaskRun and PipelineRun logs to it only when its own -logs_api flag is set through watcher.logs_api, which defaults to false. With only the top-level field set, as in the File/PVC example, no logs are stored (#2600).

Per review, the existing default is kept: the watcher is not the only possible forwarder (Vector or Fluentd with LokiStack, for example), so this PR changes docs only:

  • docs/TektonResult.md: a note under the spec example explains the two settings, when watcher.logs_api can stay unset, and that log forwarding by the watcher is expected to be removed in a future release. The example sets watcher.logs_api: true with a comment pointing to the note.
  • docs/TektonConfig.md: the result.watcher example sets logs_api: true with the same comment, and the watcher table's logs_api row says the same in short.

An earlier revision of this PR defaulted watcher.logs_api from the top-level logs_api in Result.setDefaults(); that was dropped after review.

Submitter Checklist

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

  • Run make test lint before submitting a PR (n/a: docs only)
  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices

See the contribution guide for more details.

Release Notes

NONE

AI assistance: this change was drafted with Claude Code.

Fixes #2600

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 10, 2026
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.75%. Comparing base (f407f97) to head (688febc).
⚠️ Report is 90 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3884      +/-   ##
==========================================
+ Coverage   26.33%   27.75%   +1.41%     
==========================================
  Files         465      477      +12     
  Lines       24951    25679     +728     
==========================================
+ Hits         6572     7128     +556     
- Misses      17661    17822     +161     
- Partials      718      729      +11     
Flag Coverage Δ
unit-tests 27.75% <ø> (+1.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@pujitha24

Copy link
Copy Markdown
Contributor Author

/retest

2 similar comments
@pujitha24

Copy link
Copy Markdown
Contributor Author

/retest

@jkhelil

jkhelil commented Aug 11, 2026

Copy link
Copy Markdown
Member

/retest

@jkhelil

jkhelil commented Aug 11, 2026

Copy link
Copy Markdown
Member

/lgtm

@jkhelil

jkhelil commented Aug 11, 2026

Copy link
Copy Markdown
Member

@enarha @khrm PTAL

@tekton-robot tekton-robot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Aug 11, 2026
@tekton-robot

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from jkhelil after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Details 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

@jkhelil jkhelil closed this Aug 14, 2026
@jkhelil jkhelil reopened this Aug 14, 2026
@pujitha24

Copy link
Copy Markdown
Contributor Author

Tide was flagging this as unmergeable because the branch had a merge commit from syncing upstream/main, which a clean rebase can't replay past a later commit (39604bf5d) touching the same function. Rebased onto current main and resolved it so history is linear again — no logic changes, the two touched files are byte-identical to what was already passing CI here. Tests and build still pass locally.

@pujitha24

Copy link
Copy Markdown
Contributor Author

/assign @jkhelil

Rebased and green — let me know if anything else would help move this toward approval.

@pratap0007

Copy link
Copy Markdown
Contributor

@enarha @khrm Could you please take a look?

@khrm khrm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 27, 2026

@khrm khrm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Existing behaviour is correct. Watcher forwarder is not required, you can have a different forwarder like vector.

@pujitha24

Copy link
Copy Markdown
Contributor Author

Fair point — if logs already land in storage some other way (an external forwarder, or a LokiStack-based viewer), pushing through the Watcher too would be redundant, and leaving watcher.logs_api off by default there is correct. The conflict is with #2600 itself and the PVC example in TektonResult.md: those only set the top-level logs_api with nothing else configured to get logs in, so the feature silently never stores anything. Would you rather I drop this default and instead fix the docs to have users set watcher.logs_api explicitly, so we don't risk flipping behavior on upgrade for anyone currently relying on the existing default (e.g. LokiStack users)?

@khrm khrm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, maybe update docs. Also, watcher forwarding logs would be removed in future. That point can also be added.

… logs

Setting the top-level logs_api only enables the logs API on the Results
API server. The watcher forwards TaskRun and PipelineRun logs to it
only when its own logs_api flag is set, which defaults to false, so the
documented File/PVC example stored no logs.

Add watcher.logs_api to the TektonResult and TektonConfig examples,
explain when to set it and when another forwarder makes it
unnecessary, and note that log forwarding by the watcher is expected
to be removed in a future release.

Report: tektoncd#2600
Signed-off-by: Pujitha Paladugu <[email protected]>
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 1, 2026
@pujitha24 pujitha24 changed the title fix(tektonresult): default watcher logs_api from spec docs(tektonresult): document that watcher.logs_api is needed to store logs Oct 1, 2026
@pujitha24

Copy link
Copy Markdown
Contributor Author

@khrm Done in 688febc, which replaces the original commit. The setDefaults change and its test are gone, so the watcher default is unchanged and the PR is docs only now:

  • docs/TektonResult.md: a note under the spec example says that the top-level logs_api only enables the API server's logs API, that the watcher forwards logs only with watcher.logs_api: true (default false), that it can stay unset when another forwarder such as Vector or Fluentd with LokiStack stores the logs, and that log forwarding by the watcher is expected to be removed in a future release. The example now sets watcher.logs_api: true with a comment pointing to the note.
  • docs/TektonConfig.md: the result.watcher example sets logs_api: true with the same comment, and the logs_api row of the watcher table says the same in short.

Title and description are updated to match.

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none Denotes a PR that doesnt merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The TektonResults component cannot store logs information.

5 participants