Improve syntax for artifact.sync config [1/3]#1847
Improve syntax for artifact.sync config [1/3]#1847balopat merged 10 commits intoGoogleContainerTools:masterfrom
Conversation
b4b1960 to
7341dbe
Compare
Codecov Report
@@ Coverage Diff @@
## master #1847 +/- ##
==========================================
+ Coverage 56.18% 56.27% +0.09%
==========================================
Files 180 180
Lines 7771 7781 +10
==========================================
+ Hits 4366 4379 +13
+ Misses 2988 2987 -1
+ Partials 417 415 -2
Continue to review full report at Codecov.
|
1a30aff to
f6808e9
Compare
ffa083a to
3f0a875
Compare
0ca1bbb to
43ec0e6
Compare
43ec0e6 to
3a0ffc0
Compare
3a0ffc0 to
8da745a
Compare
|
@tejal29 As you were shepherd of the design proposal, you might also want to take a look at this :) |
|
Thanks @corneliusweig I was waiting for Design proposal to merge in. |
| dest: /etc | ||
| - src: 'static-html/*.html' | ||
| dest: static | ||
| - src: '**/*.png' |
There was a problem hiding this comment.
A comment on what the intended behavior is
There was a problem hiding this comment.
I've added some comments. Please have a look if this is what you intended. I'm not sure whether I like those comments, though. After all, each rule is explained further below. But I trust you have a better feeling for what's appropriate here.
| { | ||
| Src: "src/**/*.js", | ||
| Dest: ".", | ||
| Strip: "src/", |
There was a problem hiding this comment.
Can we add a test case where ?
{
Src: "srcsomeother/**/*.js",
Dest: ".",
Strip: "src",
}
Hey @tejal29 , thanks for giving this such high priority! Very much appreciated! |
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
|
@tejal29 nits done. PTAL |
priyawadhwa
left a comment
There was a problem hiding this comment.
LGTM, just a couple docs/warning suggestions
| A manual sync rule must specify the `src` and `dest` field. | ||
| The `src` field is a glob pattern to match files relative to the artifact _context_ directory, which may contain `**` to match nested files. | ||
| The `dest` field is the destination location in the container. | ||
| It may be absolute or relative, in which case files are put below the container's `WORKDIR`. |
There was a problem hiding this comment.
Just for clarity, I would rephrase this as Destination paths may be absolute or relative. If the destination is a relative path, an absolute path will be inferred by prepending the path with the container's WORKDIR
| ) | ||
|
|
||
| const ( | ||
| incompatibleSyncWarning = `the semantics of the sync rules has changed, the folder structure is not flattened anymore but preserved, the likely impacted patterns in your skaffold yaml are: %s` |
There was a problem hiding this comment.
Might be nice to provide a link to the docs here so people can easily find the new sync rules
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
|
@priyawadhwa Thanks for your valuable input! PTAL |
|
Thanks @corneliusweig, i have brought this to this week's release master's attention :) |
|
@tejal29 Unless I completely misunderstood you, you hit the wrong button ;) |
|
haha, I think it was accidental :D |
|
Please visit http://35.236.32.215:1313 to view changes to the docs. |
balopat
left a comment
There was a problem hiding this comment.
LGTM, thank you for your hard work and patience on this.
One thought for the next PRs: maybe we could name our new map[string][]string as syncMap
|
@balopat Oh, it was a pleasure (most of the time :) About |
|
I'm rerunning kokoro - this seems to be a flake... if it is, I'll open a bug. |
I'd keep it in |
|
What a thriller, these integration tests... |
|
#2100 for the flake |
) * Improved pipeline config for artifact.sync Currently, the pipeline config is a map of local glob pattern to destination directory. This scheme has been extended with some magic sequences, making it difficult to understand. This commit converts the sync map into a list of sync rules. All sync rules are consulted to determine the destination paths. This prepares for further changes to the sync logic. Also see GoogleContainerTools#1844 * Update sync spec config according to design proposal - Wrap sync-rules under key 'sync.manual' - Config changes: - from -> src - to -> dest - flatten option removed and warn during schema upgrade if an incompatible pattern is migrated to the new schema version * Add validation for sync rules * Migrate sync config to new schema version * Update filesync documentation Extract example into sample snippet in order to have it tested. * Run validation on doc examples * Review comments: add test case and clarify example in docs * Improve doc and error message wording Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
Currently, the pipeline config is a map of local glob pattern to destination directory. This scheme has been extended with some magic sequences, making it difficult to understand. This commit converts the sync map into a list of sync rules. All sync rules are considered to determine the destination paths.
This is the first step of sync improvements as detailed out in the design proposal #1844.
Extracted from #1812
Close #1180
CC design shepherd @tejal29