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

Make jib-gradle and jib-maven future-proof regarding Tekton $HOME deprecation #407

Merged
merged 1 commit into from
Jul 22, 2020
Merged

Make jib-gradle and jib-maven future-proof regarding Tekton $HOME deprecation #407

merged 1 commit into from
Jul 22, 2020

Conversation

chanseokoh
Copy link
Contributor

Changes

@sbwsg

As Tekton prepares for /tekton/home deprecation (with the disable-home-env-overwrite and disable-working-directory-overwrite switches), these changes make jib-gradle and jib-maven tasks compatible with the current Tekton release and future releases that will flip the switches.

I've verified these work before and after flipping the deprecation switches.

Submitter Checklist

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

There are yamllint violations mostly due to different array element indentation, but I decided not to take care of this after finding out it makes really difficult to diff changes on GitHub.

See the contribution guide
for more details.

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 10, 2020
@chanseokoh
Copy link
Contributor Author

/assign @sbwsg

@tekton-robot tekton-robot assigned ghost Jul 10, 2020
-Djib.allowInsecureRegistries=$(params.INSECUREREGISTRY) \
-Djib.to.image=$(resources.outputs.image.url)
workingDir: $(workspaces.source.path)/$(params.DIRECTORY)
env:
- name: HOME
value: /workspace
Copy link
Contributor

Choose a reason for hiding this comment

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

any information on why /workspace?

and what is the ${workspaces.source.path} in workingDir (line 49)?

Copy link
Contributor Author

@chanseokoh chanseokoh Jul 10, 2020

Choose a reason for hiding this comment

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

/workspace (the filesystem directory) is the directory that the current Tekton releases use as a general space for work. Tekton docs do specify this directory in their examples.

source in $(workspaces.source.path) is the name defined in line 17. There is a "Workspace" concept in Tekton, and source is a name given to a "Workspace". $(workspaces.source.path) evaluates to the path of this "Workspace". In our Task definition, this "source workspace" is where this Task should find Java source to containerize, hence setting the current working directory to it. In practice, this directory is /workspace/source.

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2020
@ghost
Copy link

ghost commented Jul 10, 2020

I've verified these work before and after flipping the deprecation switches.

Fantastic, thanks for testing that out! 👍

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 11, 2020
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: loosebazooka, sbwsg

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 removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 13, 2020
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.

So, if we follow the TEP-003 closely, this might be worth a 0.2 version. That said, the TEP is still in proposed phase, and those were just added so.. I think we can merge as is.

/cc @sthaha @PuneetPunamiya

@chanseokoh
Copy link
Contributor Author

@sbwsg when can I expect this to be merged?

@ghost
Copy link

ghost commented Jul 22, 2020

I've approved it but it needs someone else to look it over and give it an lgtm. @loosebazooka , @briandealwis can both do that I think if I'm reading https://github.com/tektoncd/catalog/blob/master/task/jib-gradle/0.1/OWNERS right

@loosebazooka
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2020
@loosebazooka
Copy link
Contributor

So now I have to merge it?

@ghost
Copy link

ghost commented Jul 22, 2020

The tekton-bot should merge it automatically I believe.

@ghost
Copy link

ghost commented Jul 22, 2020

Hm, this PR is in the tide merge pool but it appears to be having some trouble: https://prow.tekton.dev/tide-history?repo=tektoncd%2Fcatalog&branch=master

failed merging [407]: [PR is unmergable. Do the Tide merge requirements match the GitHub settings for the repo? This branch can't be rebased]

@ghost
Copy link

ghost commented Jul 22, 2020

@chanseokoh can you try manually rebasing on top of the master branch and pushing again?

@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2020
@ghost
Copy link

ghost commented Jul 22, 2020

Re-adding the recent lgtm label

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2020
@loosebazooka
Copy link
Contributor

/lgtm

@chanseokoh
Copy link
Contributor Author

Merge failing for the same reason . I only merged upstream/master, but this time, let me completely reset the branch on top of the upstream master.

- Set HOME env to /workspace
- Use $HOME for "home" wherever possible
- Gradle: mount empty dir at ~/.gradle to make it globally writable
- Maven: script to `script:` to use "$HOME" variable
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2020
@ghost
Copy link

ghost commented Jul 22, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2020
@tekton-robot tekton-robot merged commit f5a4936 into tektoncd:master Jul 22, 2020
@chanseokoh chanseokoh deleted the future-proof-home branch July 22, 2020 18:59
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/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.

4 participants