-
Notifications
You must be signed in to change notification settings - Fork 224
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
Leading directories unwantedly preserved with copy/move #23
Comments
@jgeorgeson, |
I don't actually want to flatten as I have Eclipse P2 repositories under the base#-sub# folders. Each base#-sub# will have a number of CI builds plus the P2 composite index files. I want the equivalent to a regular local filesystem copy/move. The placeholders option is awesome, have they always been there? |
Yes @jgeorgeson, placeholders are supposed from version 1.0.0 and the new File Specs introduced in 1.5.0 also support placeholders. |
@jgeorgeson, with your permission, I'm closing this issue. |
So the type of copy/move operation I'm trying to perform is not possible? I want this
To instead be this
without using flat, as I want to preserve the full recursive structure of the contents of the from path. |
@jgeorgeson, the nicel thing about placeholders is that they can capture a complete hierarchy of directories in the source path, allowing you to use this hierarchy in the target path. You can also capture two sections of a path, even when one section is inside the other one. For example, this pattern; In your senario , you are actually trying to change the path structure and do it recursively. Your scenario might be a bit trickier to achieve with one command, and you might need to use multiple copy commands, each one for a slightly different path. Please let know what you ended up using eventually. |
I can't find anything that works other than not using the CLI at all, and directly making REST API calls instead. For example
Works just as a local OS |
@jgeorgeson, we want to help you achieve what you need and are open to suggestions and improvements. |
I have contacted support and the response there was basically the same as here. However they asked why I believed the CLI and REST API exhibit different behavior. Which indicates to me that the nature of what I'm asking for isn't understood. So I did some more local testing. It turns out that the CLI handles the copy and move commands differently depending on if you have a trailing slash or not. No trailing slash, does exactly what I've been asking for
Trailing slash, preserves the leading path at the destination (what I'm asking how to avoid)
Unfortunately, using placeholders causes the no-trailing-slash command to do nothing. $ jfrog rt move "test-deploy-snapshots/test/(base*)-(sub*)" "test-deploy-snapshots/{1}/{2}"
[Info:] Searching Artifactory using AQL query: items.find({"repo": "test-deploy-snapshots","$or": [{"$and": [{"path": {"$match":"test"},"name":{"$match":"base*-sub*"}}]},{"$and": [{"path": {"$match":"test/base*"},"name":{"$match":"*-sub*"}}]},{"$and": [{"path": {"$match":"test//base*-sub*"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","size")
[Info:] Artifactory response: 200 OK
[Info:] Found 0 artifacts.
[Info:] Moved 0 artifacts in Artifactory
$ jfrog rt search test-deploy-snapshots/test/
[Info:] Searching Artifactory using AQL query: items.find({"repo": "test-deploy-snapshots","$or": [{"$and": [{"path": {"$match":"test"},"name":{"$match":"*"}}]},{"$and": [{"path": {"$match":"test/*"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","size")
[Info:] Artifactory response: 200 OK
[Info:] Found 15 artifacts.
[
{
"path": "test-deploy-snapshots/test/base1-sub1/base1-sub1/index.xml"
},
{
"path": "test-deploy-snapshots/test/base1-sub1/base1-sub1/plugins/plugin1.jar"
},
{
"path": "test-deploy-snapshots/test/base1-sub1/base1-sub1/plugins/plugin2.jar"
},
{
"path": "test-deploy-snapshots/test/base1-sub2/index.xml"
},
{
"path": "test-deploy-snapshots/test/base1-sub2/plugins/plugin1.jar"
},
{
"path": "test-deploy-snapshots/test/base1-sub2/plugins/plugin2.jar"
},
{
"path": "test-deploy-snapshots/test/base2-sub1/index.xml"
},
{
"path": "test-deploy-snapshots/test/base2-sub1/plugins/plugin1.jar"
},
{
"path": "test-deploy-snapshots/test/base2-sub1/plugins/plugin2.jar"
},
{
"path": "test-deploy-snapshots/test/base2-sub2/index.xml"
},
{
"path": "test-deploy-snapshots/test/base2-sub2/plugins/plugin1.jar"
},
{
"path": "test-deploy-snapshots/test/base2-sub2/plugins/plugin2.jar"
},
{
"path": "test-deploy-snapshots/test/base2-sub3/index.xml"
},
{
"path": "test-deploy-snapshots/test/base2-sub3/plugins/plugin1.jar"
},
{
"path": "test-deploy-snapshots/test/base2-sub3/plugins/plugin2.jar"
}
] |
Please re-open this issue. I am experiencing the same behavior as @jgeorgeson. The below is only lightly sanitized (
Notice how rather than moving between repositories and retaining the same path in each (as I would expect to happen given how the placeholders are being used), the path is "doubled" - we go from Is |
This may be a regression introduced in 1.8.0 as we did not experience this behavior in 1.7.2. |
Thanks for reporting this @thashepherd. We will investigate this soon and reply back. |
@thashepherd , we did a comparison of the move command between 1.8.0 and version 1.7.1, as far as we can see they are both working as expected. |
@TamirHadad and @eyalbe4, thank you for the rapid response! I can verify that Are you sure there wasn't a change in default behavior? I did not need to pass that flag until after I upgraded to the 1.8.0 executable; in other words, the old behavior without |
Hi @thashepherd, |
@eyalbe4 thanks again for giving this your consideration. I've freshly downloaded versions 1.7.1 and 1.8.0 of the jfrog CLI and conducted a test. I think I've isolated what changed: we use the 1.7.1
1.8.0
(If you're wondering about the hanging hyphen at the end of the artifact's name, that's due to some of the changes elsewhere in our infrastructure since version 0.3.4 of that package was published, and shouldn't materially affect the results of the test) |
Thanks for isolating this @thashepherd! |
I'm also seeing 1.8.0 as having lost the desired functionality which worked when leaving the trailing slash off the source path (detailed in my previous comment on Nov 16). [jgeorgeson@alfred: /d01/sandboxes/jgeorgeson/git/releng/svn-to-git (master *)]
$ ~/Downloads/jfrog-cli-1.7.1-linux-amd64 rt mv --dry-run=true test-deploy-snapshots/subgit-3.2.4/lib/licenses test-deploy-snapshots/subgit-3.2.4/
[Info] [Dry run] Moving artifact: test-deploy-snapshots/subgit-3.2.4/lib/licenses to: test-deploy-snapshots/subgit-3.2.4/licenses
[Info] Moved 1 artifacts.
[jgeorgeson@alfred: /d01/sandboxes/jgeorgeson/git/releng/svn-to-git (master *)]
$ cp ~/.jfrog/jfrog-cli.conf ~/.jfrog/jfrog-cli.conf-pre18
[jgeorgeson@alfred: /d01/sandboxes/jgeorgeson/git/releng/svn-to-git (master *)]
$ mv ~/.jfrog/jfrog-cli.conf.save ~/.jfrog/jfrog-cli.conf
[jgeorgeson@alfred: /d01/sandboxes/jgeorgeson/git/releng/svn-to-git (master *)]
$ ~/Downloads/jfrog-cli-1.8.0-linux-amd64 rt mv --dry-run=true test-deploy-snapshots/subgit-3.2.4/lib/licenses test-deploy-snapshots/subgit-3.2.4/
[Info] Searching artifacts...
[Info] Found 0 artifacts.
[Info] Moved 0 artifacts. |
@thashepherd and @jgeorgeson, After thoroughly testing this, we indeed see behavior change in version 1.8.0. Here are the new conventions enforced by the new committed code:
|
Thanks @eyalbe4 Do you have anything like a beta channel on bintray that we could download/test with? |
@jgeorgeson, |
Thanks. I will try and grab it tomorrow. So no beta channels on Bintray? Might be a good feature to add there. |
Hi @jgeorgeson, |
Sorry to drag this out some more, but I don't think 1.9.0 is doing what we had in <= 1.7.x. With the older version the move command below would have created [jgeorgeson@alfred: /d01/sandboxes/jgeorgeson/git/releng/svn-to-git (master)]
$ jfrog -v
jfrog version 1.9.0
[jgeorgeson@alfred: /d01/sandboxes/jgeorgeson/git/releng/svn-to-git (master)]
$ jfrog rt mv --dry-run=true test-deploy-snapshots/subgit-3.2.4/lib/licenses test-deploy-snapshots/subgit-3.2.4/
[Info] Searching artifacts...
[Info] Found 1 artifact.
[Info] [Dry run] Create path: test-deploy-snapshots/subgit-3.2.4/subgit-3.2.4/lib/
[Info] [Dry run] Moving artifact: test-deploy-snapshots/subgit-3.2.4/lib/licenses/ to: test-deploy-snapshots/subgit-3.2.4/subgit-3.2.4/lib/
[Info] Moved 1 artifacts. I can go in via the GUI, right-click on And it does what I want to be able to do with the CLI. Leaving the trailing slash off both source and destination seems take an even more bizarre approach [jgeorgeson@alfred: /d01/sandboxes/jgeorgeson/git/releng/svn-to-git (master)]
$ jfrog rt mv test-deploy-snapshots/subgit-3.2.4/lib/licenses test-deploy-snapshots/subgit-3.2.4
[Info] Searching artifacts...
[Info] Found 1 artifact.
[Info] Moving artifact: test-deploy-snapshots/subgit-3.2.4/lib/licenses/ to: test-deploy-snapshots/subgit-3.2.4/lib/subgit-3.2.4
[Info] Moved 1 artifacts. |
You're right @jgeorgeson, |
I guess I'm misreading the new conventions then, I read
As being the old behavior but my testing and your reply confirm it is not. So if I'm seeing it correctly now I need to use |
You're correct @jgeorgeson. |
@eyalbe4 Apologies in the delay in responding to you. We've recently upgraded all the way to 1.10.2 (to resolve some checksum calculation issues) and I can confirm that the original behavior has been restored; we were able to remove the |
@jgeorgeson and @thashepherd, |
I will test again. The last time I tried I still couldn't get it straight and modified my scripts to use REST API directly. |
Eyal,
Your fix worked and I've rolled it out to our production boxes along with
the new CLI version.
Let me know if you'd like to sneak a peek at code samples or our changes
around this.
Thanks for your help!
- Matt
…On Tue, Oct 10, 2017 at 10:54 AM, Justin ***@***.***> wrote:
I will test again. The last time I tried I still couldn't get it straight
and modified my scripts to use REST API directly.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AArbK22whK0rRkcgPIsvEpwP2vKuo-8aks5sq4UygaJpZM4KJiGZ>
.
|
Happy to hear this @thashepherd! |
Absolutely! To provide some context, my company executes builds using Gitlab CI pipelines; 'pipelines' - builds - are defined by a .gitlab-ci.yml file at the root of the repository. Common functionality used to run pipelines for .NET projects is encapsulated in a NuGet package which is published on its own pipeline in a separate repository; this allows us to keep our pipeline definitions simple while re-using common functionality from that versioned package:
The pipeline is separated into stages, which are fairly standard:
...etcetera. Now since we're using NuGet, you'd think we'd be using NuGet's built-in functionality to publish our packages to Artifactory. However, we make extensive use of repository sub-paths to organize our published artifacts, and due to the way NuGet works this is just seriously inconvenient to accomplish. So we call out to jFrog's CLI instead:
That's the 'publish' target. The issue in this thread is relevant to our 'promote' target. Before this fix was implemented, we used the following target to 'promote' artifacts from a staging repository to a production repository:
After the fix, we were able to simplify to the following:
If you're curious about any of the moves we made here, or you're curious about how we're leveraging your CLI tooling and Artifactory itself at my organization, feel free to email me at my corporate account (malioto@ wayfair.com). |
The leading directories are still preserved using CLI version 1.37.1. The
It currently points nothing regarding to this. |
Am using CLI 1.5.0 with server 3.9.4. Probably easiest to illustrate with pictures.
Before:
Effectively I want test/base**#-sub#** to become test/base**#/sub#**, so I start with a
copy
And as indicated in the Copying artifact line of the output, I end up like this
As circled in the after pic, the whole leading path is preserved under the to path.
The text was updated successfully, but these errors were encountered: