Skip to content

Conversation

@ab-ghosh
Copy link
Member

Changes

Added additional formatting options such as --prefix for tkn p logs, which prefixes each log line with the task name and step name to match the output format of tkn pr logs. This is done to resolve issue #2223 .

Submitter Checklist

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

  • Includes tests (if functionality changed/added)
  • Run the code checkers with make check
  • Regenerate the manpages, docs and go formatting with make generated
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

…default

Signed-off-by: Abhishek Ghosh <abhi.ghosh3108@gmail.com>
@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Mar 26, 2025
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 26, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 26, 2025
@tekton-robot
Copy link
Contributor

Hi @abhishek-ghosh-codes. 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.

Details

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 tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 26, 2025
@chmouel
Copy link
Member

chmouel commented Mar 26, 2025

/lgtm
/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. lgtm Indicates that a PR is ready to be merged. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 26, 2025
@PuneetPunamiya
Copy link
Member

/test pull-tekton-cli-integration-tests

@ab-ghosh
Copy link
Member Author

ab-ghosh commented Apr 1, 2025

/test pull-tekton-cli-build-tests

@ab-ghosh ab-ghosh force-pushed the feature/tkn-p-logs branch from 3135e5e to cfca172 Compare April 1, 2025 09:45
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 1, 2025
@pratap0007
Copy link
Contributor

Hi @abhishek-ghosh-codes, Thanks for the pull request, and can you please add a unit test?

@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 10, 2025
@ab-ghosh ab-ghosh force-pushed the feature/tkn-p-logs branch from a911e07 to cfca172 Compare April 13, 2025 19:24
@tekton-robot tekton-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 13, 2025
Signed-off-by: Abhishek Ghosh <abhi.ghosh3108@gmail.com>
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 15, 2025
@aThorp96
Copy link
Member

/retest

@aThorp96
Copy link
Member

@abhishek-ghosh-codes most of the "error" lines in the integration tests are red herrings I believe; they seem to be expected to fail but Prow doesn't render that very well.

However it looks like the test Validate pipeline logs, with follow mode (-f) and --last is failing since it's output is changed by this PR. I believe the following diff should fix the test:

diff --git c/test/e2e/pipeline/start_test.go i/test/e2e/pipeline/start_test.go
index f8ba360a5..b91b7fcce 100644
--- c/test/e2e/pipeline/start_test.go
+++ i/test/e2e/pipeline/start_test.go
@@ -78,7 +78,7 @@ func TestPipelineInteractiveStartE2E(t *testing.T) {
        })

        t.Run("Validate pipeline logs, with  follow mode (-f) and --last ", func(t *testing.T) {
-               res := tkn.Run(t, "pipeline", "logs", "--last", "-f")
+               res := tkn.Run(t, "pipeline", "logs", "--last", "-f", "--prefix=false")
                expected := "\n\ntest-e2e\n\n"
                helper.AssertOutput(t, expected, res.Stdout())
        })

@aThorp96
Copy link
Member

/retest-required

Signed-off-by: Abhishek Ghosh <abhi.ghosh3108@gmail.com>
@ab-ghosh ab-ghosh force-pushed the feature/tkn-p-logs branch from c128942 to 65e88e9 Compare May 14, 2025 04:34
@ab-ghosh
Copy link
Member Author

/retest

1 similar comment
@divyansh42
Copy link
Member

/retest

@pratap0007
Copy link
Contributor

/lgtm

@tekton-robot
Copy link
Contributor

@pratap0007: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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.

@pratap0007
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 2, 2025
Copy link
Member

@divyansh42 divyansh42 left a comment

Choose a reason for hiding this comment

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

/lgtm

@aThorp96
Copy link
Member

aThorp96 commented Jun 2, 2025

/cc @chmouel @pradeepitm12

@tekton-robot tekton-robot requested a review from pradeepitm12 June 2, 2025 15:19
@pratap0007
Copy link
Contributor

@vinamra28 Can you please review and merge this?

Copy link
Member

@vinamra28 vinamra28 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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyansh42, vinamra28

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

The pull request process is described 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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2025
@tekton-robot tekton-robot merged commit 94b33e3 into tektoncd:main Jun 5, 2025
7 of 8 checks passed
vinamra28 added a commit that referenced this pull request Jul 14, 2025
#2548 | [dependabot[bot]] Bump the go-docker-dependencies group with 2 updates | 2025/05/30-06:18
#2544 | [vinamra28] Update CLI docs for tkn v0.41.0 | 2025/05/30-07:58
#2525 | [Abhishek Ghosh] Add flag to prefix log lines with log source (task and step name) by default | 2025/06/05-16:57
#2525 | [Abhishek Ghosh] updated the docs | 2025/06/05-16:57
#2525 | [Abhishek Ghosh] Add unit test scripts | 2025/06/05-16:57
#2525 | [Abhishek Ghosh] Adjust pipeline logs test to align with updated output format | 2025/06/05-16:57
#2549 | [dependabot[bot]] Bump the go-docker-dependencies group with 2 updates | 2025/06/10-10:07
#2553 | [Chmouel Boudjnah] fix: update Pending color of PipelineRunPending | 2025/06/11-14:51
#2552 | [dependabot[bot]] Bump github.com/cloudflare/circl from 1.3.7 to 1.6.1 | 2025/06/13-06:33
#2556 | [divyansh42] Fix deadlock issue when following logs | 2025/06/23-17:15
null | [dependabot[bot]] Bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0 in /tools | 2025/06/30-07:27

Signed-off-by: vinamra28 <vinjain@redhat.com>
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants