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

Refactor Resource result output, and add support for Git resources. #1424

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Oct 14, 2019

Changes

This change builds upon #1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:

  • Removing custom TerminationMessagePath from the Image resource. The default is fine.
  • Test cleanup.
  • A new helper to write termination messages from resource containers.

And finally, this adds a new environment variable to the git resource steps, indicating the
name of the resource instance they are running as. We should make this more generic and apply
it to all resource steps as part of the extensiblity refactor.

Submitter Checklist

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

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

The 'Git' PipelineResource now populates the taskRun.status.resourcesResult field with the commit used.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Oct 14, 2019
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 14, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.5% 86.2% -1.3
pkg/reconciler/taskrun/taskrun.go 71.6% 73.6% 1.9
test/builder/container.go 86.8% 91.7% 4.8

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.5% 86.2% -1.3
pkg/reconciler/taskrun/taskrun.go 71.6% 73.6% 1.9
test/builder/container.go 86.8% 91.7% 4.8

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

/lgtm

some minor nits but i don't see any showstoppers.

cmd/git-init/main.go Outdated Show resolved Hide resolved
docs/resources.md Outdated Show resolved Hide resolved
c := exec.Command("git", args...)
var output bytes.Buffer
c.Stderr = &output
c.Stdout = &output
if dir != "" {
c.Dir = dir
Copy link

Choose a reason for hiding this comment

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

nit: I'm a bit unclear why the assignment is wrapped in an if. What is c.Dirat this point and what are we protecting against with the if?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Clarified with a comment.

test/kaniko_task_test.go Outdated Show resolved Hide resolved
@tekton-robot tekton-robot assigned ghost Oct 16, 2019
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2019
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2019
@dlorenc
Copy link
Contributor Author

dlorenc commented Oct 16, 2019

some minor nits but i don't see any showstoppers.

Thanks! Ready for another look.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.5% 86.2% -1.3
pkg/reconciler/taskrun/taskrun.go 71.6% 73.6% 1.9
test/builder/container.go 86.8% 91.7% 4.8

@ghost
Copy link

ghost commented Oct 16, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2019
Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

one tiny nit otherwise LGTM!

cmd/termination/termination.go Outdated Show resolved Hide resolved
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.5% 86.2% -1.3
pkg/reconciler/taskrun/taskrun.go 71.6% 73.6% 1.9
test/builder/container.go 86.8% 91.7% 4.8

Copy link
Member

@dibyom dibyom 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 Oct 16, 2019
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.

@dlorenc thanks, looks good, just one question on the cmd/termination package 👼

See the License for the specific language governing permissions and
limitations under the License.
*/
package termination
Copy link
Member

Choose a reason for hiding this comment

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

Any reason for this package being in cmd/* instead of pkg/* ?
Usually we make the assumption that any package cmd/foo produce a binary called foo, which is not the case for this one (as there is no main).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is basically a library only for command binaries so I was trying to colocate it here, but it seems like that's a little unclear. I'll move it.

This change builds upon tektoncd#1406, and logs the exact Git commit used by a Git input
to the ResourceResults field.

Some other cleanups are included:
- Removing custom TerminationMessagePath from the Image resource. The default is fine.
- Test cleanup.
- A new helper to write termination messages from resource containers.

And finally, this adds a new environment variable to the git resource steps, indicating the
name of the resource instance they are running as. We should make this more generic and apply
it to all resource steps as part of the extensiblity refactor.
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/image_exporter.go 87.5% 86.2% -1.3
pkg/reconciler/taskrun/taskrun.go 70.5% 72.4% 1.9
test/builder/container.go 86.8% 91.7% 4.8

@dlorenc
Copy link
Contributor Author

dlorenc commented Oct 17, 2019

/test pull-tekton-pipeline-build-tests

@ghost
Copy link

ghost commented Oct 17, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2019
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
Copy link
Collaborator

[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 Oct 17, 2019
@tekton-robot tekton-robot merged commit ea94852 into tektoncd:master Oct 17, 2019
This pull request was closed.
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. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants