cli
cli copied to clipboard
Add utility functions for config and home dirs
Changes
Add utils functions for getting Config and Cache dirs
Might want to also standardize the dirs on tkn rather than config using tkn and cache using tekton
Resolves #1363
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)
- [X] Run the code checkers with
make check - [X] Regenerate the manpages, docs and go formatting with
make generated - [X] Commit messages follow commit message best practices
See the contribution guide for more details.
Release Notes
Move bundle cache to XDG_CACHE_DIR
Hi @06kellyjac. 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.
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.
/assign @sthaha
/ok-to-test /assign /unassign @sthaha
Just to repeat the question from the initial post
Should I change the cache dir to tkn like the config dir to standardize things? or leave it as tekton?
https://github.com/tektoncd/cli/blob/6e25e77040467c92638ada00d21950f081269779/pkg/utils/utils.go#L27
https://github.com/tektoncd/cli/blob/6e25e77040467c92638ada00d21950f081269779/pkg/utils/utils.go#L35
Also I just noticed the docs have my user name in them because the os.GetXDir functions are already expanded :sweat_smile:
https://github.com/tektoncd/cli/blame/6e25e77040467c92638ada00d21950f081269779/docs/cmd/tkn_bundle_list.md#L40
@vdemeester: GitHub didn't allow me to request PR reviews from the following users: pierretasci.
Note that only tektoncd members and repo collaborators can review this PR, and authors cannot review their own PRs.
In response to this:
I like
tknbetter thantekton, but I'ld like for other to chim in 🙃 /cc @tektoncd/cli-maintainers @pierretasci
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.
I've added some tests. I tried to avoid changing env with os.Setenv because that could affect other tests
It looks like go 1.17 will have a t.Setenv function but that would come with the tradeoff of requiring parallel testing be disabled
https://github.com/golang/go/commit/2e794c2bb1302af764670dba894bbfe537bd63f0
The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/cli/dirs.go | Do not exist | 33.3% |
The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/cli/dirs.go | Do not exist | 33.3% |
/test pull-tekton-cli-unit-tests
/lgtm
I need to modify the contract test so it doesnt fail on windows but other than that I guess things are good.
Is there a way to ask tekton users about their preference for ~/.config vs ~/Library/Whatever on darwin?
I guess we could have it like this until people complain but then there will me the matter of migrating people across if people want it to move to ~/.config...
New changes are detected. LGTM label has been removed.
The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/cli/dirs.go | Do not exist | 33.3% |
Tests now pass on windows. Although I noticed when doing a full make test quite a few tests fail on windows :sweat_smile:
If we're happy trying out ~/Library/whatever on mac to see what people say then the only thing remaining that I'm concerned about is the docs generating differently between Linux, Mac, and Windows due to the tkn bundle list --help output having the line --cache-dir string A directory to cache Tekton bundles in. (default "~/.tekton/bundles") where default will be different
It's just going to end up with people having to manually change that back each time if they're developing on mac
or we scrub that out from the docs??
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Before merging this. I was thinking there's a way to solve the default value (which is different across platforms) going into the docs I'd like to try
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
/remove-lifecycle stale
I plan on getting back on this soon
@06kellyjac: PR needs rebase.
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.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle rotten
Send feedback to tektoncd/plumbing.
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/close
Send feedback to tektoncd/plumbing.
@tekton-robot: Closed this PR.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopenwith a justification. Mark the issue as fresh with/remove-lifecycle rottenwith a justification. If this issue should be exempted, mark the issue as frozen with/lifecycle frozenwith a justification./close
Send feedback to tektoncd/plumbing.
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.
/remove-lifecycle rotten
[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
- ~~OWNERS~~ [vdemeester]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@06kellyjac please rebase the PR
@06kellyjac: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-tekton-cli-unit-tests | d987c52cc56cce0ab3cacfe6cd7315528a7f524e | link | true | /test pull-tekton-cli-unit-tests |
| pull-tekton-cli-integration-tests | d987c52cc56cce0ab3cacfe6cd7315528a7f524e | link | true | /test pull-tekton-cli-integration-tests |
| pull-tekton-cli-build-tests | d987c52cc56cce0ab3cacfe6cd7315528a7f524e | link | true | /test pull-tekton-cli-build-tests |
| pull-tekton-cli-build-cross-tests | d987c52cc56cce0ab3cacfe6cd7315528a7f524e | link | true | /test pull-tekton-cli-build-cross-tests |
Full PR test history. Your PR dashboard.
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. I understand the commands that are listed here.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle rotten
Send feedback to tektoncd/plumbing.
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/close
Send feedback to tektoncd/plumbing.
@tekton-robot: Closed this PR.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopenwith a justification. Mark the issue as fresh with/remove-lifecycle rottenwith a justification. If this issue should be exempted, mark the issue as frozen with/lifecycle frozenwith a justification./close
Send feedback to tektoncd/plumbing.
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.