-
Notifications
You must be signed in to change notification settings - Fork 432
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
Let cache.name
override cache slug name we compute
#1265
Conversation
So that the jobs within a build can share caches arbitrarily. It is not possible to put this change in `Travis::Build::Script#cache_slug`, since multiple modules may call this with `super`; in such cases the end cache name will be different from what is given in `cache.name`.
See https://staging.travis-ci.org/BanzaiMan/travis_staging_test/builds/667279 for an example build. |
This resolves travis-ci/travis-ci#7590. |
@BanzaiMan any ETA of this feature? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For documentation/clarity/maybe-just-for-me, can you list what part of the cache object key will remain consistent even when using cache.name
?
All other The example configuration used in the test above is: cache:
bundler: true
name: shared
stages:
- set up cache
- test
rvm:
- '2.4'
- '2.3'
jobs:
include:
- stage: set up cache This runs the "Set up cache" stage first (which creates The configurations that need change are those of the form: cache: bundler but the change would be consistent with other cache configurations, in that it will be transformed into: cache:
bundler: true
name: shared The caveat with cache corruption remains. This needs to be documented well. |
@BanzaiMan Do I understand correctly that each cache will continue to be created under a repository-specific "namespace", regardless of the given cache:
name: "../../../dastardly-nefarious" |
@BanzaiMan ooooh, and what about URI-encoding the name? cache:
name: "very/special?!cache&name%" |
@meatballhat |
It is worth testing, for sure. |
@meatballhat We normalize the cache names:
|
@BanzaiMan Yep, my concern wasn't with local file path traversal, but potentially poisoning or stealing a cache from a different repository. |
It just occurred to me. Another consideration we might add for the future is the |
Hello, imagine I have first stage with 2 concurrent jobs. Later I have second stages which aggregates caches from first stage. Does this PR will help me when merged or there's another already working solution? |
Whats the status here @BanzaiMan? :) |
Hello @BanzaiMan , how can we help to have this merged? Thanks! |
There's this issue travis-ci/travis-ci#7590 where Travis intentionally does not reuse the cache for jobs with different environment variables. A pull request travis-ci/travis-build#1265 is open for a few months so I decided to go the other route and avoid using environment variables, which I discovered to be possible when reading several repositories and finally finding ReactiveCollections, from which I copied and adapted the travis and build scripts.
There's this issue travis-ci/travis-ci#7590 where Travis intentionally does not reuse the cache for jobs with different environment variables. A pull request travis-ci/travis-build#1265 is open for a few months so I decided to go the other route and avoid using environment variables, which I discovered to be possible when reading several repositories and finally finding ReactiveCollections, from which I copied and adapted the travis and build scripts.
There's this issue travis-ci/travis-ci#7590 where Travis intentionally does not reuse the cache for jobs with different environment variables. A pull request travis-ci/travis-build#1265 is open for a few months so I decided to go the other route and avoid using environment variables, which I discovered to be possible when reading several repositories and finally finding ReactiveCollections, from which I copied and adapted the travis and build scripts.
There's this issue travis-ci/travis-ci#7590 where Travis intentionally does not reuse the cache for jobs with different environment variables. A pull request travis-ci/travis-build#1265 is open for a few months so I decided to go the other route and avoid using environment variables, which I discovered to be possible when reading several repositories and finally finding ReactiveCollections, from which I copied and adapted the travis and build scripts.
There's this issue travis-ci/travis-ci#7590 where Travis intentionally does not reuse the cache for jobs with different environment variables. A pull request travis-ci/travis-build#1265 is open for a few months so I decided to go the other route and avoid using environment variables, which I discovered to be possible when reading several repositories and finally finding ReactiveCollections, from which I copied and adapted the travis and build scripts. Ran `travis setup releases` and signed in with GitHub to generate a new personal access token and have it encrypted. Reference: travis-ci/travis-ci#2457
There's this issue travis-ci/travis-ci#7590 where Travis intentionally does not reuse the cache for jobs with different environment variables. A pull request travis-ci/travis-build#1265 is open for a few months so I decided to go the other route and avoid using environment variables, which I discovered to be possible when reading several repositories and finally finding ReactiveCollections, from which I copied and adapted the travis and build scripts. Ran `travis setup releases` and signed in with GitHub to generate a new personal access token and have it encrypted. Reference: travis-ci/travis-ci#2457
There's this issue travis-ci/travis-ci#7590 where Travis intentionally does not reuse the cache for jobs with different environment variables. A pull request travis-ci/travis-build#1265 is open for a few months so I decided to go the other route and avoid using environment variables, which I discovered to be possible when reading several repositories and finally finding ReactiveCollections, from which I copied and adapted the travis and build scripts. Ran `travis setup releases` and signed in with GitHub to generate a new personal access token and have it encrypted. Reference: travis-ci/travis-ci#2457
There's this issue travis-ci/travis-ci#7590 where Travis intentionally does not reuse the cache for jobs with different environment variables. A pull request travis-ci/travis-build#1265 is open for a few months so I decided to go the other route and avoid using environment variables, which I discovered to be possible when reading several repositories and finally finding ReactiveCollections, from which I copied and adapted the travis and build scripts. Ran `travis setup releases` and signed in with GitHub to generate a new personal access token and have it encrypted. Reference: travis-ci/travis-ci#2457
We'll have a more comprehensive look at this problem. |
So that the jobs within a build can share caches arbitrarily.
It is not possible to put this change in
Travis::Build::Script#cache_slug
, since multiple modules may callthis with
super
; in such cases the end cache name will be differentfrom what is given in
cache.name
.