Skip to content
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 GitHub? Sign in to your account

Add github-add-comment version 0.3 #664

Merged

Conversation

vinamra28
Copy link
Member

Changes

As of now github-add-comment task supports input of comments only via
params.

This PR adds support of workspaces if in case somebody wants to provide
the comments via some file. One such use case can be:-
In Catlin CI, logs are produced after executing catlin command on
changed files which can contain multiple warnings and these warnings can
be ingored by the user if not posted on the github PR as the CI is
green. So all the logs would be stored in a file with proper formatting
and then the shared workspace can be passed to the github-add-comment
task along with the filename containing the formatted logs.

Signed-off-by: vinamra28 vinjain@redhat.com

Submitter Checklist

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

  • Includes docs (if user facing)
  • Includes tests (if functionality of task changed or new task added)
  • Commit messages follow commit message best practices
  • Complies with Catalog Organization TEP, see example. Note An issue has been filed to automate this validation
    • File path follows <kind>/<name>/<version>/name.yaml

    • Has README.md at <kind>/<name>/<version>/README.md

    • Has mandatory metadata.labels - app.kubernetes.io/version the same as the <version> of the resource

    • Has mandatory metadata.annotations tekton.dev/pipelines.minVersion

    • mandatory spec.description follows the convention

        ```
      
        spec:
          description: >-
            one line summary of the resource
      
            Paragraph(s) to describe the resource.
        ```
      

See the contribution guide
for more details.


@tekton-robot tekton-robot requested review from a user and vdemeester March 5, 2021 14:10
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 5, 2021
@vinamra28
Copy link
Member Author

/cc @chmouel
/test .*

@chmouel
Copy link
Member

chmouel commented Mar 10, 2021

Don't we want optional workspace instead of optional params?

@vinamra28
Copy link
Member Author

Don't we want optional workspace instead of optional params?

I am very bad at python 😞 so don't know how to check whether workspace is bound or not 😅. So I did a workaround by adding one more step that will check whether file is passed or it's a comment. In any of the case it will be moved to a file comment_private.txt and in python script I am going to read that file and post the file contents as a comment.

@ghost
Copy link

ghost commented Mar 10, 2021

how to check whether workspace is bound or not

In your script I think it would look like:

if "$(workspaces.foo.bound)" == "true":

@vinamra28
Copy link
Member Author

how to check whether workspace is bound or not

In your script I think it would look like:

if "$(workspaces.foo.bound)" == "true":

ohh... I thought it would be handled other way. Thanks @sbwsg 👍

@vinamra28 vinamra28 force-pushed the vinamra28/add-github-comment-0.3 branch from 1b7b308 to 968ff26 Compare March 11, 2021 08:14
As of now github-add-comment task supports input of comments only via
params.

This PR adds support of workspaces if in case somebody wants to provide
the comments via some file. One such use case can be:-
In Catlin CI, logs are produced after executing catlin command on
changed files which can contain multiple warnings and these warnings can
be ingored by the user if not posted on the github PR as the CI is
green. So all the logs would be stored in a file with proper formatting
and then the shared workspace can be passed to the github-add-comment
task along with the filename containing the formatted logs.

Signed-off-by: vinamra28 <vinjain@redhat.com>
@vinamra28 vinamra28 force-pushed the vinamra28/add-github-comment-0.3 branch from 968ff26 to ae0f0ec Compare March 11, 2021 14:25
@chmouel
Copy link
Member

chmouel commented Mar 15, 2021

/lgtm

thanks

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 15, 2021
@PuneetPunamiya
Copy link
Member

/lgtm

@chmouel
Copy link
Member

chmouel commented Mar 16, 2021

/lgtm
/approve

🥳

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chmouel

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 Mar 16, 2021
@tekton-robot tekton-robot merged commit 2da900b into tektoncd:master Mar 16, 2021
@vinamra28 vinamra28 deleted the vinamra28/add-github-comment-0.3 branch March 17, 2021 02:05
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants